Skip to content
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

Can't use adhoc_tool with workspace #21815

Open
mnowotnik opened this issue Jan 9, 2025 · 3 comments
Open

Can't use adhoc_tool with workspace #21815

mnowotnik opened this issue Jan 9, 2025 · 3 comments
Labels
backend: Environments {local,docker,remote}._environment-related issues bug

Comments

@mnowotnik
Copy link

Describe the bug
Attempts to run a target with adhoc_tool with environment="__local_workspace__" crash.

Error:

python3.9: can't open file '/Users/michalnowotnik/Projects/pants-poc/./pex': [Errno 2] No such file or directory

Pants version
2.24.0.rc0

OS
Just checked MacOS.

Additional info
Minimal example: https://github.com/mnowotnik/pants-poc

@mnowotnik mnowotnik added the bug label Jan 9, 2025
@cburroughs cburroughs added the backend: Environments {local,docker,remote}._environment-related issues label Jan 9, 2025
@cburroughs
Copy link
Contributor

Thanks for the detailed bug report and example repo! Is there prior version of Pants this example does work with?

@mnowotnik
Copy link
Author

From 2.22.0 (when workspace was introduced) to 2.23.1 it gives error:
image
and for 2.24.0.rc0 and 2.25.0.dev3 it gives error:

python3.9: can't open file '/Users/michalnowotnik/Projects/pants-poc/./pex': [Errno 2] No such file or directory

So effectively no regression, just different error.

@mnowotnik
Copy link
Author

mnowotnik commented Jan 9, 2025

find_interpreter from pex.py appears to be running in non-sandboxed environment for some reason. Strange, because it's not actually running the code, but only calculating python exec hash.
Without __local_environment__ it runs in sandbox with the following files:

❯ ls -a  /private/var/folders/tf/7pgqpxt9281gc29h16pt78380000gp/T/pants-sandbox-VSk5zW
.				..				.cache				.python-build-standalone	.tmp				__run.sh			pex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Environments {local,docker,remote}._environment-related issues bug
Projects
None yet
Development

No branches or pull requests

2 participants