Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the plan to get the CI passing with LLVM 11 #6663

Closed
andrewrk opened this issue Oct 13, 2020 · 6 comments
Closed

the plan to get the CI passing with LLVM 11 #6663

andrewrk opened this issue Oct 13, 2020 · 6 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

I'm headed to bed so I wanted to write down the plan to get the CI passing.

FreeBSD is fine, I just got overzealous [see image below] and tried to do this:

--- a/ci/srht/freebsd_script
+++ b/ci/srht/freebsd_script
@@ -31,23 +31,7 @@ cd build
 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PREFIX "-DCMAKE_INSTALL_PREFIX=$(pwd)/release" -DZIG_STATIC=ON
 make $JOBS install
 
-release/bin/zig build test-fmt
-release/bin/zig build test-behavior
-release/bin/zig build test-std
-release/bin/zig build test-compiler-rt
-release/bin/zig build test-compare-output
-release/bin/zig build test-standalone
-release/bin/zig build test-stack-traces
-release/bin/zig build test-cli
-release/bin/zig build test-asm-link
-release/bin/zig build test-runtime-safety
-release/bin/zig build test-translate-c
-release/bin/zig build test-run-translated-c
-# TODO disabled until we are shipping self-hosted
-#release/bin/zig build test-gen-h
-# TODO disabled to save time and hit that 45 minute limit
-#release/bin/zig build test-compile-errors
-release/bin/zig build docs
+release/bin/zig build test
 
 if [ -f ~/.s3cfg ]; then
   mv ../LICENSE release/

Which actually does pass. It just takes longer than the CI system is configured to allow builds to run for. So I'll either revert that or ask Ave for more time.


MacOS. Hooo boy. Have I ever mentioned how much I loathe C++? Our normal CI system stopped working with some combination of gcc 10 and macOS Catalina. My best guess is that my laptop is fully updated while the CI image is slightly out of date, making the libstdc++ not match each other, and therefore fail to build.

Anyway, I came up with a solution that I am happy with, which is taking advantage of ziglang/bootstrap. I discovered a new issue with that: ziglang/zig-bootstrap#36 but even working around that, there is one thing left before this will fix the CI:

On both FreeBSD and macOS, we don't yet have the ability to cross compile the system libc (#2876) and so rely on native libc detection. This happens by running the system C compiler with some special flags to get it to print the locations of libc include directories. However this is currently affected by the CC and CXX environment variables, which means that if you have CC and CXX set to zig cc and zig c++ respectively, then this detection will fail because it will recursively invoke zig as the C compiler, never finding the path to native libc include directories. There is code in Zig to detect this situation and print an error instead of doing a fork bomb, however, there is not code to detect this situation and make it Just Work by ignoring CC and CXX in this case and using the cc binary as a fallback. I vaguely recall opening an issue for this, but I can't find it.

Anyway the path forward here is to improve the code for this situation. This will makes it straightforward to use the bootstrap project to create a tarball which contains LLVM, LLD, Clang, and Zig, which can then be used as the C and C++ compiler for CI testing in a way that is insulated from the macOS version of the laptop vs CI image.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Oct 13, 2020
@andrewrk andrewrk added this to the 0.7.0 milestone Oct 13, 2020
@andrewrk andrewrk assigned andrewrk and unassigned andrewrk Oct 13, 2020
@aveao
Copy link

aveao commented Oct 13, 2020

I'm completely okay with increasing the build limit. What do you think would be appropriate for this? Would 3 hours be enough, or would you like something higher?

@andrewrk
Copy link
Member Author

3 should work just fine, I think. Thanks!

@aveao
Copy link

aveao commented Oct 13, 2020

I just applied the change and I think properly restarted everything. Please let me (or luna) know if stuff still times out!

@andrewrk
Copy link
Member Author

Wonderful. I'll get a new build kicked off soon after I address the macOS issue.

@andrewrk
Copy link
Member Author

I believe I have the macOS issue fixed locally but I've been waiting all day for LLVM to build. We'll find out tomorrow morning how my fix did.

@andrewrk andrewrk pinned this issue Oct 14, 2020
@andrewrk
Copy link
Member Author

The plan worked, CI has been green as of 477798b. Thanks @aveao!

@andrewrk andrewrk unpinned this issue Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior
Projects
None yet
Development

No branches or pull requests

2 participants