Repository navigation
Conversation
dwoz
marked this pull request as draft
November 25, 2026 08:01
dwoz
force-pushed
the
native-packages-3008.x
branch
from
November 25, 2026 09:31
1e6b784 to
fc5559e
Compare
Re-introduces the pre-onedir "native" packaging flavor where Salt
installs into the distro's system Python under
/usr/lib/python3/<dist-packages|site-packages>/salt/ rather than the
self-contained /opt/saltstack/salt/ relenv tree. Native and onedir
coexist in the same spec/rules tree; flavor is selected at build time
via `rpmbuild --with native --define 'native_slug <slug>'` or
`SALT_NATIVE=1 SALT_NATIVE_SLUG=<slug> debuild`. The onedir rendered
spec is semantically identical to today's upstream save for the
SALT_SHELL latent-bug fix (useradd now honors the documented knob).
* tools/pkg/native_deps.py: audit tool with audit/floors/vendor-plan/
list-platforms subcommands. Full 9-distro audit matrix committed
under cicd/native-deps/ (AL2023, Debian 12/13, Fedora 43, Photon 5,
Rocky 9, Ubuntu 22.04/24.04/26.04).
* pkg/common/salt-vendor.pth: prepends salt/_vendor/ to sys.path at
interpreter startup. .pth rather than sitecustomize.py because
Debian's base python3 ships a sitecustomize.py that would shadow
ours.
* pkg/rpm/salt.spec: %bcond_with native plus forked %build / %install
/ %files / scriptlet blocks. Hardened mode is the default on
native; onedir behavior unchanged aside from the SALT_SHELL fix.
Native release is tagged .native so `rpm -q` reveals the flavor.
New `tools pkg build rpm --native --native-slug=<slug>` wraps
rpmbuild with vendor-wheel pre-staging.
* pkg/debian/rules: SALT_NATIVE=1 branch does `python3 -m build
--wheel`, pip-installs the wheel with DEB_PYTHON_INSTALL_LAYOUT=
deb_system, materializes salt/_vendor/, drops salt-vendor.pth,
redistributes /usr/bin scripts across per-daemon packages matching
the onedir .links layout, and ships /etc/salt/.pkg-native so
postinst scripts default to hardened mode. salt-common.preinst is
sed-patched at build time to apply the hardened default before the
marker file is unpacked. /etc/salt/pki/minion added to
salt-minion.dirs.
* .github/workflows/build-packages.yml: new native-rpm and native-deb
jobs matrixed over (slug x arch), each building inside the matching
ghcr.io salt-ci-containers image. Artifacts:
salt-<ver>-<arch>-<slug>-{rpm,deb}-native.
* .github/workflows/templates/layout.yml.jinja: native_rpm paths-
filter group + prepare-workflow output for the slug list. PR CI
fires the native matrix only on changes to pkg/rpm/,
pkg/common/salt-vendor.pth, tools/pkg/{build,native_deps}.py, or
cicd/native-deps/**. Nightly/release always build the full matrix.
Slug list lives in cicd/shared-gh-workflows-context.yml as
`native-rpm-slugs`.
Verified end-to-end:
- rpmbuild --with native --define 'native_slug photonos-5' produces
7 .native.x86_64.rpm; install into fresh Photon 5 container;
salt-call --local test.ping returns True as the salt user with
state dirs chowned under /var/lib/salt/minion/; operator
overrides via /etc/sysconfig/salt-minion-setup
(SALT_USER/GROUP/HOME/SHELL/NAME) all honored.
- SALT_NATIVE=1 debuild produces 8 debs; install into fresh
Debian 12 container; salt-call --local test.ping returns True
as the salt user with vendored looseversion loaded from
salt/_vendor/, state dirs chowned under /var/lib/salt/minion/.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-introduces the pre-onedir "native" packaging flavor where Salt installs into the distro's system Python under
/usr/lib/python3/<dist-packages|site-packages>/salt/ rather than the self-contained /opt/saltstack/salt/ relenv tree. Native and onedir coexist in the same spec/rules tree; flavor is selected at build time via
rpmbuild --with native --define 'native_slug <slug>'orSALT_NATIVE=1 SALT_NATIVE_SLUG=<slug> debuild. The onedir rendered spec is semantically identical to today's upstream save for the SALT_SHELL latent-bug fix (useradd now honors the documented knob).tools/pkg/native_deps.py: audit tool with audit/floors/vendor-plan/ list-platforms subcommands. Full 9-distro audit matrix committed under cicd/native-deps/ (AL2023, Debian 12/13, Fedora 43, Photon 5, Rocky 9, Ubuntu 22.04/24.04/26.04).
pkg/common/salt-vendor.pth: prepends salt/_vendor/ to sys.path at interpreter startup. .pth rather than sitecustomize.py because Debian's base python3 ships a sitecustomize.py that would shadow ours.
pkg/rpm/salt.spec: %bcond_with native plus forked %build / %install / %files / scriptlet blocks. Hardened mode is the default on native; onedir behavior unchanged aside from the SALT_SHELL fix. Native release is tagged .native so
rpm -qreveals the flavor. Newtools pkg build rpm --native --native-slug=<slug>wraps rpmbuild with vendor-wheel pre-staging.pkg/debian/rules: SALT_NATIVE=1 branch does
python3 -m build --wheel, pip-installs the wheel with DEB_PYTHON_INSTALL_LAYOUT= deb_system, materializes salt/_vendor/, drops salt-vendor.pth, redistributes /usr/bin scripts across per-daemon packages matching the onedir .links layout, and ships /etc/salt/.pkg-native so postinst scripts default to hardened mode. salt-common.preinst is sed-patched at build time to apply the hardened default before the marker file is unpacked. /etc/salt/pki/minion added to salt-minion.dirs..github/workflows/build-packages.yml: new native-rpm and native-deb jobs matrixed over (slug x arch), each building inside the matching ghcr.io salt-ci-containers image. Artifacts: salt----{rpm,deb}-native.
.github/workflows/templates/layout.yml.jinja: native_rpm paths- filter group + prepare-workflow output for the slug list. PR CI fires the native matrix only on changes to pkg/rpm/, pkg/common/salt-vendor.pth, tools/pkg/{build,native_deps}.py, or cicd/native-deps/**. Nightly/release always build the full matrix. Slug list lives in cicd/shared-gh-workflows-context.yml as
native-rpm-slugs.Verified end-to-end:
rpmbuild --with native --define 'native_slug photonos-5' produces 7 .native.x86_64.rpm; install into fresh Photon 5 container; salt-call --local test.ping returns True as the salt user with state dirs chowned under /var/lib/salt/minion/; operator overrides via /etc/sysconfig/salt-minion-setup (SALT_USER/GROUP/HOME/SHELL/NAME) all honored.
SALT_NATIVE=1 debuild produces 8 debs; install into fresh Debian 12 container; salt-call --local test.ping returns True as the salt user with vendored looseversion loaded from salt/_vendor/, state dirs chowned under /var/lib/salt/minion/.
What does this PR do?
What issues does this PR fix or reference?
Fixes
Previous Behavior
Remove this section if not relevant
New Behavior
Remove this section if not relevant
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes/No