1
Fork 0
Commit Graph

65 Commits

Author SHA1 Message Date
Motiejus Jakštys c03a602023 add gazelle to CI targets 2023-01-18 22:43:33 +02:00
Motiejus Jakštys eced0109ca zig launcher: replace shell wrappers with a binary
Until now we needed to maintain two versions of the zig launcher: one
for Windows and one for everything else. This was problematic for two
reasons:
1. I do not know powershell and thus keep breaking the Windows wrapper
   all the time (see git history of Fabian fixing stuff that I broke).
2. This makes bazel-zig-cc dependent on the system shell, making it not
   really hermetic. So the recently added
   `--experimental_use_hermetic_linux_sandbox` does not work with
   bazel-zig-cc, unless we bind-mount a bunch of stuff: `/usr`, `/bin`,
   `/lib`, `/usr/lib:/lib`, `/usr/lib64:/lib64` and `/proc`.

Switching to a Zig-based wrapper solves both issues, and we can do this:

    bazel build "$@" \
        --experimental_use_hermetic_linux_sandbox \
        --sandbox_add_mount_pair=/proc \
        <...>

Zig itself still depends on `/proc` for `/proc/self/exe`, so we need to
keep that. I will look into reducing even that dependency separately.

Not all is nice and shiny though: this commit replaces ~80 LOC worth of
shell scripts wrappers with a singe ~300 LOC zig program, which is
arguably harder to understand. However, it is easier to change, at least
for me, because it's a single file with unit tests! Most importantly,
the gnarly code (which resolves paths and sets environment variables) is
cross-platform.

Thanks to Fabian Hahn for testing this on Windows and pointing out
errors.
2023-01-03 11:46:58 +02:00
Motiejus Jakštys 4db3c242c1 Revert "remove binfmt-support"
This reverts commit 88b623287c.

Although binfmt-support is a dependency, it does not get installed on CI
2022-12-12 06:06:00 +02:00
Motiejus Jakštys 88b623287c remove binfmt-support
this is an implicit dependency of qemu-user-static
2022-12-11 22:12:07 +02:00
Motiejus Jakštys 6feba23aee build.yml: add file
this will fix the last test in ci/test
2022-12-11 07:12:43 +02:00
Motiejus Jakštys 53975784ea ci: catch easy problems early 2022-09-30 15:18:21 +03:00
Motiejus Jakštys 3ac217e2cc windows tests: move tests, get rid of wine-binfmt
This removes all other Bazel test commands, so all tests can be again
tested with `bazel test ...`.

