-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Pants 2.24 - "IntrinsicError: path_metadata_request error: path for PathNamespace.SYSTEM must an absolute path. Instead, got ``" #21954
Comments
I vaguely remember some discussion in the past year or two, about whether PATHs should be sanitized on print, printed out at all, could they leak data, etc etc etc. An aside from all that, depending on where this is called from and whether we consume the whole path, or if we iterate through the PATH entries, we might even be able to point to the char index in the PATH (if we didn’t want to print out the PATH itself). |
It is also trivial to just silently skip or warn about empty path entries in the relevant logic: pants/src/python/pants/core/util_rules/system_binaries.py Lines 655 to 658 in 684413b
We should also probably add a |
And that |
Yeah, just ignoring empty path entries seems fine? it has no meaning AFAICT. @darrenclark want to take a crack at it? It may be as simple as changing that to |
@darrenclark thank you for the report, would you mind checking if this still occurs with 2.24.2rc0 which includes #21916 ? |
Not in bash: :; cat << EOF > hey-what-about-me?
∙ #!/usr/bin/env bash
∙
∙ echo "I'm Alive!"
∙ EOF
:; chmod +x hey-what-about-me\?
:; ./hey-what-about-me\?
I'm Alive!
:; hey-what-about-me\?
hey-what-about-me?: command not found
:; PATH=":$PATH" hey-what-about-me\?
I'm Alive!
:; PATH="::$PATH" hey-what-about-me\?
I'm Alive!
:; PATH="$PATH:" hey-what-about-me\?
I'm Alive!
:; PATH="$PATH::" hey-what-about-me\?
I'm Alive! I don't use this sort of setup, but I've known many people who do. They always want |
Ah, if empty means the same as |
To clarify, these are paths being used for searching for binaries for |
They do (and should) mean the CWD. Which most of the time is the build root, but doesn't strictly have to be. |
Sure! I will take a go at this |
Right, but to clarify my point: There are multiple processes in play here so the question becomes: Which process's working directory should be chosen when Allowing If we choose the pants daemon, for example, then we should just resolve blank strings or |
I pushed up a commit here that seems to fix things for me - main...darrenclark:fix-issue-21954 As a side effect, it seems like |
I'm seeing this exact same error while running in the pants export --py-resolve-format=symlinked_immutable_virtualenv --resolve=python-default
source dist/export/python/virtualenvs/python-default/3.11.6/bin/activate
pants package models/text_classifier_service output:
Seeing it on the latest stable I have to work around it by spinning up a non-virtualenv shell for now. |
Thanks for posting that patch. FWIW, I think that a simple unconditional
And also, I think |
Describe the bug
On Pants 2.24 I started getting an error when running
pants generate-lockfiles --resolve=nodejs-default
:Pants version
2.24.0
OS
MacOS
Additional info
I tracked down the issue to an empty path (
::
) in my PATH, ie:export PATH=/path/one:/path/two::/path/three
It'd be nice if the error message included something like "please check your PATH for any empty entries (::)"
The text was updated successfully, but these errors were encountered: