1
Fork 0
hermetic_cc_toolchain/.build.yml

43 lines
1.7 KiB
YAML

image: debian/testing
packages:
- curl
- file
sources:
- https://git.sr.ht/~motiejus/bazel-zig-cc
environment:
CC: /usr/bin/false
tasks:
- setup: |
sudo apt-get purge gcc -y && sudo apt-get autoremove -y
curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.9.0/bazelisk-linux-amd64 \
-o bazel
chmod +x bazel
- test_default: |
cd bazel-zig-cc; ./build-and-file \
//test:hello | \
grep -q "ELF 64-bit.* x86-64.* dynamically linked"
- test_x86_64-linux-gnu: |
cd bazel-zig-cc; ./build-and-file \
--platforms @zig_sdk//:x86_64-linux-gnu //test:hello | \
grep -q "ELF 64-bit.* x86-64.* dynamically linked"
- test_x86_64-linux-musl: |
cd bazel-zig-cc; ./build-and-file \
--extra_toolchains @zig_sdk//:x86_64-linux-musl_toolchain //test:hello | \
grep -q "ELF 64-bit.* x86-64.* statically linked"
- test_aarch64-linux-gnu: |
cd bazel-zig-cc; ./build-and-file \
--platforms @zig_sdk//:aarch64-linux-gnu //test:hello | \
grep -q "ELF 64-bit.* ARM aarch64.* dynamically linked"
- test_aarch64-linux-musl: |
cd bazel-zig-cc; ./build-and-file \
--extra_toolchains @zig_sdk//:aarch64-linux-musl_toolchain //test:hello | \
grep -q "ELF 64-bit.* ARM aarch64.* statically linked"
- test_x86_64-macos-gnu: |
cd bazel-zig-cc; ./build-and-file \
--platforms @zig_sdk//:x86_64-macos-gnu //test:hello | \
grep -q "Mach-O 64-bit x86_64 executable"
- test_aarch64-macos-gnu: |
cd bazel-zig-cc; ./build-and-file \
--platforms @zig_sdk//:aarch64-macos-gnu //test:hello | \
grep -q "Mach-O 64-bit arm64 executable"