breaking changes to zig build API and improved caching #2038
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
to call, unless setOutputDir() was used, or within a custom make()
function. Instead there is more convenient API to use which takes
advantage of the caching system. Search this commit diff for
exe.run()
for an example.into zig-cache. If you want to access build artifacts in a convenient
location, it is recommended to add an
install
step. Otherwiseyou can use the
run()
API mentioned above to execute programsdirectly from their location in the cache. Closes zig build system: cache build artifacts and detect cache invalidation #330.
addSystemCommand
is available for programs not built with Zigbuild.
manually delete zig-cache directories periodically to keep disk
usage down. It's planned for this to be a simple Least Recently
Used eviction system eventually.
--output
,--output-lib
, and--output-h
are removed. Instead,use
--output-dir
which defaults to the current working directory.Or take advantage of
--cache on
, which will print the main outputpath to stdout, and the other artifacts will be in the same directory
with predictable file names.
--disable-gen-h
is available whenone wants to prevent .h file generation.
@cImport
is always independently cached now. Closes independently cache @cImports and C object files #2015.It always writes the generated Zig code to disk which makes debug
info and compile errors better. No more "TODO: remember C source
location to display here"
zig-cache directory.
This breaks the CLI API that Godbolt uses. The suggested new invocation
can be found in this commit diff, in the changes to
test/cli.zig
.