Also, fixes linux-arm64 glibc tests. Until now they've worked only in
CI. Now they work everywhere I tried.
2022-06-06 10:33:46 +03:00
Fabian Hahn 6f2ae838cd added Windows target testing 2022-06-02 05:27:22 +03:00
Motiejus Jakštys c2c6edd11c Merge branch 'laurynasl_libc' 2022-04-20 12:24:05 +03:00
Motiejus Jakštys cca3c49c0b [ci] install sponge 2022-04-18 13:12:08 +03:00
Motiejus Jakštys 486a26a196 [release] add to CI 2022-04-18 12:37:12 +03:00
laurynasl 4d65b80903 Add libc constraint and libc aware toolchains
- Also get rid of @bazel_skylib dependency
2022-04-14 14:29:06 +00:00
laurynasl 7a81e2a129 Restructure tests to all run in bazel
- add rules to run tests for a specific platform
- use downloaded buildifier
- move lint to a script
- rename ci tasks
- stop running under qemu-aarch64-static as it doesn't do anything
2022-04-14 10:47:02 +00:00
Motiejus Jakštys 9015e381fd update .build.yml for correct toolchain/platform paths 2022-04-07 12:56:32 +03:00
Motiejus Jakštys 3d166c5671 use .bazelrc for qemu configuration 2022-02-08 14:22:21 +02:00
Motiejus Jakštys 5de2126926 install binfmt-support 2022-02-05 05:58:24 +02:00
Motiejus Jakštys 7c8682b865 run tests with qemu-aarch64 2022-02-05 05:35:39 +02:00
Motiejus Jakštys 5871171549 run bazel test
This simplifies the tests somewhat.
2022-02-04 10:07:34 +02:00
Motiejus Jakštys 3d8cc9c38c add unit test 2022-01-28 15:49:24 +02:00
Motiejus Jakštys e479882224 move to debian/stable 2021-11-22 17:25:02 +02:00
Motiejus Jakštys c549c095ab [ci] fix syntax error 2021-11-05 20:27:28 +02:00
Motiejus Jakštys 0837bafbfb add //:buildifier to lint rule 2021-11-05 20:22:06 +02:00
Motiejus Jakštys 2f0da66949 shellcheck 2 2021-10-18 15:18:29 +03:00
Motiejus Jakštys 56493c1427 shellcheck + email on failure 2021-10-18 15:15:50 +03:00
Motiejus Jakštys d9dbca2c63 shellcheck 2021-10-18 15:15:02 +03:00
Motiejus Jakštys 4bbae178ca add release and build scripts 2021-10-18 15:12:31 +03:00
Motiejus Jakštys 828828bced install direnv 2021-09-07 10:50:16 +03:00
Motiejus Jakštys 3e7f92cea5 unregister default toolchains; update README 2021-08-11 09:37:54 +03:00
Motiejus Jakštys 5f5b25d34b use newer arm64 glibc explicitly 2021-08-06 09:49:52 +03:00
Motiejus Jakštys 63fc7aeb7a update .build.yml 2021-08-05 12:25:42 +03:00
Motiejus Jakštys bf84ec2090 more aggressive toolchain resolution:
- hardcode gnu.2.19 instead of autodetect
- more tests.
2021-08-05 11:49:17 +03:00
Motiejus Jakštys fc7335054e disable tests on linux arm64 2021-07-29 00:10:58 +03:00
Motiejus Jakštys cb10c591be rename zig toolchain to match go 2021-07-21 14:53:39 +03:00
Motiejus Jakštys dca2989825 replace curl with wget 2021-06-28 15:29:45 +03:00
Motiejus Jakštys bbb985362b move setup to .envrc 2021-06-28 14:00:47 +03:00
Motiejus Jakštys 0944357d54 --extra_toolchains also needs to know the platform 2021-06-20 15:00:17 +03:00
Motiejus Jakštys 94eb081d6d use @io_bazel_rules_go//go/toolchain where possible
only musl adds extra-toolchains.
2021-06-20 13:48:39 +03:00
Motiejus Jakštys b5c8f85ece update .build.yml, remove hangzig 2021-06-19 16:45:33 +03:00
Motiejus Jakštys a3606b7404 register only gnu toolchain by default
musl can be specified with --extra_toolchains.
2021-06-19 16:32:07 +03:00
Motiejus Jakštys afba2b1e33 less verbose build 2021-06-19 12:14:19 +03:00
Motiejus Jakštys c6c38f9022 -y 2021-06-19 12:12:19 +03:00
Motiejus Jakštys 638f1fcc3d remove gcc 2021-06-19 12:11:46 +03:00
Motiejus Jakštys 75f73b0c82 cat 2021-06-19 12:10:38 +03:00
Motiejus Jakštys f2bf76925c add dpkg -l 2021-06-19 12:09:54 +03:00
Motiejus Jakštys 08d8ab2d73 add hangzig command; debug aides for osx 2021-06-16 23:30:58 +03:00
Motiejus Jakštys d789a296f5 stronger assertions 2021-06-16 14:54:52 +03:00
Motiejus Jakštys 18b43049c1 remove redundant target 2021-06-16 14:44:57 +03:00
Motiejus Jakštys f824f4ac8e nodebug 2021-06-16 12:52:11 +03:00
Motiejus Jakštys 39535dadc5 add macos support
+ buildifier
2021-06-16 12:44:16 +03:00
Motiejus Jakštys 72e4c67e77 more checks 2021-06-10 21:07:31 +03:00