diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b07701ac..133df5a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,10 @@ jobs: test-bin: file ./result/bin/rust-hello test-oci: docker load < ./result + - package: rust-hello-aarch64-linux-android + test-bin: file ./result/bin/rust-hello + test-oci: docker load < ./result + - package: rust-hello-aarch64-unknown-linux-musl test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello test-oci: docker load < ./result @@ -64,6 +68,10 @@ jobs: test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/rust-hello test-oci: docker load < ./result + - package: rust-hello-debug-aarch64-linux-android + test-bin: file ./result/bin/rust-hello + test-oci: docker load < ./result + - package: rust-hello-debug-armv7-unknown-linux-musleabihf test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-arm ./result/bin/rust-hello test-oci: docker load < ./result @@ -132,6 +140,9 @@ jobs: - package: rust-complex-aarch64-apple-darwin test-bin: file ./result/bin/foo + - package: rust-complex-aarch64-linux-android + test-bin: file ./result/bin/foo + - package: rust-complex-aarch64-unknown-linux-musl test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/foo @@ -154,6 +165,9 @@ jobs: - package: rust-complex-debug-aarch64-apple-darwin test-bin: file ./result/bin/foo + - package: rust-complex-debug-aarch64-linux-android + test-bin: file ./result/bin/foo + - package: rust-complex-debug-aarch64-unknown-linux-musl test-bin: nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-aarch64 ./result/bin/foo diff --git a/README.md b/README.md index 172e26c3..0733065c 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ Simple, yet extensible, batteries-included Nix flake bootstrapping library for r - `aarch64-darwin` -> `x86_64-pc-windows-gnu` - `aarch64-linux` -> `aarch64-apple-darwin` +- `aarch64-linux` -> `aarch64-linux-android` - `aarch64-linux` -> `aarch64-linux-musl` - `aarch64-linux` -> `armv7-unknown-linux-musleabihf` - `aarch64-linux` -> `wasm32-wasi` @@ -55,6 +56,7 @@ Simple, yet extensible, batteries-included Nix flake bootstrapping library for r - `x86_64-darwin` -> `x86_64-pc-windows-gnu` - `x86_64-linux` -> `aarch64-apple-darwin` +- `x86_64-linux` -> `aarch64-linux-android` - `x86_64-linux` -> `aarch64-linux-musl` - `x86_64-linux` -> `armv7-unknown-linux-musleabihf` - `x86_64-linux` -> `wasm32-wasi` diff --git a/lib/rust/default.nix b/lib/rust/default.nix index 128e93ed..ebf736ea 100644 --- a/lib/rust/default.nix +++ b/lib/rust/default.nix @@ -138,6 +138,7 @@ in { ]; targets.aarch64-apple-darwin = "aarch64-apple-darwin"; + targets.aarch64-linux-android = "aarch64-linux-android"; targets.aarch64-unknown-linux-gnu = "aarch64-unknown-linux-gnu"; targets.aarch64-unknown-linux-musl = "aarch64-unknown-linux-musl"; targets.armv7-unknown-linux-musleabihf = "armv7-unknown-linux-musleabihf"; diff --git a/lib/rust/defaultPkgsFor.nix b/lib/rust/defaultPkgsFor.nix index 9d1e0b54..7d743667 100644 --- a/lib/rust/defaultPkgsFor.nix +++ b/lib/rust/defaultPkgsFor.nix @@ -16,6 +16,8 @@ with self.lib.rust.targets; then pkgs else if hostPlatform.isAarch64 && hostPlatform.isLinux && hostPlatform.isGnu && target == aarch64-unknown-linux-gnu then pkgs + else if hostPlatform.isAarch64 && hostPlatform.isLinux && hostPlatform.isAndroid && target == aarch64-linux-android + then pkgs else if hostPlatform.isAarch64 && hostPlatform.isLinux && target == aarch64-unknown-linux-musl then if hostPlatform.isMusl @@ -30,12 +32,14 @@ with self.lib.rust.targets; else pkgs.pkgsCross.musl64 else if hostPlatform.isx86_64 && hostPlatform.isWindows && target == x86_64-pc-windows-gnu then pkgs + else if target == aarch64-apple-darwin + then pkgs.pkgsCross.aarch64-darwin + else if target == aarch64-linux-android + then pkgs.pkgsCross.aarch64-android-prebuilt else if target == aarch64-unknown-linux-gnu then pkgs.pkgsCross.aarch64-multiplatform else if target == aarch64-unknown-linux-musl then pkgs.pkgsCross.aarch64-multiplatform-musl - else if target == aarch64-apple-darwin - then pkgs.pkgsCross.aarch64-darwin else if target == armv7-unknown-linux-musleabihf then pkgs.pkgsCross.armv7l-hf-multiplatform else if target == x86_64-apple-darwin diff --git a/lib/rust/mkAttrs.nix b/lib/rust/mkAttrs.nix index 16e9feba..6a6474b9 100644 --- a/lib/rust/mkAttrs.nix +++ b/lib/rust/mkAttrs.nix @@ -407,6 +407,10 @@ with self.lib.rust.targets; // optionalAttrs final.stdenv.buildPlatform.isDarwin { doCheck = warn "testing not currently supported when cross-compiling for `${target}` on Darwin" false; } + else if target == aarch64-linux-android + then { + doCheck = warn "testing not currently supported when cross-compiling for `${target}`" false; + } else if target == aarch64-unknown-linux-gnu then { @@ -488,6 +492,7 @@ with self.lib.rust.targets; targets' = let default.${aarch64-apple-darwin} = true; + default.${aarch64-linux-android} = prev.stdenv.hostPlatform.isLinux; default.${aarch64-unknown-linux-gnu} = true; default.${aarch64-unknown-linux-musl} = true; default.${armv7-unknown-linux-musleabihf} = true; @@ -567,6 +572,7 @@ with self.lib.rust.targets; #ociArchitecture.${x86_64-apple-darwin} = "darwin-amd64"; #ociArchitecture.${x86_64-pc-windows-gnu} = "windows-amd64"; ociArchitecture.${aarch64-apple-darwin} = "arm64"; + ociArchitecture.${aarch64-linux-android} = "arm64"; ociArchitecture.${aarch64-unknown-linux-gnu} = "arm64"; ociArchitecture.${aarch64-unknown-linux-musl} = "arm64"; ociArchitecture.${armv7-unknown-linux-musleabihf} = "arm";