-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate installation of the iai-callgrind-runner binary in case it cannot be found in the PATH #14
Comments
To opt-out of the automatic installation an environment variable |
Have you thought about some magic like letting the main! macro expand to a check for a command line flag or so that then branches to the code for the callgrind runner? So the main! macro first runs its normal code and then forks itself with a new command line parameter and then runs the callgrind runner? I would really love a solution where you don't need to do any manual steps but I also don't really like automatic install. It would probably depend on things from the host that the user then can't control that easily any more. |
Thanks for sharing your opinion :) A problem with passing command line arguments to the benchmarks via Currently, I tend to making the automatic installation opt-in instead of opt-out. Maybe this'll solve your concerns? There are mainly two use cases I would like to address. First, simplify running and installing iai-callgrind in the CI, docker etc. and 2nd running iai-callgrind when there are multiple local repos with different versions of iai-callgrind.
The automatic installation routine would make use of |
Currently, when running a
iai-callgrind
benchmark, the path to theiai-callgrind-runner
binary is determined byIAI_CALLGRIND_RUNNER
environment variablePATH
and iai-callgrind benchmarks fail if the binary cannot be found in the
PATH
. Both options rely on user interaction to install the binary. Managing the installation of the binary can be automated and especially setting up iai-callgrind in the ci would be simplified. Also, updating the library requires user interaction to also update the runner to the exact same version. The following procedure could solve these issues (IAI_CALLGRIND_VERSION
is the library version):IAI_CALLGRIND_RUNNER
environment variablePATH
$XDG_CACHE_DIR/iai-callgrind/$IAI_CALLGRIND_VERSION/bin
$HOME/.cache/iai-callgrind/$IAI_CALLGRIND_VERSION/bin
target/iai-callgrind/$IAI_CALLGRIND_VERSION/bin
If all of these directories don't contain the
iai-callgrind-runner
binary, automatically install the binary in the path3. - 5.
depending on the existence ofXDG_CACHE_DIR
or$HOME/.cache
.5.
is the safe fallback.The text was updated successfully, but these errors were encountered: