python / python/cpython

python3-config folder dependent result

Ouverte
#101,735 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

build type-bug
Langage dominant
Python
Étoiles
77.2k
Forks
36k
Métriques de merge des PR
Métriques de PR en attente

Description

Bug report

Python is build into a manylinux_2_28 docker image with following commands (image is py3.11-latest from my dockerhub repo, created with this Dockerfile):

./configure --enable-shared --enable-optimizations --disable-test-modules --prefix=/opt/build_python/installed
make altinstall

the process ends correctly, at the end I found the content into expected folder

/opt/build_python/installed/lib
├── [lrwxrwxrwx root     root    ]  libpython3.11.so -> libpython3.11.so.1.0
├── [-rwxr-xr-x root     root    ]  libpython3.11.so.1.0
├── [-rwxr-xr-x root     root    ]  libpython3.so
/opt/build_python/installed/bin
├── [-rwxr-xr-x root     root    ]  2to3-3.11
├── [-rwxr-xr-x root     root    ]  idle3.11
├── [-rwxr-xr-x root     root    ]  pip3.11
├── [-rwxr-xr-x root     root    ]  pydoc3.11
├── [-rwxr-xr-x root     root    ]  python3.11
└── [-rwxr-xr-x root     root    ]  python3.11-config

and if I run python3.11-config FROM INSIDE that folder I obtain the expected result (look at the -L part)

[root@919ee1a66e62 opt]# /opt/build_python/installed/bin/python3.11-config --embed --ldflags
 -L/opt/build_python/installed/lib -lpython3.11 -lpthread -ldl  -lutil -lm

If I do link that executable into /usr/local/bin and then run the same command, the output at -L flag part is different:

[root@919ee1a66e62 opt]# ln -s /opt/build_python/installed/bin/python3.11-config /usr/local/bin/python3-config

[root@919ee1a66e62 opt]# file /usr/local/bin/python3-config
/usr/local/bin/python3-config: symbolic link to /opt/build_python/installed/bin/python3.11-config

[root@919ee1a66e62 opt]# ls -l /usr/local/bin/python3-config
lrwxrwxrwx 1 root root 49 Feb  9 10:05 /usr/local/bin/python3-config -> /opt/build_python/installed/bin/python3.11-config

[root@919ee1a66e62 opt]# /usr/local/bin/python3-config --embed --ldflags
 -L/usr/local/lib -lpython3.11 -lpthread -ldl  -lutil -lm

this difference, when building C extension, led to have an error on dl phase cannot find -lpython3.11: No such file or directory because of wrong lib folder used.

I expected that python3-config's output, even if executed via symlink, should be the same.

Please let me know if my expectation is not correct, thanks.

Your environment

A manylinux_2_28_86_x64 docker image used to build python 3.11.1 into.
Then doing the steps above into the docker container.

  • CPython versions tested on: 3.11.1
  • Operating system and architecture: manylinux (CentOS) , x64

Thanks for this awesome programming language.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par les commandes configure et make altinstall signalées, puis examinez les fichiers générés /opt/build_python/installed/bin/python3.11-config et Dockerfile_2_28_x64_py311. Exécutez sa forme --embed --ldflags directement et via le lien symbolique /usr/local/bin/python3-config, et déterminez si les deux invocations devraient produire le même chemin de bibliothèque.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python, shell
Domaine
build-system
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.