feat(suse): add SLES15 rpm/container build target - #1152
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a native-architecture SLES 15 RPM and container target using zypper.
Changes:
- Adds SLES configuration, routes, and zypper installation support.
- Rejects unsupported cross-architecture worker builds.
- Adds integration coverage and target documentation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
website/docs/targets.md |
Documents the SLES target. |
website/docs/examples/targets.md |
Lists generated SLES routes. |
test/target_suse_test.go |
Adds SLES integration tests. |
targets/plugin/init.go |
Registers SLES routes. |
targets/linux/rpm/suse/sles15.go |
Defines the SLES 15 configuration. |
targets/linux/rpm/suse/common.go |
Defines SUSE packages and repositories. |
targets/linux/rpm/distro/zypper_install.go |
Implements zypper installation. |
targets/linux/rpm/distro/worker.go |
Rejects unsupported cross-architecture builds. |
targets/linux/rpm/distro/distro.go |
Adds the cross-architecture capability flag. |
✅ Deploy Preview for dalec ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
071e394 to
5e90c7f
Compare
|
It seems like this needs a rebase? There's a bunch of content that was already merged in the diff. |
Add SUSE Linux Enterprise 15 as a new rpm distro target built with zypper.
- suse/sles15.go, suse/common.go: ConfigSLES15 distro config (bci-base:15.6
worker, zypper installer, /etc/zypp/repos.d repo layout, native-arch only)
- distro/zypper_install.go: ZypperInstall installer reusing the shared
dnfInstallConfig plumbing (--non-interactive, key import, no --releasever)
- distro.go/worker.go: CrossArchInstallUnsupported flag; worker paths fail
fast for SUSE since zypper lacks dnf's --forcearch/--installroot
- plugin/init.go: register sles15 routes
- test/target_suse_test.go: TestSLES15 with SUSE helpers (no %{?dist} tag,
createrepo_c/zypp repo dir, rpmsign via rpm-build)
- docs: add sles15 to targets.md and examples/targets.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89d10fb5-5e8e-4819-84f8-f0a96dc28fcd
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
…flag The '--rpm-installexcludedocs' argument is not a valid zypper option; zypper rejects it as unknown and fails the install before any package is laid down. Since includeDocs defaults to false, this broke every SLES15 install. Replace it with the libzypp-native mechanism: set 'rpm.install.excludedocs = yes' in zypp.conf (honoring --root) for the invocation when docs should be excluded, preserving parity with the dnf targets' --setopt=tsflags=nodocs behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 89d10fb5-5e8e-4819-84f8-f0a96dc28fcd Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
SLES 15 SP6 (bci-base:15.6) reached end of general support on 2025-12-31, so builds would start from a base without regular public security maintenance. Move the base worker image to the currently-supported 15.7 BCI and update the expected OS release VersionID accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 89d10fb5-5e8e-4819-84f8-f0a96dc28fcd Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
testTargetPlatform selects any platform different from the BuildKit worker's native platform. On an arm64 runner it would pick amd64 for the SUSE target and expect a successful cross-architecture build -- but SUSE sets CrossArchInstallUnsupported and fails fast, so the generic success path would spuriously fail. Add a CrossArchUnsupported test setting: when set, the cross-platform subtest skips the generic success case and instead asserts the worker guard's 'cross-architecture builds are not supported' error. Enable it for SLES15. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 89d10fb5-5e8e-4819-84f8-f0a96dc28fcd Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
c1805e3 to
2f48787
Compare
I had rebased my branch it got polluted white fixing DCO, but I rebased again |
|
It looks like the CI workflow also needs to have sles15 added to the integration suite (sorry, this does't have a |
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
| if err := validatePathAndPermissions(ctx, ref, "/usr/libexec/no_name_no_subpath", 0o755); err != nil { | ||
| // %{_libexecdir} is distro-dependent: dnf-based distros (and Tumbleweed) | ||
| // use /usr/libexec, while openSUSE Leap / SLE 15 use /usr/lib. | ||
| libexecDir := testConfig.LibexecDir |
There was a problem hiding this comment.
nit: maybe flip the logic so we use more common value as default and then optionally override with specific, rather than other way around?
There was a problem hiding this comment.
It already defaults to the common /usr/libexec (empty → /usr/libexec); only SLE15/Leap overrides to /usr/lib. Can switch to a UsesFHSLibexec bool if you prefer that shape.
| // packages, not part of coreutils). | ||
| "system-user-root": {}, | ||
| "system-user-nobody": {}, | ||
| "coreutils": {}, |
There was a problem hiding this comment.
That's a lot for base runtime dependencies. All our other distros only define tzdata and ca-certificates as default runtime dependencies, since we aim to produce as small images as possible.
Also, standalone binaries and containers actually rarely actually depend on shell utilities, so that doesn't seem like a right selection.
There was a problem hiding this comment.
Not for size — SUSE builds from llb.Scratch() (no bci-base underneath), so this is the minimal userland. Without system-user-nobody/grep, the artifacts and disable_strip tests fail. azlinux gets the same set for free via distroless-packages-minimal; SUSE ships no equivalent meta-package. Open to layering on bci-base instead if you prefer.
| File: &dalec.SourceInlineFile{ | ||
| Permissions: 0o644, | ||
| Contents: `NAME="SLES" | ||
| VERSION="15-SP7" |
There was a problem hiding this comment.
Maybe this could be pulled somehow from worker image while bootstrapping an image to avoid keeping an explicit copy here?
There was a problem hiding this comment.
Could extract /etc/os-release from the worker image during bootstrap instead of inlining — happy to switch if you prefer that over the hardcoded copy.
| Permissions: 0o644, | ||
| Contents: `NAME="SLES" | ||
| VERSION="15-SP7" | ||
| VERSION_ID="15.7" |
There was a problem hiding this comment.
Also, if we decide to keep it, it should probably be part of targets/linux/rpm/suse/sles15.go?
There was a problem hiding this comment.
Agreed — if we keep it, I will move it into sles15.go next to the other SLES15-specific config.
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Signed-off-by: Dhwani Shah <dhwanishah@microsoft.com>
Add SUSE Linux Enterprise 15 as a new rpm distro target built with zypper.
Copilot-Session: 89d10fb5-5e8e-4819-84f8-f0a96dc28fcd
What this PR does / why we need it:
This PR adds SUSE Linux Enterprise 15 (SLES 15) as a first-class rpm build target
(
sles15/rpm,sles15/container,sles15/worker,sles15/container/depsonly), sodalec specs can produce and package rpms for SLES the same way they already do for
azlinux, almalinux, and rockylinux. SLES is a widely deployed enterprise Linux that
consumers of dalec need to ship packages for, and it was previously unsupported.
The main difference from the existing rpm targets is the package manager: SLES uses
zypper/libzypp, not dnf. Rather than fork the rpm build path, this PR reuses the
shared
dnfInstallConfigplumbing and adds a zypper-specific install step:suse/sles15.go,suse/common.go):ConfigSLES15pins theregistry.suse.com/bci/bci-baseworker, wires up the zypper installer, and usesSUSE's repo layout (
/etc/zypp/repos.d).distro/zypper_install.go):ZypperInstallrunszypperwith--non-interactiveand license/vendor flags, imports repo signing keys, and omitsdnf-only concepts such as
--releasever. Documentation exclusion (the default, sinceIncludeDocsis false) is handled via libzypp'srpm.install.excludedocsinzypp.conf— zypper has no CLI flag equivalent to dnf's--setopt=tsflags=nodocs.distro/distro.go,distro/worker.go): zypper has noequivalent of dnf's
--forcearch/--installroot, so cross-architecture installs arenot supported. A new
CrossArchInstallUnsupportedflag makes the worker paths failfast for SLES instead of producing a broken foreign-arch rootfs.
plugin/init.go): registers thesles15/*build routes.test/target_suse_test.go):TestSLES15exercises the target through theshared linux test harness, with SUSE-specific helpers that account for SLES quirks —
an empty
%{?dist}tag (unlikeel9/azl3), repo creation withcreaterepo_c, andpackage signing with
rpmsign(shipped inrpm-build, not a separaterpm-signpackage).
website/docs/targets.mdandexamples/targets.md.Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer:
bci-base:15.7(not 15.6). SLES 15 SP6 (15.6)reached end of general support on 2025-12-31, so builds start from the currently
maintained 15.7 BCI. Bumping the tag also requires updating the expected OS release
(
VersionID) in the test config.into a foreign-arch root, so
ConfigSLES15setsCrossArchInstallUnsupported: trueand the worker fails fast rather than silently producing a wrong-arch image. The SLES
target is therefore validated on its native architecture only.
zypp.conf, not a CLI flag. An earlier revision passed--rpm-installexcludedocs, which is not a valid zypper 1.14 option and failed everyinstall; this now sets
rpm.install.excludedocs = yesinzypp.conf(honoring--root) when docs are excluded, matching the dnf targets'tsflags=nodocsbehavior.main, so some unrelated upstreamchanges (e.g. the worker-resolution test refactor in
platform_worker_test.go, theGomodEditsDropfield, and dependency bumps) appear in the file list. TheSUSE-specific changes are the
suse/,zypper_install.go,distro.go/worker.go,plugin/init.go,target_suse_test.go, and docs entries listed above.