0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/build.zig

1251 lines
48 KiB

2017-12-11 23:34:59 -05:00
stage2: improvements aimed at std lib integration * AstGen: emit decl lookup ZIR instructions rather than directly looking up decls in AstGen. This is necessary because we want to reuse the same immutable ZIR code for multiple generic instantiations (and comptime function calls). * AstGen: fix using members_len instead of fields_len for struct decls. * structs: the struct_decl ZIR instruction is now also a block. This is so that the type expressions, default field value expressions, and alignment expressions can be evaluated in a scope that contains the decls from the struct namespace itself. * Add "std" and "builtin" packages to the builtin package. * Don't try to build glibc, musl, or mingw-w64 when using `-ofmt=c`. * builtin.zig is generated without `usingnamespace`. * builtin.zig takes advantage of `std.zig.fmtId` for CPU features. * A first pass at implementing `usingnamespace`. It's problematic and should either be deleted, or polished, before merging this branch. * Sema: allow explicitly specifying the namespace in which to look up Decls. This is used by `struct_decl` in order to put the decls from the struct namespace itself in scope when evaluating the type expressions, default value expressions, and alignment expressions. * Module: fix `analyzeNamespace` assuming that it is the top-level root declaration node. * Sema: implement comptime and runtime cmp operator. * Sema: implement peer type resolution for enums and enum literals. * Pull in the changes from master branch: 262e09c482d98a78531c049a18b7f24146fe157f. * ZIR: complete out simple_ptr_type debug printing
2021-04-12 16:44:51 -07:00
2017-12-11 23:34:59 -05:00
2017-12-11 23:34:59 -05:00
2019-05-26 13:17:34 -04:00
2021-12-20 13:13:48 -07:00
2020-08-15 14:17:40 -07:00
2017-10-21 17:31:06 -04:00
2017-10-21 17:31:06 -04:00
2019-05-26 13:17:34 -04:00
2019-05-26 13:17:34 -04:00
2018-09-12 11:49:46 -04:00
significantly increase test coverage * add zig build option `-Dskip-libc` to skip tests that build libc (e.g. if you don't want to wait for musl to build) * add `-Denable-wine` option which uses wine to run cross compiled windows tests on non-windows hosts * add `-Denable-qemu` option which uses qemu to run cross compiled foreign architecture tests * add `-Denable-foreign-glibc=path` option which combined with `-Denable-qemu` enables running cross compiled tests that link against glibc. See https://github.com/ziglang/zig/wiki/Updating-libc#glibc for how to produce this directory. * the test matrix is done manually. release test builds are only enabled by default for the native target. this should save us some CI time, while still providing decent coverage of release builds. - add test coverage for `x86_64-linux-musl -lc` (building musl libc) - add test coverage for `x86_64-linux-gnu -lc` (building glibc) - add test coverage for `aarch64v8_5a-linux-none` - add test coverage for `aarch64v8_5a-linux-musl -lc` (building musl libc) - add test coverage for `aarch64v8_5a-linux-gnu -lc` (building glibc) - add test coverage for `arm-linux-none` - test coverage for `arm-linux-musleabihf -lc` (building musl libc) is disabled due to #3286 - test coverage for `arm-linux-gnueabihf -lc` (building glibc) is disabled due to #3287 - test coverage for `x86_64-windows-gnu -lc` (building mingw-w64) is disabled due to #3285 * enable qemu testing on the Linux CI job. There's not really a good reason to enable wine, since we have a Windows CI job as well. * remove the no longer needed `--build-file ../build.zig` from CI scripts * fix bug in glibc compilation where it wasn't properly reading the abi list txt files, resulting in "key not found" error. * std.build.Target gains: - isNetBSD - isLinux - osRequiresLibC - getArchPtrBitWidth - getExternalExecutor * zig build system gains support for enabling wine and enabling qemu. `artifact.enable_wine = true;`, `artifact.enable_qemu = true;`. This communicates that the system has these tools installed and the build system will use them to run tests. * zig build system gains support for overriding the dynamic linker of an executable artifact. * fix std.c.lseek prototype. makes behavior tests for arm-linux-musleabihf pass. * disable std lib tests that are failing on ARM. See #3288, #3289 * provide `std.os.off_t`. * disable some of the compiler_rt symbols for arm 32 bit. Fixes compiler_rt tests for arm 32 bit * add __stack_chk_guard when linking against glibc. Fixes std lib tests for aarch64-linux-gnu * workaround for "unable to inline function" using `@inlineCall`. Fixes compiler_rt tests for arm 32 bit.
2019-09-21 23:55:56 -04:00
2017-10-21 17:31:06 -04:00
2022-10-05 03:22:10 -07:00
2021-02-24 16:36:27 -07:00
2021-02-24 16:36:27 -07:00
2022-10-05 03:22:10 -07:00
2022-10-31 10:24:38 -07:00
2022-10-31 10:24:38 -07:00
2021-10-31 14:12:36 +00:00
2022-05-13 14:30:43 -07:00
2022-05-13 14:30:43 -07:00
2022-05-13 14:30:43 -07:00
multi-thread `zig build test-cases` Instead of always using std.testing.allocator, the test harness now follows the same logic as self-hosted for choosing an allocator - that is - it uses C allocator when linking libc, std.testing.allocator otherwise, and respects `-Dforce-gpa` to override the decision. I did this because I found GeneralPurposeAllocator to be prohibitively slow when doing multi-threading, even in the context of a debug build. There is now a second thread pool which is used to spawn each test case. The stage2 tests are passed the first thread pool. If it were only multi-threading the stage1 tests then we could use the same thread pool for everything. However, the problem with this strategy with stage2 is that stage2 wants to spawn tasks and then call wait() on the main thread. If we use the same thread pool for everything, we get a deadlock because all the threads end up all hanging at wait() and nothing is getting done. So we use our second thread pool to simulate a "process pool" of sorts. I spent most of the time working on this commit scratching my head trying to figure out why I was getting ETXTBSY when spawning the test cases. Turns out it's a fundamental Unix design flaw, already a known, unsolved issue by Go and Java maintainers: https://github.com/golang/go/issues/22315 https://bugs.openjdk.org/browse/JDK-8068370 With this change, the following command, executed on my laptop, went from 6m24s to 1m44s: ``` stage1/bin/zig build test-cases -fqemu -fwasmtime -Denable-llvm ``` closes #11818
2022-06-13 18:59:52 -07:00
2022-05-13 14:30:43 -07:00
2022-05-13 14:30:43 -07:00
2017-12-11 23:34:59 -05:00
2021-10-02 14:58:16 -05:00
2021-10-02 14:58:16 -05:00
2022-03-27 21:05:42 +03:00
2017-12-11 23:34:59 -05:00
2022-08-02 16:57:32 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2022-08-02 16:57:32 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2021-04-15 10:43:39 -07:00
2022-08-02 16:57:32 -07:00
2021-04-15 10:43:39 -07:00
2022-08-02 16:57:32 -07:00