Repository navigation
Conversation
…ith --enable-relocatable The installed idle3, pydoc3 and python-config Python scripts start with "#!" and the absolute path of the interpreter. That path is wrong once the installation is moved, and a "#!" line can't hold a path that has spaces or is too long. With --enable-relocatable, start them with a /bin/sh wrapper that runs the interpreter by its location relative to the script. python-config.py in the config directory gets the same wrapper, when the bin directory is "bin" in the prefix. Where the realpath command is available, the wrapper also follows a symlink to the script. Without the option the generated scripts are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The installed
idle3,pydoc3andpython-configPython scripts start with#!and the absolute path of the interpreter, so they stop working once the installation is moved. A#!line also can't hold a path that has spaces, and its length is limited.With
--enable-relocatable, these scripts now start with a small/bin/shwrapper that runs the interpreter by its location relative to the script.python-config.pyin the config directory gets the same wrapper when that directory and the bin directory are both underexec_prefix. Where therealpathcommand is available, the wrapper also follows a symlink to the script. Without the option, the generated scripts are unchanged.This patch is inspired by python-build-standalone#395 that ships similar wrappers, with the following differences:
--to avoid noise on BusyBoxrealpathis unavailable (still fails if run through a symlink withoutrealpath)python-config.pyin the installed config dir gets correct../../../bin/relative pathWritten with assistance from Claude Fable 5.2