From 2a0efbf0a5edea391727de89f85e266c592a5b8b Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 2 Oct 2024 18:03:08 +0200 Subject: [PATCH 1/2] pkg/debian: use cmake as buildsystem When building debian packages a lot of errors occur. After investigation, it seems that happens due to `dh` (debhelpers, see https://manpages.debian.org/testing/debhelper/dh.1.en.html) treating the top-level Makefile as build tool for some steps. The top-level Makefile was created only for testing/CI purposes. When building packages, we should make use of cmake - this is exactly what this commit does. --- dist/debian/debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/debian/debian/rules b/dist/debian/debian/rules index 21ca98b8..a6c631c7 100755 --- a/dist/debian/debian/rules +++ b/dist/debian/debian/rules @@ -14,7 +14,7 @@ export CARGO_HOME export RUSTUP_HOME %: - dh $@ + dh $@ --buildsystem=cmake override_dh_auto_clean: rm -rf scylla-rust-wrapper/.cargo From 25d5d53486eeb5c0ae91c99e06112121e57b2c27 Mon Sep 17 00:00:00 2001 From: muzarski Date: Wed, 2 Oct 2024 18:20:48 +0200 Subject: [PATCH 2/2] ci: add workflow for building packages Since changes such as introducing a top-level Makefile can cause a failure during building packages, we will extend our CI to test that we can successfully build packages after introducing some changes in the future. --- .github/workflows/pkg.yml | 64 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/pkg.yml diff --git a/.github/workflows/pkg.yml b/.github/workflows/pkg.yml new file mode 100644 index 00000000..dd7126e2 --- /dev/null +++ b/.github/workflows/pkg.yml @@ -0,0 +1,64 @@ +name: Build packages + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + CARGO_TERM_COLORS: always + +jobs: + build-rpm-pkgs: + name: Build rpm packages + runs-on: ubuntu-latest + container: + image: fedora:latest + # Required by `mock`: + ### INFO: It seems that you run Mock in a Docker container. + ### Mock though uses container tooling itself (namely Podman) for downloading bootstrap image. + ### This might require you to run Mock in 'docker run --privileged'. + options: --privileged + # It does not seem to be necessary (CI run without it was successful). + # However, without it, there appear some errors during `mock` execution. + # I've found the solution to these errors here: https://github.com/containers/buildah/issues/3666. + # They are related to podman, which is used by `mock` under the hood. + volumes: + - /var/lib/containers:/var/lib/containers + + strategy: + matrix: + dist-version: [rocky-9-x86_64, fedora-40-x86_64] + fail-fast: false + + steps: + # See: https://github.com/actions/checkout/issues/363 + # An issue related to GH actions containers + - name: Install git and update safe directory + run: | + dnf update -y + dnf install -y git + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Checkout + uses: actions/checkout@v4 + + - name: Build rpm package for ${{ matrix.dist-version }} + run: ./dist/redhat/build_rpm.sh --target ${{ matrix.dist-version }} + + build-deb-pkgs: + name: Build deb packages + runs-on: ubuntu-latest + + strategy: + matrix: + dist-version: [jammy, noble] + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build deb package for ${{ matrix.dist-version }} + run: ./dist/debian/build_deb.sh --target ${{ matrix.dist-version }}