Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove dependency on /usr/bin/python3 #93

Open
wants to merge 1 commit into
base: release/3006.0
Choose a base branch
from

Conversation

pgajdos
Copy link

@pgajdos pgajdos commented Aug 22, 2024

remove dependency on /usr/bin/python3 using %python3_fix_shebang{,_path} macros, [bsc#1212476]

See
https://trello.com/c/RE0ZBjLe/162-remove-dependency-on-usr-bin-python3-from-factory-packages
https://build.opensuse.org/request/show/1183849

Copy link
Member

@meaksh meaksh left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @pgajdos, and sorry for the delay on a review here!

Unfortunately, we need some adjustments here to avoid breaking the build for other OSes that are using this same spec file.

@@ -1101,6 +1100,18 @@ install -Dpm 0640 conf/suse/standalone-formulas-configuration.conf %{buildroot}%
%fdupes %{buildroot}%{python3_sitelib}
%endif

%python3_fix_shebang
Copy link
Member

Choose a reason for hiding this comment

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

We use this exact spec file for building different the "salt" package for different OSes, including old SLE15 versions and CentOS8/RES8, as you can see here:

https://build.opensuse.org/package/show/systemsmanagement:saltstack:products:testing/salt

This makes changes on this spec file a little bit tricky, as i.a. %python3_fix_shebang and some other macros are not available for all those OSes.

I would recommend to isolate your changes under the scope of %if %{suse_version} >= 1600, to prevent affecting the other OSes.

Copy link

Choose a reason for hiding this comment

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

I would much prefer some kind of shim, that would be more robust:

# Compat stub for python3_fix_shebang_path
%{?!python3_fix_shebang_path:%define python3_fix_shebang_path(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) \\\
    myargs="%{**}" \
    for f in ${myargs}; do \
        [ -f "$f" ] && sed -i -e "1s@#\\!.*python.*@#\\!$(realpath %__python3)@" $f \
    done
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants