This is useful for build.zig files to check in some cases, for example
to adhere to the convention of installing config to /etc instead of
/usr/etc on linux when using the /usr prefix. Perhaps std.build will
handle such common cases eventually, but that is not yet the case.
This broke build scripts that wanted to refer to `exe_dir` or
`install_path`.
There has also been some pushback and discussion on this breaking
change. I think it should be re-evaluated.
This reverts commit a1a1929cf4ff979bdaba17f858d4ce8647e87a65.
* Field global_cache_root was added to Builder struct along with
mandatory argument for build_runner.zig. Logic for using the custom
global cache was also added.
* The arguments --cache-dir and --global-cache-dir are no longer passed
directly through to build_runner.zig and are instead only passed through the
mandatory cache_root and global_cache_root arguments.
As part of this:
* add std.process.cleanExit. closes#6395
- use it in several places
* adjust the alignment of text in `zig build --help` menu
* Cache: support the concept of "unhit" so that we properly keep track
of the cache when we find out using the secondary hash that the cache
"hit" was actually a miss. Use this to fix false negatives of caching
of stage1 build artifacts.
* fix not deleting the symlink hash for stage1 build artifacts causing
false positives.
* implement support for Package arguments in stage1 build artifacts
* update and add missing usage text
* add --override-lib-dir and --enable-cache CLI options
- `--enable-cache` takes the place of `--cache on`
* CLI supports -femit-bin=foo combined with --enable-cache to do an
"update file" operation. --enable-cache without that argument
will build the output into a cache directory and then print the path
to stdout (matching master branch behavior).
* errors surfacing from main() now print "error: Foo" instead of
"error: error.Foo".
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
Thanks to the Windows Process Environment Block, it is possible to
obtain handles to the standard input, output, and error streams without
possibility of failure.