Skip to content

Commit

Permalink
build(nix): update dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
  • Loading branch information
rvolosatovs committed Aug 29, 2023
1 parent 7754999 commit aa41ef9
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 68 deletions.
47 changes: 15 additions & 32 deletions .github/workflows/wit-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true

jobs:
build-linux:
build-bin:
strategy:
matrix:
config:
Expand All @@ -20,12 +20,22 @@ jobs:
test-oci: docker load < ./result
# TODO: Run aarch64 binary within OCI

- target: aarch64-apple-darwin
install-path: /bin/wit-deps
test-bin: file ./result/bin/wit-deps
test-oci: docker load < ./result

- target: armv7-unknown-linux-musleabihf
install-path: /bin/wit-deps
test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-arm ./result/bin/wit-deps --version
test-oci: docker load < ./result
# TODO: Run armv7 binary within OCI

- target: x86_64-apple-darwin
install-path: /bin/wit-deps
test-bin: file ./result/bin/wit-deps
test-oci: docker load < ./result

- target: x86_64-pc-windows-gnu
install-path: /bin/wit-deps.exe
test-bin: nix shell --inputs-from . 'nixpkgs#wine64' -c wine64 ./result/bin/wit-deps.exe --version
Expand Down Expand Up @@ -56,38 +66,9 @@ jobs:
package: wit-deps-${{ matrix.config.target }}-oci
- run: ${{ matrix.config.test-oci }}

build-mac:
strategy:
matrix:
config:
- target: aarch64-apple-darwin
test: file ./result/bin/wit-deps
# TODO: Run aarch64 binary on host system and via OCI

- target: x86_64-apple-darwin
test: ./result/bin/wit-deps --version

name: wit-deps-${{ matrix.config.target }}
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-nix
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: ./.github/actions/build-nix
with:
package: wit-deps-${{ matrix.config.target }}
install-path: /bin/wit-deps
- run: ${{ matrix.config.test-bin }}
- uses: ./.github/actions/build-nix
with:
package: wit-deps-${{ matrix.config.target }}-oci
- run: ${{ matrix.platform.test-oci }}
# TODO: Test OCI on Mac

build-lipo:
name: wit-deps-universal-darwin
needs: build-mac
needs: build-bin
runs-on: macos-12
steps:
- uses: actions/download-artifact@v3
Expand All @@ -96,6 +77,8 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: wit-deps-x86_64-apple-darwin
- run: chmod +x ./wit-deps-x86_64-apple-darwin
- run: ./wit-deps-x86_64-apple-darwin --version
- run: lipo -create ./wit-deps-aarch64-apple-darwin ./wit-deps-x86_64-apple-darwin -output ./wit-deps-universal-darwin
- run: chmod +x ./wit-deps-universal-darwin
- run: ./wit-deps-universal-darwin --version
Expand Down Expand Up @@ -163,7 +146,7 @@ jobs:

release:
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'push'
needs: [ build-linux, build-lipo, build-doc, cargo ]
needs: [ build-bin, build-lipo, build-doc, cargo ]
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
71 changes: 44 additions & 27 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@
pkgsCross ? pkgs,
...
} @ args: {
buildInputs ? [],
depsBuildBuild ? [],
doCheck,
buildInputs ? [],
preBuild ? "",
...
} @ craneArgs:
Expand All @@ -191,15 +190,10 @@
});
});
in
{
depsBuildBuild =
depsBuildBuild
++ optional stdenv.hostPlatform.isDarwin libiconv;
}
// optionalAttrs (craneArgs ? cargoArtifacts) {
optionalAttrs (craneArgs ? cargoArtifacts) {
buildInputs =
buildInputs
++ optionals stdenv.hostPlatform.isDarwin [
++ optionals (pkgs.stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isDarwin) [
pkgs.darwin.apple_sdk.frameworks.Security
pkgs.libiconv
];
Expand Down

0 comments on commit aa41ef9

Please sign in to comment.