-
-
Notifications
You must be signed in to change notification settings - Fork 395
${HYPERFINE_ITERATION} is not visible in prepare or conclude commands #781
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
Labels
Milestone
Comments
I can work around it by changing the directory structure and using a recursive cleanup command (instead of conclude) but this might not be practical in some situations. For example if there is limited storage space on the test system, each data file would need to be cleaned up before the next one can be written. |
Thank you, this should be easy to fix, I think. |
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the $HYPERFINE_ITERATION variable to preparation commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the `$HYPERFINE_ITERATION` variable to preparation commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the `$HYPERFINE_ITERATION` variable to intermediate commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the `$HYPERFINE_ITERATION` variable to intermediate commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the `$HYPERFINE_ITERATION` variable to intermediate commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
willcl-ark
added a commit
to willcl-ark/hyperfine
that referenced
this issue
Mar 13, 2025
Fixes: sharkdp#781 Expose the `$HYPERFINE_ITERATION` variable to intermediate commands. This will allow iteration-specific prepare/conclude, such as: ```bash hyperfine --runs 5 --prepare 'echo touch file${HYPERFINE_ITERATION}.dat' \ 'echo testing file${HYPERFINE_ITERATION}.dat' \ --conclude 'echo rm file${HYPERFINE_ITERATION}.dat' --show-output ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thought I could use the
${HYPERFINE_ITERATION}
env variable that is exposed (mentioned as a solution in #778) ; however this is only accessible in the main command of the iteration, not the prepare or conclude steps for each iteration.So for example if I want to prepare , test and cleanup a series of files, I would do something like this (with
echo
for illustrative purposes) :However this does not work because the env var is not exposed in all the steps:
so it's not possible to prepare and clean up each file.
The text was updated successfully, but these errors were encountered: