From 0512455c70faa6b6c1a3de2e5c1847702777e05d Mon Sep 17 00:00:00 2001 From: Brett Mastbergen Date: Thu, 3 Dec 2026 09:25:22 -0500 Subject: [PATCH] spec: use system bindgen-cli on el9 and drop bundled bindgen source Rocky 9.8 and 9.9 ship bindgen-cli in CRB, so the bundled bindgen-cli source that was originally added for Rocky 9.6 builds is no longer needed. Use the system bindgen-cli package on all EL versions via an unconditional BuildRequires, the same mechanism already used for el10. - Remove the bundled bindgen-cli source (Source5000) and the %build cargo build that built it into PATH - Remove ciq/SOURCES/bundle_bindgen.sh, which vendored bindgen-cli from crates.io into the SRPM sources - Drop the 'Bundle bindgen' step and the now-unneeded rust/cargo container deps from the RPM Build workflow - Drop the stale ciq/SOURCES/bindgen-cli* .gitignore entries --- .github/workflows/rpm-build.yml | 6 +--- .gitignore | 4 --- ciq/SOURCES/bundle_bindgen.sh | 50 --------------------------------- ciq/SPECS/kernel-clk6.18.spec | 22 ++------------- 4 files changed, 3 insertions(+), 79 deletions(-) delete mode 100755 ciq/SOURCES/bundle_bindgen.sh diff --git a/.github/workflows/rpm-build.yml b/.github/workflows/rpm-build.yml index eb9a0e938b476..5696c2558b3bb 100644 --- a/.github/workflows/rpm-build.yml +++ b/.github/workflows/rpm-build.yml @@ -29,7 +29,7 @@ jobs: - name: Install tools and libraries run: | dnf install -y epel-release - dnf install -y mock git rust cargo zstd which + dnf install -y mock git zstd which useradd -m -G mock mockbuild - name: Checkout code @@ -44,10 +44,6 @@ jobs: git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree ./ciq/SOURCES/generate_tarball.sh - - name: Bundle bindgen - if: matrix.el_version == 9 - run: ./ciq/SOURCES/bundle_bindgen.sh ./ciq/SOURCES - - name: Build SRPM run: | mkdir -p ../build_files diff --git a/.gitignore b/.gitignore index fa95584f708f2..90bc8632f555b 100644 --- a/.gitignore +++ b/.gitignore @@ -182,7 +182,3 @@ sphinx_*/ # Rust analyzer configuration /rust-project.json - -# bindgen generated SOURCES -ciq/SOURCES/bindgen-cli/ -ciq/SOURCES/bindgen-cli.crate diff --git a/ciq/SOURCES/bundle_bindgen.sh b/ciq/SOURCES/bundle_bindgen.sh deleted file mode 100755 index 0be62d04ef972..0000000000000 --- a/ciq/SOURCES/bundle_bindgen.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -set -e - -# Bundle the bindgen-cli source code to be included in the kernel build. -# https://crates.io/crates/bindgen-cli -# -# The bindgen tool, required to build Rust code in the Linux kernel, is -# currently only packaged in Fedora/ELN. In order to build CLK kernels -# on Rocky Linux we need to build bindgen as part of the kernel build. - -SOURCES=$1 - -BINDGEN_CLI=bindgen-cli -BINDGEN_CLI_VERSION="0.71.1" -BINDGEN_CLI_CRATE=bindgen-cli.crate -BINDGEN_CLI_SHA256="fded10ca0956afd0cbe5cf89cc71ae1a679e65b8216c651fca17ba7de8ac54dc" -CRATESIO_API_ENDPOINT=https://crates.io/api/v1/crates/bindgen-cli/${BINDGEN_CLI_VERSION}/download - -curl -sfL -A "bundle_bindgen/1.0" $CRATESIO_API_ENDPOINT -o $SOURCES/$BINDGEN_CLI_CRATE - -echo "$BINDGEN_CLI_SHA256 $SOURCES/$BINDGEN_CLI_CRATE" | sha256sum -c - || { - echo "Error: SHA256 checksum mismatch for $BINDGEN_CLI_CRATE" - echo "Expected: $BINDGEN_CLI_SHA256" - echo "Got: $(sha256sum $SOURCES/$BINDGEN_CLI_CRATE | awk '{print $1}')" - rm -f $SOURCES/$BINDGEN_CLI_CRATE - exit 1 -} - -tar -xf $SOURCES/$BINDGEN_CLI_CRATE -C $SOURCES -mv $SOURCES/$BINDGEN_CLI-$BINDGEN_CLI_VERSION $SOURCES/$BINDGEN_CLI - -# vendor bindgen-cli -cd $SOURCES/$BINDGEN_CLI -mkdir .cargo -cat > .cargo/config.toml <= 10 +# bindgen-cli is packaged in CRB on el9 (since Rocky 9.8) and el10 BuildRequires: bindgen-cli -%endif BuildRequires: net-tools, hostname, bc, elfutils-devel BuildRequires: dwarves BuildRequires: python3 @@ -1176,11 +1175,6 @@ Source3002: Patchlist.changelog Source4000: README.rst -# Bundled bindgen-cli source (not packaged in Rocky 9) -%if 0%{?rhel} < 10 -Source5000: bindgen-cli.tar.gz -%endif - ## Patches needed for building this package %if !%{nopatches} @@ -2296,20 +2290,8 @@ cp_vmlinux() %define build_hostldflags %{?build_ldflags} %endif -%if 0%{?rhel} < 10 -# Build bundled bindgen and add to PATH (not packaged in Rocky 9) -%{log_msg "Build bundled bindgen"} -BINDGEN_DIR=$RPM_BUILD_ROOT/bindgen -BINDGEN_BUNDLE_NAME=$(basename %{SOURCE5000} .tar.gz) -mkdir -p $BINDGEN_DIR -tar -xf %{SOURCE5000} -C $BINDGEN_DIR -pushd $BINDGEN_DIR/$BINDGEN_BUNDLE_NAME -cargo build --offline --frozen --release -export PATH="$PWD/target/release:$PATH" -popd -%else +# bindgen-cli is provided by the buildroot's system packages (CRB) %{log_msg "Using system bindgen"} -%endif bindgen --version %define make %{__make} %{?cross_opts} %{?make_opts} HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}"