From f6918833d76757aad9d1daa66fbb4e259cd1e573 Mon Sep 17 00:00:00 2001 From: strawberry Date: Thu, 24 Oct 2024 23:03:36 -0400 Subject: [PATCH] remove `-unknown-` from nix flake Signed-off-by: strawberry --- .github/workflows/ci.yml | 30 +++++++++++++++++++++-------- .github/workflows/documentation.yml | 2 +- .gitlab-ci.yml | 20 +++++++++---------- bin/complement | 2 +- docs/deploying/generic.md | 4 ++-- 5 files changed, 36 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09b5cd52..4d299514 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,8 +236,8 @@ jobs: strategy: matrix: include: - - target: aarch64-unknown-linux-musl - - target: x86_64-unknown-linux-musl + - target: aarch64-linux-musl + - target: x86_64-linux-musl steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main @@ -311,7 +311,14 @@ jobs: - name: Build static ${{ matrix.target }} run: | - CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*') + if [[ ${{ matrix.target }} == "x86_64-linux-musl" ]] + then + CARGO_DEB_TARGET_TUPLE="x86_64-unknown-linux-musl" + elif [[ ${{ matrix.target }} == "aarch64-linux-musl" ]] + then + CARGO_DEB_TARGET_TUPLE="aarch64-unknown-linux-musl" + fi + SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features @@ -335,7 +342,14 @@ jobs: - name: Build static debug ${{ matrix.target }} run: | - CARGO_DEB_TARGET_TUPLE=$(echo ${{ matrix.target }} | grep -o -E '^([^-]*-){3}[^-]*') + if [[ ${{ matrix.target }} == "x86_64-linux-musl" ]] + then + CARGO_DEB_TARGET_TUPLE="x86_64-unknown-linux-musl" + elif [[ ${{ matrix.target }} == "aarch64-linux-musl" ]] + then + CARGO_DEB_TARGET_TUPLE="aarch64-unknown-linux-musl" + fi + SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) bin/nix-build-and-cache just .#static-${{ matrix.target }}-all-features-debug @@ -542,10 +556,10 @@ jobs: - name: Move OCI images into position run: | - mv -v oci-image-x86_64-unknown-linux-musl/*.tar.gz oci-image-amd64.tar.gz - mv -v oci-image-aarch64-unknown-linux-musl/*.tar.gz oci-image-arm64v8.tar.gz - mv -v oci-image-x86_64-unknown-linux-musl-debug/*.tar.gz oci-image-amd64-debug.tar.gz - mv -v oci-image-aarch64-unknown-linux-musl-debug/*.tar.gz oci-image-arm64v8-debug.tar.gz + mv -v oci-image-x86_64-linux-musl/*.tar.gz oci-image-amd64.tar.gz + mv -v oci-image-aarch64-linux-musl/*.tar.gz oci-image-arm64v8.tar.gz + mv -v oci-image-x86_64-linux-musl-debug/*.tar.gz oci-image-amd64-debug.tar.gz + mv -v oci-image-aarch64-linux-musl-debug/*.tar.gz oci-image-arm64v8-debug.tar.gz - name: Load and push amd64 image if: ${{ (vars.DOCKER_USERNAME != '') && (env.DOCKERHUB_TOKEN != '') }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 45e52b22..506a87d9 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -60,7 +60,7 @@ jobs: if: github.event_name != 'pull_request' uses: actions/configure-pages@v5 - - uses: nixbuild/nix-quick-install-action@v28 + - uses: nixbuild/nix-quick-install-action@master - name: Restore and cache Nix store uses: nix-community/cache-nix-action@v5.1.0 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 895b794b..c9f239d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,29 +97,29 @@ artifacts: stage: artifacts image: nixos/nix:2.24.9 script: - - ./bin/nix-build-and-cache just .#static-x86_64-unknown-linux-musl - - cp result/bin/conduit x86_64-unknown-linux-musl + - ./bin/nix-build-and-cache just .#static-x86_64-linux-musl + - cp result/bin/conduit x86_64-linux-musl - mkdir -p target/release - cp result/bin/conduit target/release - direnv exec . cargo deb --no-build --no-strip - - mv target/debian/*.deb x86_64-unknown-linux-musl.deb + - mv target/debian/*.deb x86_64-linux-musl.deb # Since the OCI image package is based on the binary package, this has the # fun side effect of uploading the normal binary too. Conduit users who are # deploying with Nix can leverage this fact by adding our binary cache to # their systems. # - # Note that although we have an `oci-image-x86_64-unknown-linux-musl` + # Note that although we have an `oci-image-x86_64-linux-musl` # output, we don't build it because it would be largely redundant to this # one since it's all containerized anyway. - ./bin/nix-build-and-cache just .#oci-image - cp result oci-image-amd64.tar.gz - - ./bin/nix-build-and-cache just .#static-aarch64-unknown-linux-musl - - cp result/bin/conduit aarch64-unknown-linux-musl + - ./bin/nix-build-and-cache just .#static-aarch64-linux-musl + - cp result/bin/conduit aarch64-linux-musl - - ./bin/nix-build-and-cache just .#oci-image-aarch64-unknown-linux-musl + - ./bin/nix-build-and-cache just .#oci-image-aarch64-linux-musl - cp result oci-image-arm64v8.tar.gz - ./bin/nix-build-and-cache just .#book @@ -127,9 +127,9 @@ artifacts: - cp -r --dereference result public artifacts: paths: - - x86_64-unknown-linux-musl - - aarch64-unknown-linux-musl - - x86_64-unknown-linux-musl.deb + - x86_64-linux-musl + - aarch64-linux-musl + - x86_64-linux-musl.deb - oci-image-amd64.tar.gz - oci-image-arm64v8.tar.gz - public diff --git a/bin/complement b/bin/complement index 094cf248..601edb5a 100755 --- a/bin/complement +++ b/bin/complement @@ -34,7 +34,7 @@ toplevel="$(git rev-parse --show-toplevel)" pushd "$toplevel" > /dev/null -bin/nix-build-and-cache just .#static-complement +bin/nix-build-and-cache just .#linux-complement docker load < result popd > /dev/null diff --git a/docs/deploying/generic.md b/docs/deploying/generic.md index 562ebd7e..1e44ab54 100644 --- a/docs/deploying/generic.md +++ b/docs/deploying/generic.md @@ -23,8 +23,8 @@ Nix (or [Lix](https://lix.systems)) to build conduwuit as this has the most guar reproducibiltiy and easiest to get a build environment and output going. This also allows easy cross-compilation. -You can run the `nix build -L .#static-x86_64-unknown-linux-musl-all-features` or -`nix build -L .#static-aarch64-unknown-linux-musl-all-features` commands based +You can run the `nix build -L .#static-x86_64-linux-musl-all-features` or +`nix build -L .#static-aarch64-linux-musl-all-features` commands based on architecture to cross-compile the necessary static binary located at `result/bin/conduit`. This is reproducible with the static binaries produced in our CI.