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
Kompile executes post-processing command in modified environment #2974
Comments
@dwightguth are we still using the extra path added to |
This particular behavior is necessary so that k will always call its own version of any tools that exist even if the tool being run isn't the version on the path. For example, if I say We can probably remove the native directory from the path though as I believe that was specifically to deal with windows particularities, and we don't support windows natively anymore. |
The particular issue I have is the following. Consider the following dummy post-processing script: # ./script
echo VIRTUAL_ENV=$VIRTUAL_ENV
echo PATH=$PATH
which python3
python3 -c 'from pyk.kast import KVariable ; print(KVariable("hello"))' (Obviously, this is not a proper post-processing script, as its output is not well formed KAST JSON.) In order to have the % poetry install --quiet && poetry run sh ./script and the output, as expected, will be something like
However, when ran as a post-process script like % poetry install --quiet && poetry run kompile k-files/imp.k --post-process 'sh ./script' the output becomes
That is, the My opinion is the post-process scripts should be executed in the caller's environment (with perhaps a few documented additions that do not interfere with it), even if |
What you describe may be possible but it might be simpler simply to add a directory that only contains k binaries to the path instead. |
Workaround for runtimeverification/k#2974 Co-authored-by: devops <devops@runtimeverification.com>
~Blocked on: runtimeverification/k#2974 Fixes #41 Co-authored-by: devops <devops@runtimeverification.com>
Workaround for #2974 Co-authored-by: devops <devops@runtimeverification.com>
Workaround for #2974 Co-authored-by: devops <devops@runtimeverification.com>
…ation/pyk#48) ~Blocked on: #2974 Fixes #41 Co-authored-by: devops <devops@runtimeverification.com>
Workaround for #2974 Co-authored-by: devops <devops@runtimeverification.com>
…ation/pyk#48) ~Blocked on: #2974 Fixes #41 Co-authored-by: devops <devops@runtimeverification.com>
Workaround for #2974 Co-authored-by: devops <devops@runtimeverification.com>
…ation/pyk#48) ~Blocked on: #2974 Fixes #41 Co-authored-by: devops <devops@runtimeverification.com>
Workaround for #2974 Co-authored-by: devops <devops@runtimeverification.com>
…ation/pyk#48) ~Blocked on: #2974 Fixes #41 Co-authored-by: devops <devops@runtimeverification.com>
When running
kompile
with--post-process <command>
, one would expect thatcommand
is executed in the caller's environment (extended perhaps with a few variables that do not clash with existing ones).This is not the case however. Consider e.g.
script.sh
:Then
produces
whereas
produces
Notably,
$PATH
is extended with new directories, so command names might resolve to different files.The text was updated successfully, but these errors were encountered: