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

Implement `--executable' option (#257) #258

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

riastradh
Copy link
Contributor

@riastradh riastradh commented Jan 15, 2025

Resolves: #257

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 23, 2025
https://github.com/pypa/installer/issue/257
pypa/installer#258

This wille enable us to install Python scripts with #! lines for
LOCALBASE rather than TOOLBASE (or, from another perspective,
CROSS_LOCALBASE rather than LOCALBASE).  For example, if you're doing
cross-builds in /home/user/pkg for /usr/pkg, the Python executable
running installer will be /home/usr/pkg/bin/python3.12 at build-time
but we need to bake /usr/pkg/bin/python3.12 into the build product.
tests/test_main.py Outdated Show resolved Hide resolved
@riastradh riastradh force-pushed the riastradh-issue257-executableopt branch from a736e73 to 6ee84f5 Compare January 28, 2025 14:14
tests/test_main.py Outdated Show resolved Hide resolved
@riastradh riastradh force-pushed the riastradh-issue257-executableopt branch from 6ee84f5 to b912532 Compare January 28, 2025 15:52
@Secrus Secrus merged commit 375cd94 into pypa:main Jan 29, 2025
18 checks passed
@pradyunsg
Copy link
Member

@Secrus This was something that had been discussed in #107 prior, with the conclusion being to not do this. The specific request in #257 is effectively unchanged relative to that and I strongly think this is a misfeature we should not support.

Secrus added a commit that referenced this pull request Jan 30, 2025
@Secrus
Copy link
Member

Secrus commented Jan 30, 2025

@pradyunsg Oh, I didn't know that existed before... I will revert this feature.

@riastradh sorry, I missed some history lessons on the previous decisions in the project. Thank you for doing the work, but your feature won't be happening.

@riastradh
Copy link
Contributor Author

riastradh commented Jan 30, 2025

That's disappointing. It looks like we will end up having to maintain this tiny eight-line patch locally anyway for the necessary functionality, which raises the maintenance burden (but is almost certainly a lower maintenance burden than writing and maintaining our own scripts).

I understand that this is your project, not mine, and I'm asking for you to volunteer time on this, but can I trouble you to expand on why --prefix and --destdir are acceptable while --executable is not? All three are needed in order to install into a fixed file system layout, as I explained at #257.

I read the discussion at #107 but I didn't understand what makes --executable so much more objectionable than --prefix or --destdir. For example, "one of the things I want to avoid is redistributors inventing their own target schemes" suggests to me that redistributors should be using bog-standard upstream-maintained tooling like pypa-installer instead of rolling their own custom scripts to install wheels, but you're suggesting everyone do the latter instead, which I don't understand.

Secrus added a commit that referenced this pull request Jan 30, 2025
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.

--executable option to override sys.executable
3 participants