aboutsummaryrefslogtreecommitdiff
path: root/tools/incr-check.zig
AgeCommit message (Collapse)Author
3 daysincr-check: more general --debug-log CLIAndrew Kelley
6 daystest-incremental: respect the wine, qemu, etc build flagsAndrew Kelley
6 daysupdate remaining calls to std.Io.Threaded.initAndrew Kelley
6 daysfix compilation of incr-checkAndrew Kelley
2025-11-20update deprecated ArrayListUnmanaged usage (#25958)Benjamin Jurk
2025-11-19incr-check: read/write messages as little endianAlex Rønne Petersen
2025-11-09incr-check: Kill child process on errorRyan Liptak
Since the child process is spawned with the tmp directory as its CWD, the child process opens it without DELETE access. On error, the child process would still be alive while the tmp directory is attempting to be deleted, so it would fail with `.SHARING_VIOLATION => return error.FileBusy`. Fixes arguably the least important part of #22510, since it's only the directory itself that would fail to get deleted, all the files inside would get deleted just fine.
2025-10-30std.debug.lockStderrWriter: also return ttyconfMatthew Lugg
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
2025-10-29incr-check: windows source files depend on ws2_32Andrew Kelley
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-09- Rework common translate-c and cImport logic into `Compilation.translateC`kcbanner
- Add std.zig.Server.allocErrorBundle, replace duplicates
2025-08-30update tools and other miscellaneous things to new APIsAndrew Kelley
2025-07-23std.Io.poll: update to new I/O APIAndrew Kelley
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-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-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-20compiler: integrate `@compileLog` with incremental compilationmlugg
Compile log output is now separated based on the `AnalUnit` which perfomred the `@compileLog` call, so that we can omit the output for unreferenced ("dead") units. The units are also sorted when collecting the `ErrorBundle`, so that compile logs are always printed in a consistent order, like compile errors are. This is important not only for incremental compilation, but also for parallel analysis. Resolves: #23609
2025-02-25correct some bugsDavid Rubin
2025-01-25incr-check: check compile errors against expectedmlugg
Also modifies all incremental cases using `#expect_error` to include the errors and notes which are expected.
2025-01-25incr-check: deal with Windows stupiditymlugg
The real problem here is that Git for Windows has horrendous defaults which convert LF to CRLF. However, rather than changing this configuration on the CI runners, it's worth supporting inexplicable CRLF in these files so that anyone else cloning Zig on Windows doesn't get unexpected test failures.
2025-01-25incremental: handle `@embedFile`mlugg
Uses of `@embedFile` register dependencies on the corresponding `Zcu.EmbedFile`. At the start of every update, we iterate all embedded files and update them if necessary, and invalidate the dependencies if they changed. In order to properly integrate with the lazy analysis model, failed embed files are now reported by the `AnalUnit` which actually used `@embedFile`; the filesystem error is stored in the `Zcu.EmbedFile`. An incremental test is added covering incremental updates to embedded files, and I have verified locally that dependency invalidation is working correctly.
2025-01-05Dwarf: implement new incremental line number update APIJacob Young
2024-10-05incr-check: minor fixesmlugg
* fix inconsistency in global cache directory name * don't error if spawning external executor fails * handle CRLF correctly
2024-10-05incr-check: clean up temporary directory by defaultmlugg
The new `--preserve-tmp` flag can be used to preserve the temporary directory for debugging purposes.
2024-10-05incr-check: better progress output, support external executorsmlugg
If no external executor is available for a successful binary, its execution is silently skipped. This allows the CI to test, to the fullest extent possible, incremental cross-compilation to targets whose binaries can't be executed on the host.
2024-10-05tests: add `test-incremental` stepmlugg
This is contained in the `test` step, so is tested by CI. This commit also includes some enhancements to the `incr-check` tool to make this work correctly.
2024-09-25incr-check: specify backend in manifest, allow multiple targets/backendsmlugg
2024-09-25incr-check: actually handle end message for a compiler updateJakub Konka
2024-09-25incr-check: add --debug-link flag for verbose linker loggingJakub Konka
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-08-19fix various issues related to Path handling in the compiler and stdRobin Voetter
A compilation build step for which the binary is not required could not be compiled previously. There were 2 issues that caused this: - The compiler communicated only the results of the emitted binary and did not properly communicate the result if the binary was not emitted. This is fixed by communicating the final hash of the artifact path (the hash of the corresponding /o/<hash> directory) and communicating this instead of the entire path. This changes the zig build --listen protocol to communicate hashes instead of paths, and emit_bin_path is accordingly renamed to emit_digest. - There was an error related to the default llvm object path when CacheUse.Whole was selected. I'm not really sure why this didn't manifest when the binary is also emitted. This was fixed by improving the path handling related to flush() and emitLlvmObject(). In general, this commit also improves some of the path handling throughout the compiler and standard library.
2024-08-17tools: add CBE option to incr-checkmlugg
2024-08-17tools,test: improve incr-check and add new incremental testsmlugg
2024-08-17tools: improve incr-checkmlugg
And add a new incremental test to match!
2024-07-20incr-check: support running the generated binaryAndrew Kelley
2024-07-20incr-test: running an updateAndrew Kelley
2024-07-20init incremental compilation check toolAndrew Kelley