Uh oh!
There was an error while loading. Please reload this page.
make self-hosted the default compiler - #12368
Conversation
ghost
commented
Aug 8, 2022
YOOOOOOOOOOOOOOOOO |
Hang on a minute. #89 now says
So what's the plan there? Do we fall back to stage1 if we see it? Do we just break all code? I feel like I must be out of the loop here. |
Vexu
commented
Aug 8, 2022
See #12345 |
kubkon
commented
Aug 8, 2022
Re failures on macOS, I haven't been able to repro locally on arm64, however, I did notice that for folks linking against a system provided LLVM (e.g., installed via Homebrew, etc.), they will now be forced to manually specify system include and search dirs as well as sysroot path. In order to avoid this silliness, here's my patch suggestion: diff --git a/src/main.zig b/src/main.zig
index d041036b9..758d27084 100644
--- a/src/main.zig+++ b/src/main.zig@@ -2375,14 +2375,9 @@ fn buildOutputType(
}
}
- if (comptime builtin.target.isDarwin()) {- // If we want to link against frameworks, we need system headers.- if (framework_dirs.items.len > 0 or frameworks.count() > 0)- want_native_include_dirs = true;- }-
if (sysroot == null and cross_target.isNativeOs() and
- (system_libs.count() != 0 or want_native_include_dirs))+ (system_libs.count() != 0 or want_native_include_dirs or+ comptime builtin.target.isDarwin()))
{
const paths = std.zig.system.NativePaths.detect(arena, target_info) catch |err| {
fatal("unable to detect native system paths: {s}", .{@errorName(err)});In other words, if we are native and targeting Darwin, add system include and search dirs by default, and additionally, try locating the sysroot automatically too. |
kubkon
commented
Aug 8, 2022
I did hit this when running a couple of test suites on arm64 macOS: |
Jarred-Sumner
commented
Aug 8, 2022
Instead of breaking existing projects with the upgrade, could sema detect usage of async (or other unsupported feature) and automatically switch to stage1? |
I thought about this. I think that the convenience it brings is outweighed by the confusion it might cause, of people not knowing which compiler implementation they are using. I think it should be an intentional choice, and the first question I'm going to ask someone when they report a bug is, "what CLI invocation are you using?" which will tell me which compiler they are using. If it depended on the code, bugs would be harder to diagnose. Also keep in mind this is transitional period. At some point between now and the next release, this option just disappears entirely. Also note that for your project you can set stage1 = true in your build script, preventing any users from having to follow any extra directions. |
andrewrk
commented
Aug 8, 2022
The aarch64-linux CI failure is #12360 |
kamidev
commented
Aug 9, 2022
I fail at the same test |
39cc242 to
dc29145Compared3be887 to
4437f05Compareeb31461 to
d5d829eCompareThis updates to a stage3 freebsd tarball.
For both macOS and FreeBSD.
Instead of a switch in a bash file we just properly name the pipeline steps. Also use zig build to produce the release artifact.
it was returning a pointer to a parameter.
This includes a few recent bug fixes which may solve the Windows CI failure.
Simplify the script by not creating an unnecessary build directory and then changing directories to and from it.
This was present in stage1 but missing from self-hosted.
* accept forward and backward slashes in file paths * strip multiple extensions; e.g. if the basename is "test.exe.obj" then it strips to "test".
empirically this avoids a segfault on the CI.
itsmontoya
commented
Aug 20, 2022
Congratulations @andrewrk ! This is huge! |
TheQu1etOwl
commented
Aug 21, 2022
Some recent change makes slice concatenation runtime (merge #12368), so the example needs to be explicitly made comptime.
stage2 has been merged and set as default around end of aug 2022 in ziglang/zig#12368. since then the main focus has been on this new stage2 compiler. with the release of 0.10.1 the stage2 is fairly useable now and it is the way forward, towards zig 0.11 or 1.0. read more about difference in https://github.com/ziglang/zig/wiki/Self-Hosted-Compiler-Upgrade-Guide another good read on the relevant topic is https://ziglang.org/news/goodbye-cpp/
stage1 is available behind the
-fstage1flag.closes#89
Merge Blockers
General
add valgrind integration to self-hostedI'll do this laterx86_64-freebsd
aarch64-linux:
x86_64-linux:
x86_64-macos:
x86_64-windows: