Skip to content

Add build targets for current openSUSE Leap and SLE - #402

Open
gusraggio wants to merge 1 commit into
NVIDIA:mainfrom
gusraggio:fix/opensuse-leap-build-targets
Open

gusraggio wants to merge 1 commit into
NVIDIA:mainfrom
gusraggio:fix/opensuse-leap-build-targets

Conversation

@gusraggio

Copy link
Copy Markdown

Summary

Fixes #100.

As the latest comments on #100 point out, mk/docker.mk only has opensuse-leap15.1, which has been end of life since 2021. This adds build targets for the current SUSE releases:

Target Base image x86_64 aarch64
opensuse-leap15.6 opensuse/leap:15.6 yes yes
opensuse-leap16.0 opensuse/leap:16.0 yes yes
sles15.7 registry.suse.com/bci/bci-base:15.7 yes yes
sles16.0 registry.suse.com/bci/bci-base:16.0 yes yes

The sles* targets build on the freely redistributable SLE Base Container Image and reuse Dockerfile.opensuse-leap. There is no openSUSE Leap 15.7: the Leap 15 series ended with 15.6, and SLE 15 SP7 is covered by sles15.7.

Changes

Adding the target names alone is not enough; each of the following was needed to get a working build:

  • mk/Dockerfile.opensuse-leap
    • createrepo was replaced by createrepo_c in current SUSE releases. It is not used by the build itself.
    • rpcgen is a separate package, and it is required.
    • bmake and rpmlint are installed only when the repository provides them, because the SLE BCI 16 repository has neither. bmake is only needed for the bundled elftoolchain, and rpmlint is already optional (-rpmlint in the rpm target).
  • mk/docker.mk
    • New targets for x86_64 and aarch64, and a private --sles% target.
    • WITH_TIRPC=yes for the new targets, because glibc no longer ships the Sun RPC headers from Leap 15.6 on (rpc/rpc.h: No such file or directory).
    • sles16 uses WITH_LIBELF=yes, because bmake is not available there.
  • mk/libtirpc.mk: build the bundled libtirpc 1.3.2 with -std=gnu11, the standard the project itself compiles with. GCC 15, the compiler in the 16 series, defaults to C23, which rejects libtirpc's unprototyped declarations (conflicting types for 'xdr_opaque_auth').
  • pkg/rpm/SPECS/libnvidia-container.spec: run make -C %{_topdir}/BUILD install. rpm 4.20 runs the install section in a per-build subdirectory (and points %{_builddir} there), so the bare make install found no Makefile. %{_topdir}/BUILD is the link to the source tree that the rpm target already creates, and it is also the working directory on older rpm, so this is a no-op there.
  • README.md: list the new targets.

Testing

All builds used make -f mk/docker.mk <target> DOCKER=podman (podman 5.4.2) on a SLES 16 x86_64 host. aarch64 was built under QEMU user-mode emulation (qemu-linux-user, binfmt).

Target x86_64 build aarch64 build Install + nvidia-container-cli --version in a clean container (x86_64 and aarch64)
opensuse-leap15.1 (existing, regression) 6 RPMs n/a OK (x86_64)
opensuse-leap15.6 6 RPMs 6 RPMs OK
opensuse-leap16.0 6 RPMs 6 RPMs OK
sles15.7 6 RPMs 6 RPMs OK
sles16.0 6 RPMs 6 RPMs OK

Notes on the install test:

  • The test installed libnvidia-container1 and libnvidia-container-tools from the built RPMs with zypper, then ran nvidia-container-cli --version.
  • ldd reported no missing libraries.
  • libtirpc is linked statically, so the new targets add no runtime dependency.

Not tested:

  • Running against a GPU and driver. The change only affects how the packages are built, not the library code.

The only SUSE build target was opensuse-leap15.1, which has been end of
life since 2021. Add opensuse-leap15.6, opensuse-leap16.0, sles15.7 and
sles16.0 (built on the SLE Base Container Image) for x86_64 and aarch64.

Making these build required:

- Dockerfile.opensuse-leap: createrepo is now createrepo_c, rpcgen is a
  separate package, and bmake/rpmlint are installed only when the
  repository provides them (the SLE BCI 16 repository has neither).
- WITH_TIRPC=yes for the new targets: glibc no longer ships the Sun RPC
  headers from Leap 15.6 on. sles16 also uses WITH_LIBELF=yes because
  bmake is unavailable there.
- libtirpc.mk: build the bundled libtirpc 1.3.2 with -std=gnu11, the
  standard the project itself uses. GCC 15 defaults to C23, which rejects
  its unprototyped declarations.
- The RPM spec runs make against _topdir/BUILD. rpm 4.20 runs the install
  section in a per-build subdirectory, so the bare "make install" found no
  Makefile.

Fixes NVIDIA#100

Signed-off-by: Gustavo Varela <gvarela@suse.com>

This branch has not been deployed

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

OpenSuSE Leap 15.2 is missing

1 participant