aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2025-09-16tools: Update fetch_them_macos_headers.zig for macOS 26Linus Groh
2025-09-04std.elf: change STV enum from u2 to u3Alex Rønne Petersen
In gABI 4.3, st_other was changed such that the lower 3 bits are reserved for the visibility, up from the previous 2 bits.
2025-08-30Merge pull request #25077 from ziglang/GenericReaderAndrew Kelley
std.Io: delete GenericReader, AnyReader, FixedBufferStream; and related API breakage
2025-08-30update tools and other miscellaneous things to new APIsAndrew Kelley
2025-08-30std.Target.x86: purge avx10.n-256, rename avx10.n_512 to avx10.n, require ↵Alex Rønne Petersen
evex512 for avx512f Intel has abandoned AVX10.N/128,256; AVX10.N is now always 512-bit.
2025-08-30update_cpu_features: bump branch quota for amdgcnAlex Rønne Petersen
/lib/std/Target/amdgcn.zig:1656:5: error: evaluation exceeded 1000 backwards branches for (&result, 0..) |*elem, i| { ^~~
2025-08-30update_cpu_features: fix a fmtId call to be fmtIdPUAlex Rønne Petersen
2025-08-28update langref and docs to avoid GenericWriterAndrew Kelley
2025-08-28update more to avoid GenericWriterAndrew Kelley
2025-08-14Rewrite `generate_linux_syscalls` to be completely table basedStephen Gregoratto
Changes by Arnd Bergmann have migrated all supported architectures to use a table for their syscall lists. This removes the need to use the C pre-processor and simplifies the logic considerably. All currently supported architectures have been added, with the ones Zig doesn't support being commented out. Speaking of; OpenRisc has been enabled for generation.
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley
2025-08-08zig std: fix build failuresAndrew Kelley
2025-08-08std.Io: remove BufferedWriterAndrew Kelley
2025-08-07Merge pull request #24661 from alichraghi/spv4Andrew Kelley
spirv: refactor and remove deduplication ISel
2025-08-04spirv: define and use extended instruction set opcodesAli Cheraghi
2025-08-02spirv: refactorAli Cheraghi
2025-08-01build system: replace fuzzing UI with build UI, add time reportmlugg
This commit replaces the "fuzzer" UI, previously accessed with the `--fuzz` and `--port` flags, with a more interesting web UI which allows more interactions with the Zig build system. Most notably, it allows accessing the data emitted by a new "time report" system, which allows users to see which parts of Zig programs take the longest to compile. The option to expose the web UI is `--webui`. By default, it will listen on `[::1]` on a random port, but any IPv6 or IPv4 address can be specified with e.g. `--webui=[::1]:8000` or `--webui=127.0.0.1:8000`. The options `--fuzz` and `--time-report` both imply `--webui` if not given. Currently, `--webui` is incompatible with `--watch`; specifying both will cause `zig build` to exit with a fatal error. When the web UI is enabled, the build runner spawns the web server as soon as the configure phase completes. The frontend code consists of one HTML file, one JavaScript file, two CSS files, and a few Zig source files which are built into a WASM blob on-demand -- this is all very similar to the old fuzzer UI. Also inherited from the fuzzer UI is that the build system communicates with web clients over a WebSocket connection. When the build finishes, if `--webui` was passed (i.e. if the web server is running), the build runner does not terminate; it continues running to serve web requests, allowing interactive control of the build system. In the web interface is an overall "status" indicating whether a build is currently running, and also a list of all steps in this build. There are visual indicators (colors and spinners) for in-progress, succeeded, and failed steps. There is a "Rebuild" button which will cause the build system to reset the state of every step (note that this does not affect caching) and evaluate the step graph again. If `--time-report` is passed to `zig build`, a new section of the interface becomes visible, which associates every build step with a "time report". For most steps, this is just a simple "time taken" value. However, for `Compile` steps, the compiler communicates with the build system to provide it with much more interesting information: time taken for various pipeline phases, with a per-declaration and per-file breakdown, sorted by slowest declarations/files first. This feature is still in its early stages: the data can be a little tricky to understand, and there is no way to, for instance, sort by different properties, or filter to certain files. However, it has already given us some interesting statistics, and can be useful for spotting, for instance, particularly complex and slow compile-time logic. Additionally, if a compilation uses LLVM, its time report includes the "LLVM pass timing" information, which was previously accessible with the (now removed) `-ftime-report` compiler flag. To make time reports more useful, ZIR and compilation caches are ignored by the Zig compiler when they are enabled -- in other words, `Compile` steps *always* run, even if their result should be cached. This means that the flag can be used to analyze a project's compile time without having to repeatedly clear cache directory, for instance. However, when using `-fincremental`, updates other than the first will only show you the statistics for what changed on that particular update. Notably, this gives us a fairly nice way to see exactly which declarations were re-analyzed by an incremental update. If `--fuzz` is passed to `zig build`, another section of the web interface becomes visible, this time exposing the fuzzer. This is quite similar to the fuzzer UI this commit replaces, with only a few cosmetic tweaks. The interface is closer than before to supporting multiple fuzz steps at a time (in line with the overall strategy for this build UI, the goal will be for all of the fuzz steps to be accessible in the same interface), but still doesn't actually support it. The fuzzer UI looks quite different under the hood: as a result, various bugs are fixed, although other bugs remain. For instance, viewing the source code of any file other than the root of the main module is completely broken (as on master) due to some bogus file-to-module assignment logic in the fuzzer UI. Implementation notes: * The `lib/build-web/` directory holds the client side of the web UI. * The general server logic is in `std.Build.WebServer`. * Fuzzing-specific logic is in `std.Build.Fuzz`. * `std.Build.abi` is the new home of `std.Build.Fuzz.abi`, since it now relates to the build system web UI in general. * The build runner now has an **actual** general-purpose allocator, because thanks to `--watch` and `--webui`, the process can be arbitrarily long-lived. The gpa is `std.heap.DebugAllocator`, but the arena remains backed by `std.heap.page_allocator` for efficiency. I fixed several crashes caused by conflation of `gpa` and `arena` in the build runner and `std.Build`, but there may still be some I have missed. * The I/O logic in `std.Build.WebServer` is pretty gnarly; there are a *lot* of threads involved. I anticipate this situation improving significantly once the `std.Io` interface (with concurrency support) is introduced.
2025-07-23std.Io.poll: update to new I/O APIAndrew Kelley
2025-07-21objcopy: delete most of itAndrew Kelley
this code is not up to zig project standards tracked by #24522 oh, and fix not adjusting buffer seek position in std.fs.File.Reader
2025-07-16update compilerAndrew Kelley
2025-07-16tools: fix some bitrotAlex Rønne Petersen
2025-07-15update dump-cov for alignment and writergate changesdweiller
2025-07-14spirv: snake-case the specAli Cheraghi
2025-07-11Remove numerous things deprecated during the 0.14 release cycleLinus Groh
Basically everything that has a direct replacement or no uses left. Notable omissions: - std.ArrayHashMap: Too much fallout, needs a separate cleanup. - std.debug.runtime_safety: Too much fallout. - std.heap.GeneralPurposeAllocator: Lots of references to it remain, not a simple find and replace as "debug allocator" is not equivalent to "general purpose allocator". - std.io.Reader: Is being reworked at the moment. - std.unicode.utf8Decode(): No replacement, needs a new API first. - Manifest backwards compat options: Removal would break test data used by TestFetchBuilder. - panic handler needs to be a namespace: Many tests still rely on it being a function, needs a separate cleanup.
2025-07-07update autodocs and langref to new APIAndrew Kelley
2025-07-07update standalone and incremental tests to new APIAndrew Kelley
2025-07-07remove `usingnamespace` from the languageAndrew Kelley
closes #20663
2025-07-07remove `async` and `await` keywordsAndrew Kelley
Also remove `@frameSize`, closing #3654. While the other machinery might remain depending on #23446, it is settled that there will not be `async`/ `await` keywords in the language.
2025-06-23remove `spirv` cpu archAli Cheraghi
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-12compiler: rework emit paths and cache modesmlugg
Previously, various doc comments heavily disagreed with the implementation on both what lives where on the filesystem at what time, and how that was represented in code. Notably, the combination of emit paths outside the cache and `disable_lld_caching` created a kind of ad-hoc "cache disable" mechanism -- which didn't actually *work* very well, 'most everything still ended up in this cache. There was also a long-standing issue where building using the LLVM backend would put a random object file in your cwd. This commit reworks how emit paths are specified in `Compilation.CreateOptions`, how they are represented internally, and how the cache usage is specified. There are now 3 options for `Compilation.CacheMode`: * `.none`: do not use the cache. The paths we have to emit to are relative to the compiler cwd (they're either user-specified, or defaults inferred from the root name). If we create any temporary files (e.g. the ZCU object when using the LLVM backend) they are emitted to a directory in `local_cache/tmp/`, which is deleted once the update finishes. * `.whole`: cache the compilation based on all inputs, including file contents. All emit paths are computed by the compiler (and will be stored as relative to the local cache directory); it is a CLI error to specify an explicit emit path. Artifacts (including temporary files) are written to a directory under `local_cache/tmp/`, which is later renamed to an appropriate `local_cache/o/`. The caller (who is using `--listen`; e.g. the build system) learns the name of this directory, and can get the artifacts from it. * `.incremental`: similar to `.whole`, but Zig source file contents, and anything else which incremental compilation can handle changes for, is not included in the cache manifest. We don't need to do the dance where the output directory is initially in `tmp/`, because our digest is computed entirely from CLI inputs. To be clear, the difference between `CacheMode.whole` and `CacheMode.incremental` is unchanged. `CacheMode.none` is new (previously it was sort of poorly imitated with `CacheMode.whole`). The defined behavior for temporary/intermediate files is new. `.none` is used for direct CLI invocations like `zig build-exe foo.zig`. The other cache modes are reserved for `--listen`, and the cache mode in use is currently just based on the presence of the `-fincremental` flag. There are two cases in which `CacheMode.whole` is used despite there being no `--listen` flag: `zig test` and `zig run`. Unless an explicit `-femit-bin=xxx` argument is passed on the CLI, these subcommands will use `CacheMode.whole`, so that they can put the output somewhere without polluting the cwd (plus, caching is potentially more useful for direct usage of these subcommands). Users of `--listen` (such as the build system) can now use `std.zig.EmitArtifact.cacheName` to find out what an output will be named. This avoids having to synchronize logic between the compiler and all users of `--listen`.
2025-06-06langref: global assembly test depends on llvmAndrew Kelley
see #24046
2025-06-05std.Target: Introduce Cpu convenience functions for feature tests.Alex Rønne Petersen
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-06-04Merge pull request #24025 from alexrp/glibc-deduplicationAlex Rønne Petersen
`libc`: Merge header directories for glibc and NetBSD libc where applicable
2025-05-31Legalize: implement scalarization of binary operationsJacob Young
2025-05-29process_headers: Merge header directories for some targets.Alex Rønne Petersen
These are almost entirely identical, with these exceptions: * lib/libc/include/csky-linux-{gnueabi,gnueabihf} * gnu/{lib-names,stubs}.h will need manual patching for float ABI. * lib/libc/include/{powerpc-linux-{gnueabi,gnueabihf},{powerpc64,powerpc64le}-linux-gnu} * bits/long-double.h will need manual patching for long double ABI.
2025-05-21target: auto-generated spirv featuresAli Cheraghi
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-20Merge pull request #23913 from alexrp/netbsd-libcAlex Rønne Petersen
Support dynamically-linked NetBSD libc when cross-compiling
2025-05-19compiler-rt: Fix some exports to respect the common linkage and visibility.Alex Rønne Petersen
2025-05-18incr-check: normalize path separators in file names in errorsmlugg
2025-05-18incr-check: support basic modulesmlugg
Allow specifying modules which the root module depends on. More complex graphs cannot currently be specified.
2025-05-17update_netbsd_libc: Add tool for updating NetBSD libc startup code.Alex Rønne Petersen
2025-05-17process_headers: Add NetBSD libc support.Alex Rønne Petersen
2025-05-16doctest: handle relative paths correctlymlugg
Evaluate all child processes in the temporary directory, and use `std.fs.path.relative` to make every other path relative to that child cwd instead of our cwd. Resolves: #22119
2025-05-12Merge pull request #23700 from sorairolake/rename-trimsAlex Rønne Petersen
chore(std.mem): Rename `trimLeft` and `trimRight` to `trimStart` and `trimEnd`
2025-05-10update_freebsd_libc: Add tool for updating FreeBSD libc startup code.Alex Rønne Petersen
2025-05-10process_headers: Add FreeBSD libc support.Alex Rønne Petersen
2025-04-27chore(std.mem): Rename `trimLeft` and `trimRight`Shun Sakai
Rename `trimLeft` to `trimStart`, and `trimRight` to `trimEnd`. `trimLeft` and `trimRight` functions remain as deprecated aliases for these new names.
2025-04-26compiler: Allow configuring UBSan mode at the module level.Alex Rønne Petersen
* Accept -fsanitize-c=trap|full in addition to the existing form. * Accept -f(no-)sanitize-trap=undefined in zig cc. * Change type of std.Build.Module.sanitize_c to std.zig.SanitizeC. * Add some missing Compilation.Config fields to the cache. Closes #23216.