Skip to content

gh-78292: Improve python-config build script to respect symbolic link. - #156240

Open
farhaanbukhsh wants to merge 1 commit into
python:mainfrom
farhaanbukhsh:farhaan/gh-78292-fix-symlink-config
Open

gh-78292: Improve python-config build script to respect symbolic link.#156240
farhaanbukhsh wants to merge 1 commit into
python:mainfrom
farhaanbukhsh:farhaan/gh-78292-fix-symlink-config

Conversation

@farhaanbukhsh

@farhaanbukhsh farhaanbukhsh commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR uses realpath so that we can get the actual path of the repository even if it is a symbolic link. This way the python-config script will produce the right paths even when it is linked to a different location.

Testing instructions

These are manual testing instructions that I followed to test the PR.

Without the changes in the PR:

  1. ./configure --with-pydebug
  2. make python-config
mkdir -p /tmp/cpython-repro/bin

cp python-config /tmp/cpython-repro/bin/python3-config
chmod +x /tmp/cpython-repro/bin/python3-config
  1. /tmp/cpython-repro/bin/python3-config --prefix will produce output /tmp/cpython-repro
  2. mkdir -p /tmp/elsewhere/bin
  3. ln -s /tmp/cpython-repro/bin/python3-config /tmp/elsewhere/bin/python3-config
  4. /tmp/elsewhere/bin/python3-config --prefix this show produce the output /tmp/elsewhere which is the bug
  5. Once you check out the PR and repeat the above steps the command /tmp/elsewhere/bin/python3-config --prefix will produce /tmp/cpython-repro, which is expected.

…c link.

Signed-off-by: Farhaan Bukhsh <farhaan.bukhsh@gmail.com>
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