This commit installs Zig to "build_dir/stage3" during building
so that distros' can easily find binary and use it for testing/etc.
This commit also splits "add_custom_target(stage3 ALL" and command that it invokes,
so that it won't retry it during installation,
as target will be considered not out-of-date.
See also https://www.github.com/ziglang/zig/issues/14240#issuecomment-1374642063
Fixes a regression introduced in
9295355985202c267b4326b5a6e2ad5158b48e5d that caused 32-bit builds with
`-Denable-llvm` to fail to build from source due to that common
u64/usize casting issue.
Looks like I might have messed up the wasm kernel in my recent branch causing some sporadic failures on the CI.
This file was built the following way:
1. check out d0311e28b397d173f0d60c403985047ec952a172
2. do the cmake bootstrap
3. check out 57ea6207d3cb2db706bdc06c14605e4b901736dd
4. `zig build update-zig1` and stash those modified files
5. check out 440b3df702f1c8bfddabc1c594a3f49cf0011a63 (master)
6. do the cmake bootstrap
7. `zig build update-zig1` to produce this commit
Fixes#15489
This also lays the groundwork for exposing the whether or not a function is
noinline in std.builtin.Fn as an `is_noinline: bool` field if we ever want to do that.
This is needed because bug fixes to the C backend are required in order
to actually update the standard library and compiler sources to use the
new `@memcpy` and `@memset` semantics.
This is a small change to help when reading failure logs which makes the
"exited with code 1" and similar message include the test name.
Further enhancements could do the following:
* even if one unit test crashes the process, the parent process
continues running the other unit tests
* ability to test for expected panics (#1356)
* timeouts on individual tests
The previous commit introduced an optimization to the LLVM backend that
makes `@memset` lower more optimally when the element is comptime-known
and has a repeating byte pattern.
By making these functions inline, if the element parameter is
comptime-known at the callsite, it will be comptime-known in the
`@memset` call, causing more use of the LLVM `memset` intrinsic rather
than an inline for loop when using the LLVM backend.
This affects, for example, std.crypto.argon2, which calls
appendNTimesAssumeCapacity with a `[128]u64` as the element. This is now
lowered with a single `memset` call.
When the element is comptime-known, we can check if it has a repeated
byte representation. In this case, `@memset` can be lowered with the
LLVM intrinsic rather than with a loop.
On Windows, a directory that's set as the current working directory is
not allowed to be removed. This can cause error on `deleteTree` if the
CWD is set to the file to be removed and will cause `error.FileBusy`.
However, due to `tmp.cleanup()` ignoring the errors, the folder removal error will
be ignored. The only test violating this is `windows_spawn`. As a
solution, setting the parent directory to be the CWD before deletion
will allow the cleanup to pass.