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

perform tilde expansion on path_metadata_request #21900

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cburroughs
Copy link
Contributor

Within the pants repo itself, the inputs to path_metadata_request are commonly used on the components of the PATH variable. These would presumable be valid paths, but people have all sorts of crusty oddities in their shell configs.

In particular if one does something reasonable looking like export PATH="~/.local/bin:$PATH" (note the quotes) than the path component will be a literal ~/.local/bin and not expanded to the home directory. This is because tilde expansion happened before https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06 the quote removal.

Since bash and friends are cool fine with literal tildes in PATH, everyone would reasonable expect pants to be too.

Within the pants repo itself, the inputs to `path_metadata_request` are
commonly used on the components of the `PATH` variable.  These would
presumable be valid paths, but people have all sorts of crusty
oddities in their shell configs.

In particular if one does something reasonable looking like `export
PATH="~/.local/bin:$PATH"` (note the quotes) than the path component
will be a literal `~/.local/bin` and not expanded to the home
directory.  This is because tilde expansion happened *before*
<https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06>
the quote removal.

Since bash and friends are cool fine with literal tildes in `PATH`,
everyone would reasonable expect pants to be too.
@cburroughs cburroughs added this to the 2.24.x milestone Jan 31, 2025
@cburroughs cburroughs self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant