aboutsummaryrefslogtreecommitdiff
path: root/build.zig
AgeCommit message (Collapse)Author
2025-11-16Merge pull request #25929 from alexrp/maccatalystAlex Rønne Petersen
`std.zig.target`: support `aarch64-maccatalyst` and `x86_64-maccatalyst` cross libc
2025-11-15build: change -Dskip-macos to -Dskip-darwin and make it cover all darwin OSsAlex Rønne Petersen
2025-11-15build.zig: use `Step.UpdateSourceFiles` for `zig1.wasm`Matthew Lugg
We were already using this for `stage1/zig.h`, but `stage1/zig1.wasm` was being modified directly by the `wasm-opt` command. That's a bad idea because it forces the build system to assume that `wasm-opt` has side effects, so it is re-run every time you run `zig build update-zig1`, i.e. it does not interact with the cache system correctly. It is much better to create non-side-effecting `Run` steps (using `addOutput*Arg`) where possible so that the build system has a more correct understanding of the step graph.
2025-10-30build: bump libc-test max_rss from 1758181785 to 2253598720Alex Rønne Petersen
2025-10-27remove all Oracle Solaris supportAlex Rønne Petersen
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
2025-10-14Merge pull request #25402 from alexrp/libc-test-ciAlex Rønne Petersen
`ci`: enable running libc-test on `x86_64-linux-release`
2025-10-09build.zig: rename -Dtest-default-only to -Dno-matrixAndrew Kelley
because it's more memorable
2025-10-08build.zig: add -Dtest-default-only optionAndrew Kelley
handy during development when it is already known that not all tests will pass.
2025-10-03std.mem: Add `countScalar`Ryan Liptak
2025-10-01libc-test: set a 1.6G max_rss for each test caseAlex Rønne Petersen
1.4G was the highest value I observed for any test case on x86_64-linux. This change should prevent OOM conditions in CI.
2025-09-30tests: split up and enhance stack trace testsmlugg
Previously, the `test-stack-traces` step was essentially just testing error traces, and even there we didn't have much coverage. This commit solves that by splitting the "stack trace" tests into two separate harnesses: the "stack trace" tests are for actual stack traces (i.e. involving stack unwinding), while the "error trace" tests are specifically for error return traces. The "stack trace" tests will test different configurations of: * `-lc` * `-fPIE` * `-fomit-frame-pointer` * `-fllvm` * unwind tables (currently disabled) * strip debug info (currently disabled) The main goal there is to test *stack unwinding* under different conditions. Meanwhile, the "error trace" tests will test different configurations of `-O` and `-fllvm`; the main goal here, aside from checking that error traces themselves do not miscompile, is to check whether debug info is still working even in optimized builds. Of course, aggressive optimizations *can* thwart debug info no matter what, so as before, there is a way to disable cases for specific targets / optimize modes. The program which converts stack traces into a more validatable format by removing things like addresses (previously `check-stack-trace.zig`, now `convert-stack-trace.zig`) has been rewritten and simplified. Also, thanks to various fixes in this branch, several workarounds have become unnecessary: for instance, we don't need to ignore the function name printed in stack traces in release modes, because `std.debug.Dwarf` now uses the correct DIE for inlined functions! Neither `test-stack-traces` nor `test-error-traces` does general foreign architecture testing, because it seems that (at least for now) external executors often aren't particularly good at handling stack tracing correctly (looking at you, Wine). Generally, they just test the native target (this matches the old behavior of `test-stack-traces`). However, there is one exception: when on an x86_64 or aarch64 host, we will also test the 32-bit version (x86 or arm) if the OS supports it, because such executables can be trivially tested without an external executor. Oh, also, I wrote a bunch of stack trace tests. Previously there was, erm, *one* test in `test-stack-traces` which wasn't for error traces. Now there are a good few!
2025-09-24delete `@cImport` testsAndrew Kelley
These are now maintained in a separate repository: ziglang/translate-c
2025-09-24update aro and translate-c sourcesVeikka Tuominen
2025-09-24delete all the translate-c testsAndrew Kelley
the ziglang/translate-c package has its own test suite, so these are redundant
2025-09-24compiler: update aro and translate-c to latest; delete clang translate-cAndrew Kelley
2025-09-24Integrate libc-test cases into the build systemrpkak
zig build test-libc -Dlibc-test-path=/path/to/libc-test
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-09-18test: respect -Dskip-translate-c in test-standaloneAlex Rønne Petersen
2025-09-16build: skip test-cimport when -Dskip-translate-c is givenAlex Rønne Petersen
2025-09-16build: -Dskip-translate-c now implies -Dskip-run-translated-cAlex Rønne Petersen
2025-09-16test: remove test-compare-output and test-asm-link testsAlex Rønne Petersen
These were low value and unfocused tests. We already have coverage of the important aspects of these tests elsewhere. Additionally, there was really no need for these to have their own test harness.
2025-08-30Merge pull request #25077 from ziglang/GenericReaderAndrew Kelley
std.Io: delete GenericReader, AnyReader, FixedBufferStream; and related API breakage
2025-08-30upgrade more old API usesAndrew Kelley
2025-08-30build: update to LLVM 21Alex Rønne Petersen
Closes #20966.
2025-08-18start the 0.16.0 release cycleAndrew Kelley
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-06Revert "Sema: Stop adding Windows implib link inputs for `extern "..."` syntax."Alex Rønne Petersen
This reverts commit b461d07a5464aec86c533434dab0b58edfffb331. After some discussion in the team, we've decided that this is too disruptive, especially because the linker errors are less than helpful. That's a fixable problem, so we might reconsider this in the future, but revert it for now.
2025-08-02build: add -Dskip-compile-errors optionAlex Rønne Petersen
Skips tests in test/cases/compile_errors.
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-07-07build.zig: bump maxrss for behavior testsAndrew Kelley
2025-07-06Sema: Stop adding Windows implib link inputs for `extern "..."` syntax.Alex Rønne Petersen
Closes #23971.
2025-07-03test: Respect various test skip options in test-casesAlex Rønne Petersen
2025-06-19Target: pass and use locals by pointer instead of by valueJacob Young
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
2025-06-19Build: add install commands to `--verbose` outputJacob Young
2025-06-06CI: skip llvm backend tests in the script for testing x86 backendAndrew Kelley
2025-06-06restore debug llvm CI coverageAndrew Kelley
and reduce redundant coverage in slow runs to save time
2025-06-06Compilation: enable the x86_64 backend by default for debug buildsJacob Young
Closes #22257
2025-06-01build: bump behavior max_rssJacob Young
2025-05-20Merge pull request #23923 from alexrp/compiler-rt-symbolsAlex Rønne Petersen
Use hidden visibility in compiler-rt and libzigc except when testing
2025-05-19build: Bump max_rss for test-behavior to 2488843878.Alex Rønne Petersen
2025-05-18build.zig: use correct module graph for compiler unit testsmlugg
2025-05-12test: Add test-llvm-ir step and harness for testing generated LLVM IR.Alex Rønne Petersen
2025-04-12Merge pull request #23529 from alexrp/2879-groundworkAlex Rønne Petersen
Introduce libzigc for libc function implementations in Zig
2025-04-11Merge pull request #22516 from Jan200101/PR/build_id_optionAndrew Kelley
std.Build: add build-id option
2025-04-11Introduce libzigc for libc function implementations in Zig.Alex Rønne Petersen
This lays the groundwork for #2879. This library will be built and linked when a static libc is going to be linked into the compilation. Currently, that means musl, wasi-libc, and MinGW-w64. As a demonstration, this commit removes the musl C code for a few string functions and implements them in libzigc. This means that those libzigc functions are now load-bearing for musl and wasi-libc. Note that if a function has an implementation in compiler-rt already, libzigc should not implement it. Instead, as we recently did for memcpy/memmove, we should delete the libc copy and rely on the compiler-rt implementation. I repurposed the existing "universal libc" code to do this. That code hadn't seen development beyond basic string functions in years, and was only usable-ish on freestanding. I think that if we want to seriously pursue the idea of Zig providing a freestanding libc, we should do so only after defining clear goals (and non-goals) for it. See also #22240 for a similar case.
2025-04-09build: Set LLVM_BUILD_STATIC/CLANG_BUILD_STATIC when linking statically.Alex Rønne Petersen
This is needed since LLVM 20, particularly for Windows.
2025-04-07compiler: Switch default code model for loongarch64 to medium.Alex Rønne Petersen
LLVM 21 will change the default, but we're making the change now to make building Zig for loongarch64 less painful. https://github.com/llvm/llvm-project/pull/132173
2025-04-04build: Rename -Dtest-slow-targets to -Dtest-extra-targets.Alex Rønne Petersen
This can be used more broadly for targets that aren't quite ready to be tested by default yet.
2025-04-04build: Update to LLVM/Clang 20.Alex Rønne Petersen
2025-03-27Merge pull request #23378 from alexrp/build-zig-cleanupAlex Rønne Petersen