aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build.zig
AgeCommit message (Collapse)Author
2024-07-28Add libcpp option to test optionsSammy James
2024-07-25add --debug-rt CLI arg to the compiler + bonus editsAndrew Kelley
The flag makes compiler_rt and libfuzzer be in debug mode. Also: * fuzzer: override debug logs and disable debug logs for frequently called functions * std.Build.Fuzz: fix bug of rerunning the old unit test binary * report errors from rebuilding the unit tests better * link.Elf: additionally add tsan lib and fuzzer lib to the hash
2024-07-25build runner: extract logic to std.Build.FuzzAndrew Kelley
2024-07-25add `--fuzz` CLI argument to `zig build`Andrew Kelley
This flag makes the build runner rebuild unit tests after the pipeline finishes, if it finds any unit tests. I did not make this integrate with file system watching yet. The test runner is updated to detect which tests are fuzz tests. Run step is updated to track which test indexes are fuzz tests.
2024-07-23add std.testing.random_seedAndrew Kelley
closes #17609
2024-07-21std.Build: add support for passing comptime_int, float and comptime_float ↵L zard
options
2024-07-20add std.fmt.hexAndrew Kelley
converts an unsigned integer into an array
2024-07-14build runner: update watch caption to include subprocessesAndrew Kelley
2024-07-14frontend: add -fincremental, -fno-incremental flagAndrew Kelley
Remove --debug-incremental This flag is also added to the build system. Importantly, this tells Compile step whether or not to keep the compiler running between rebuilds. It defaults off because it is currently crashing zirUpdateRefs.
2024-07-14make zig compiler processes live across rebuildsAndrew Kelley
Changes the `make` function signature to take an options struct, which additionally includes `watch: bool`. I intentionally am not exposing this information to configure phase logic. Also adds global zig cache to the compiler cache prefixes. Closes #20600
2024-07-12integrate Compile steps with file watchingAndrew Kelley
Updates the build runner to unconditionally require a zig lib directory parameter. This parameter is needed in order to correctly understand file system inputs from zig compiler subprocesses, since they will refer to "the zig lib directory", and the build runner needs to place file system watches on directories in there. The build runner's fanotify file watching implementation now accounts for when two or more Cache.Path instances compare unequal but ultimately refer to the same directory in the file system. Breaking change: std.Build no longer has a zig_lib_dir field. Instead, there is the Graph zig_lib_directory field, and individual Compile steps can still have their zig lib directories overridden. I think this is unlikely to break anyone's build in practice. The compiler now sends a "file_system_inputs" message to the build runner which shares the full set of files that were added to the cache system with the build system, so that the build runner can watch properly and redo the Compile step. This is implemented for whole cache mode but not yet for incremental cache mode.
2024-07-12std.Build.LazyPath: add getPath3; deprecate getPath2 and getPathAndrew Kelley
The goal is to move towards using `std.Build.Cache.Path` instead of absolute path names. This was helpful for implementing file watching integration to the InstallDir Step
2024-07-12std.Build.Step.WriteFile: extract UpdateSourceFilesAndrew Kelley
This has been planned for quite some time; this commit finally does it. Also implements file system watching integration in the make() implementation for UpdateSourceFiles and fixes the reporting of step caching for both. WriteFile does not yet have file system watching integration.
2024-07-12make more build steps integrate with the watch systemAndrew Kelley
2024-07-12proof-of-concept --watch implementation based on fanotifyAndrew Kelley
So far, only implemented for InstallFile steps. Default debounce interval bumped to 50ms. I think it should be configurable. Next I have an idea to simplify the fanotify implementation, but other OS implementations might want to refer back to this commit before I make those changes.
2024-07-12build runner: implement --watch (work-in-progress)Andrew Kelley
I'm still learning how the fanotify API works but I think after playing with it in this commit, I finally know how to implement it, at least on Linux. This commit does not accomplish the goal but I want to take the code in a different direction and still be able to reference this point in time by viewing a source control diff. I think the move is going to be saving the file_handle for the parent directory, which combined with the dirent names is how we can correlate the events back to the Step instances that have registered file system inputs. I predict this to be similar to implementations on other operating systems.
2024-07-12std.Build: remove the "push installed file" mechanismAndrew Kelley
Tracked by #14943
2024-07-12build system: add --watch flag and report source file in InstallFileAndrew Kelley
This direction is not quite right because it mutates shared state in a threaded context, so the next commit will need to fix this.
2024-07-09std: fix typos (#20560)Jora Troosh
2024-06-21std.Build.findProgram(): Try with and without the Windows executable extensions.Alex Rønne Petersen
I renamed std.process.Child.CreateProcessSupportedExtension to WindowsExtension and made it public to avoid duplicating the list of extensions. While here, I also improved it to not misreport OOM from std.fs.realpathAlloc() as a generic failure to find the program, but instead panic like the rest of the build system does for OOM. Closes #20314.
2024-06-20std: mark Build.args as constAlex Kladov
I don't think these are intended to be mutated!
2024-06-16std.Build: Add Step.Fail and addFail() function.Alex Rønne Petersen
Closes #15373.
2024-06-09build: inherit setExecCmd from test compile steps when creating run stepsRobin Voetter
This should fix #17756
2024-06-08std.Build: remove deprecated b.host in favor of b.graph.host (#20237)Krzysztof Wolicki
2024-06-06Add support for []enum in Build.optionMaciej 'vesim' Kuliński
2024-05-27update the codebase for the new std.Progress APIAndrew Kelley
2024-05-26std: restructure child process namespaceAndrew Kelley
2024-05-05Run: add output directory argumentsJacob Young
This allows running commands that take an output directory argument. The main thing that was needed for this feature was generated file subpaths, to allow access to the files in a generated directory. Additionally, a minor change was required to so that the correct directory is created for output directory args.
2024-05-05Build: cleanupJacob Young
* `doc/langref` formatting * upgrade `.{ .path = "..." }` to `b.path("...")` * avoid using arguments named `self` * make `Build.Step.Id` usage more consistent * add `Build.pathResolve` * use `pathJoin` and `pathResolve` everywhere * make sure `Build.LazyPath.getPath2` returns an absolute path
2024-04-18Merge pull request #19689 from nektro/nektro-patch-29794Andrew Kelley
std: fix and add test for Build.dependencyFromBuildZig
2024-04-18std: fix and add test for Build.dependencyFromBuildZigMeghan Denny
2024-04-18std.Build: revert --host-target, --host-cpu, --host-dynamic-linkerAndrew Kelley
This is a partial revert of 105db13536b4dc2affe130cb8d2eee6c97c89bcd. As we learned from Void Linux packaging, these options are not actually helpful since the distribution package manager may very well want to cross-compile the packages that it is building. So, let's not overcomplicate things. There are already the standard options: -Dtarget, -Dcpu, and -Ddynamic-linker. These options are generally provided when the project generates machine code artifacts, however, there may be a project that does no such thing, in which case it makes sense for these options to be missing. The Zig Build System is a general-purpose build system, after all.
2024-04-11std.Build: revert the breaking changes onlyAndrew Kelley
The previous commit deleted the deprecated API and then made all the follow-up changes; this commit reverts only the breaking API changes. This commit can be reverted once 0.12.0 is tagged.
2024-04-11remove deprecated LazyPath.path union tagAndrew Kelley
2024-04-10introduce std.Build.path; deprecate LazyPath.relativeAndrew Kelley
This adds the *std.Build owner to LazyPath so that lazy paths returned from a dependency can be used in the application without friction or footguns. closes #19313
2024-04-07Merge pull request #18590 from castholm/move-standalone-test-casesAndrew Kelley
std.Build: Remove `anonymousDependency`
2024-04-07Make `std.Build.dependencyInner` privateCarl Åstholm
2024-04-07Remove `std.Build.anonymousDependency`Carl Åstholm
2024-04-07std.Build: Remove unused `c_std` fieldCarl Åstholm
This field has not been referenced by compile steps since e76ce2c1d0d3988359267fd3030a81a52ec99f3f, all the way back in 2019. To specify the language standard, pass `-std=[value]` as a regular C flag instead.
2024-04-07std.Build: add dependencyFromBuildZigCarl Åstholm
2024-04-07Merge pull request #18988 from castholm/lazy-build-zigAndrew Kelley
std.Build: add `lazyImport` (`@import` for lazy dependencies)
2024-04-07Document added/updated functionsCarl Åstholm
Also renames `addHeaders` to `addHeadersDirectory` for clarity.
2024-04-07Update `addInstallHeaderFile` to take a `LazyPath`Carl Åstholm
2024-04-07std.Build: add `lazyImport` (`@import` for lazy dependencies)Carl Åstholm
2024-03-30Update uses of `@fieldParentPtr` to use RLSJacob Young
2024-03-30Update uses of `@fieldParentPtr` to pass a pointer typeJacob Young
2024-03-21std.Build.addTest: add doc commentsAndrew Kelley
closes #15009
2024-03-11std.builtin: make link mode fields lowercaseTristan Ross
2024-02-25test: rework how filtering worksJacob Young
* make test names contain the fully qualified name * make test filters match the fully qualified name * allow multiple test filters, where a test is skipped if it does not match any of the specified filters
2024-02-15std.Build: fix wrong variable used in `parseTargetQuery`tjog
Also address clobbering diagnostics field with an assert and doc comment to use the Target.Query.parse function themselves. Fixes #18876