-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Absolutize all of the execute_pex_args in the venv script. #12727
Absolutize all of the execute_pex_args in the venv script. #12727
Conversation
[ci skip-rust] [ci skip-build-wheels]
77f972c
to
694952f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for figuring this out!
@@ -943,6 +944,7 @@ async def create_venv_pex( | |||
pex=pex.script, | |||
python=python.script, | |||
bin=FrozenDict((bin_name, venv_script.script) for bin_name, venv_script in scripts.items()), | |||
venv_rel_dir=venv_rel_dir.as_posix(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Folks have a habit of doing this, but str(venv_rel_dir)
will be Windows-proof and is actually correct today too.
@@ -852,6 +852,7 @@ class VenvPex: | |||
pex: Script | |||
python: Script | |||
bin: FrozenDict[str, Script] | |||
venv_rel_dir: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably good to tack on ~ # for tests
to be friendly to future refactorers.
…d#12727) The absolutizing of `execute_pex_args` was being applied to the entire list of arguments, rather than to individual arguments. When: 1. using a working directory 2. hitting the `Process` cache for VenvPex creation/seeding and missing for execution 3. missing the PEX venv cache ... the relevant `execute_pex_args` code would run to seed the venv, and fail with: ``` pants.engine.process.ProcessExecutionFailure: Process 'Run the pex and check its cwd' failed with exit code 2. stdout: stderr: <snip>/python3.6: can't open file 'test.pex': [Errno 2] No such file or directory ``` ...because the PEX filename was not absolutized. Add a reproducing test, and fix by absolutizing each argument. [ci skip-rust] [ci skip-build-wheels]
…k of #12727) (#12729) The absolutizing of `execute_pex_args` was being applied to the entire list of arguments, rather than to individual arguments. When: 1. using a working directory 2. hitting the `Process` cache for VenvPex creation/seeding and missing for execution 3. missing the PEX venv cache ... the relevant `execute_pex_args` code would run to seed the venv, and fail with: ``` pants.engine.process.ProcessExecutionFailure: Process 'Run the pex and check its cwd' failed with exit code 2. stdout: stderr: <snip>/python3.6: can't open file 'test.pex': [Errno 2] No such file or directory ``` ...because the PEX filename was not absolutized. Add a reproducing test, and fix by absolutizing each argument. [ci skip-rust] [ci skip-build-wheels]
The absolutizing of
execute_pex_args
was being applied to the entire list of arguments, rather than to individual arguments. When:Process
cache for VenvPex creation/seeding and missing for execution... the relevant
execute_pex_args
code would run to seed the venv, and fail with:...because the PEX filename was not absolutized.
Add a reproducing test, and fix by absolutizing each argument.
[ci skip-rust]
[ci skip-build-wheels]