Skip to content

Run leapp in Python Isolated mode (update shebang)#904

Draft
tomasfratrik wants to merge 1 commit into
oamg:mainfrom
tomasfratrik:3rd-party-components-fix
Draft

Run leapp in Python Isolated mode (update shebang)#904
tomasfratrik wants to merge 1 commit into
oamg:mainfrom
tomasfratrik:3rd-party-components-fix

Conversation

@tomasfratrik
Copy link
Copy Markdown
Member

@tomasfratrik tomasfratrik commented Jul 23, 2025

Originally, leapp was usually executed only with <platform-python>, without any additional Python parameters. However, this led to various problems when running leapp on systems with additional third-party (or custom) Python libraries that could override the original libraries provided by the Linux distribution in use.

For that reason, we decided to update the shebang in the /usr/bin/leapp executable provided by the leapp RPM, so that leapp starts in isolated Python mode and ignores the user's environment.

Note that the current shebang contains a duplicated I parameter. As this does not have any functional impact, and we could not come up with a solution in the SPEC file to fix it, we decided to keep it as is.

@github-actions
Copy link
Copy Markdown

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please @oamg/developers to notify leapp developers of the review request
  • /packit copr-build to submit a public copr build using packit

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and leapp-repository*main* as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp-repository*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and leapp-repository*main* as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp-repository*PR42* as artifacts

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@tomasfratrik tomasfratrik force-pushed the 3rd-party-components-fix branch from 6e23ed1 to 0c81a40 Compare July 25, 2025 13:20
Comment thread packaging/leapp.spec Outdated
@pirat89 pirat89 added the bug label Aug 14, 2025
@pirat89 pirat89 added this to the 8.10/9.8 milestone Aug 14, 2025
@pirat89 pirat89 modified the milestones: 8.10/9.8, 8.10/9.9 Feb 10, 2026
@pirat89 pirat89 force-pushed the 3rd-party-components-fix branch 2 times, most recently from c794f41 to 35d4940 Compare April 20, 2026 07:08
@pirat89 pirat89 force-pushed the 3rd-party-components-fix branch from 35d4940 to 5afbdb6 Compare May 21, 2026 21:16
@pirat89 pirat89 self-assigned this May 21, 2026
@pirat89 pirat89 changed the title Add shebang Run leapp in Python Isolated mode (update shebang) May 25, 2026
@pirat89 pirat89 force-pushed the 3rd-party-components-fix branch from 66715fe to 5afbdb6 Compare May 25, 2026 10:21
@pirat89
Copy link
Copy Markdown
Member

pirat89 commented May 25, 2026

After the shebang update, I cannot get rid of a duplicit I definition, but functionally double II has no negative impact in comparison to I, see:

#! /usr/bin/python3.6 -sII

Note that for packages built in downstream the shebang points to platform-python instead of python3.6. You can see the difference for between upstream and downstream packaages already, so I expect the behaviour is same with newly modified shebangs, but I haven't tried to create a downstream build with updated shebang yet.

@bocekm
Copy link
Copy Markdown
Member

bocekm commented May 25, 2026

AI for @pirat89:

  • create a ticket for this in Jira
  • under the ticket include also using the -I switch in leapp-repository where leapp is being called

@pirat89 pirat89 modified the milestones: 8.10/9.9, 8.10/9.10 May 26, 2026
@pirat89 pirat89 marked this pull request as draft May 26, 2026 07:21
@pirat89
Copy link
Copy Markdown
Member

pirat89 commented May 26, 2026

switching to draft so it's not merged by mistake before we wanted. postponed for 8.10/9.10 milestone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants