Fix Tarball build for Python plugin#833
Fix Tarball build for Python plugin#833barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
Conversation
e6d3759 to
dadde1f
Compare
There was a problem hiding this comment.
Pull request overview
Updates the GitLab CI dependency/toolchain build scripts to support building and running the Python plugin from tarball artifacts, primarily by producing a shared Python build and ensuring its runtime libraries are discoverable.
Changes:
- Build CPython 3.9 with
--enable-sharedand extendLD_LIBRARY_PATHto includepython-install/lib. - Ensure CodeCompass build environment includes
python-install/libinLD_LIBRARY_PATH. - Point Boost’s bootstrap to the installed
python3binary instead ofpython.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .gitlab/build-deps.sh | Builds Python as shared, exports Python lib dir to LD_LIBRARY_PATH, and switches Boost’s --with-python to python3. |
| .gitlab/build-codecompass.sh | Extends build-time LD_LIBRARY_PATH with the Python lib directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --quiet \ | ||
| --prefix=$DEPS_INSTALL_RUNTIME_DIR/python-install \ | ||
| --with-openssl=$DEPS_INSTALL_RUNTIME_DIR/openssl-install \ | ||
| --enable-optimizations | ||
| --enable-optimizations \ | ||
| --enable-shared |
There was a problem hiding this comment.
--enable-shared typically makes the installed python3 binary depend on libpython3.9.so in $DEPS_INSTALL_RUNTIME_DIR/python-install/lib. Right now this script compensates by exporting LD_LIBRARY_PATH later, but other runtime entrypoints (e.g. .gitlab/cc-env.sh, which is used for running tools interactively) don’t include python-install/lib, so python3 can fail to start outside this script. Consider either (a) updating the runtime environment scripts to include python-install/lib as well, or (b) adding an rpath during the Python build so the interpreter can locate its own lib directory without relying on LD_LIBRARY_PATH.
There was a problem hiding this comment.
Maybe this is a valid concern? @barnabasdomozi
|
|
||
| export LD_LIBRARY_PATH=$DEPS_INSTALL_RUNTIME_DIR/odb-install/lib\ | ||
| :$DEPS_INSTALL_RUNTIME_DIR/python-install/lib\ | ||
| :$LD_LIBRARY_PATH |
There was a problem hiding this comment.
This LD_LIBRARY_PATH construction can leave a trailing : when $LD_LIBRARY_PATH is empty/unset, which adds the current working directory to the dynamic loader search path. To avoid security/non-determinism issues, append the existing value conditionally (only when non-empty).
| :$LD_LIBRARY_PATH | |
| ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} |
No description provided.