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

Ensure that the PEX_ROOT is always a realpath. #2626

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

benjyw
Copy link
Collaborator

@benjyw benjyw commented Dec 13, 2024

In almost all codepaths, a pex_root will be a realpath. See, e.g.,

pex_root = os.path.realpath(os.path.expanduser(self.raw_pex_root))

return os.path.realpath(os.path.expanduser(value))

However there was one codepath by which a non-realpath could
be obtained, namely boot() callingVariables.PEX_ROOT.value_or()
with a raw_pex_root given as the fallback value.

This change ensures that Variables.PEX_ROOT is always a realpath.

This manifested as a bug at pex boot time in the presence of a
symlinked cache dir: pantsbuild/pants#21321

@benjyw
Copy link
Collaborator Author

benjyw commented Dec 13, 2024

I've verified that this fixes pantsbuild/pants#21321

@jsirois
Copy link
Member

jsirois commented Dec 13, 2024

@benjyw thanks for figuring this one out and fixing. I'm going to merge and get a release prepped.

@jsirois jsirois merged commit da1b64f into pex-tool:main Dec 13, 2024
23 checks passed
@benjyw benjyw deleted the ensure_pexroot_realpath branch December 13, 2024 23:43
benjyw added a commit to pantsbuild/pants that referenced this pull request Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants