Skip to content

Fix Tarball build for Python plugin#833

Open
barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
barnabasdomozi:pythonplugin_fix_tarball
Open

Fix Tarball build for Python plugin#833
barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
barnabasdomozi:pythonplugin_fix_tarball

Conversation

@barnabasdomozi
Copy link
Collaborator

No description provided.

@barnabasdomozi barnabasdomozi force-pushed the pythonplugin_fix_tarball branch from e6d3759 to dadde1f Compare February 18, 2026 16:03
@mcserep mcserep requested review from Copilot and mcserep March 3, 2026 08:17
@mcserep mcserep added Kind: Bug ⚠️ Plugin: Python Issues related to the parsing and presentation of Python projects. Target: Developer environment Developer environment issues consist of CodeCompass or 3rd-party build tooling, configuration or CI. labels Mar 3, 2026
@github-project-automation github-project-automation bot moved this to In progress in Roadmap Mar 3, 2026
@mcserep mcserep added this to Roadmap Mar 3, 2026
@mcserep mcserep added this to the Upcoming Release milestone Mar 3, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-shared and extend LD_LIBRARY_PATH to include python-install/lib.
  • Ensure CodeCompass build environment includes python-install/lib in LD_LIBRARY_PATH.
  • Point Boost’s bootstrap to the installed python3 binary instead of python.

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.

Comment on lines 238 to +242
--quiet \
--prefix=$DEPS_INSTALL_RUNTIME_DIR/python-install \
--with-openssl=$DEPS_INSTALL_RUNTIME_DIR/openssl-install \
--enable-optimizations
--enable-optimizations \
--enable-shared
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
:$LD_LIBRARY_PATH
${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind: Bug ⚠️ Plugin: Python Issues related to the parsing and presentation of Python projects. Target: Developer environment Developer environment issues consist of CodeCompass or 3rd-party build tooling, configuration or CI.

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants