-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
bazel: 0.22.0 -> 0.24.0 #58147
bazel: 0.22.0 -> 0.24.0 #58147
Conversation
there is already #58116 |
Haha! I should have checked! I know @uri-canva ;) |
Ok, I'm going to try again. |
@marsam @Profpatsch Would that usage of TMP cause sandbox builds to fail? Locally, I get a different error to hydra. I get the following when running with When running with Hydra timing out after 600 seconds of silence, might be because the compilation takes longer than 10 minutes? I suspect that maybe hydra doesn't have the same TERM or something to see the fancy colored Bazel compilation progress. It takes at least 20-30 minutes to build. |
I've hacked the derivation a bit and it's almost working now. Failing at the
I'll continue looking at this tomorrow. In the meantime, if anybody can review my changes and suggest better ways to do it, I'm happy to modify things within reason. |
Note, my error above is with If I build with |
It might be because you move |
Good point. I'll check this. I thought that I was copying the |
Ok, this is now building successfully on my Mac with With |
Exit codes higher than 128 are usually from signals, 134-128 = 6 is |
Yes, I suspect the same thing.
|
Patched my build to output tracing. I think this is the reason why I fail to build with
|
@GrahamcOfBorg build bazel |
Darwin build is timing out. |
There's headless versions of jdk11 and jre for Linux. If we could have headless versions of jdk8 for macOS, then the build wouldn't attempt to access Cocoa and it might work. Did something change recently with how sandboxing is enforced? I think system libraries on macOS were still being access in non-pure fashion until a couple of months ago. |
I see that. What would you suggest now? This is the same as others have seen trying to get a new version of Bazel over the line. How can we get more build output? On my own Mac, I see a lot more output. Given the local sandbox failure loading Cocoa, I think it's possible that it never built successfully on Darwin with I'll keep digging, but it's looking like this might have to be changed to a linux only pkg if sandboxed Darwin builds are a blocker. |
Quick post to summarise the difference between failing sandbox builds on a Mac vs on Hydra. Mac (Tracing disabled. The underlying failure is due to a javac call reaching outside the sandbox for Cocoa libraries):
Hydra (https://logs.nix.ci/?key=nixos/nixpkgs.58147&attempt_id=2a30e2bb-eabb-41f2-8786-a53b3be2509a):
Note the missing "Building Bazel from scratch" output in Hydra. That line comes from I'm going to try enable tracing and kick off a build, but I'm unsure if the bot will listen to me. |
@GrahamcOfBorg build bazel |
Just in case you're curious, even if I patch away the line in the build where it initially sets JAVAC_VERSION to hardcode "javac 1.8" it still fails with
Apologies for all the spamming. The above indicates to me that it is not possible to compile Java applications on Darwin with If not, I think this leaves Bazel 0.23.2 on Darwin dead in the water as an official Nixpkg unless a headless jdk comes along for Darwin. |
0.24.0 was just released. @Profpatsch any ideas how we can debug this issue? It looks like the issues we get when building locally on macOS are completely different from building in hydra on macOS to be honest, I'm not sure spending time fixing what we're encountering locally is even helpful. |
I can close this one if people wish to try 0.24.0. I've just attempted it and it's failing to compile for me on OSX, so I don't think it's ready just yet.
I agree that the Hydra Darwin builds outputting no logs could be a different issue / PR though. That assumes it's a general issue with Hydra and Darwin and not something specific to building Bazel. |
Status update. Building successfully on Darwin with these settings in
Failing on linux. Investigating now, but it looks like a standard issue. |
@mboes This is true somewhat, but if you look at the game of whack-a-mole I've been playing in this thread, it's not so straightforward. Ofborg has been running with sandboxing enabled, so Darwin builds have been "timing out" (actually SIGABRT sandbox errors). This resulted in us chasing our tails and making changes to the already working derivation of 0.22. It might be that some of these changes I've made to make Darwin sandbox happy, are causing it to fail on linux. The early builds of this derivation were passing on linux and "timed out" on Darwin. Now it is working on Darwin and failing on Linux. 👍 Anyway, it's probably just a matter of downloading additional files or rolling back some of my changes that made Darwin sandbox happy. I'll take a look today. |
f1e5086
to
75d2384
Compare
f0f9222
to
d019fd8
Compare
One thing I thought of in the meantime: skipping |
I reopened #58116 in case we want to go ahead and merge that first. |
Having a Hydra build of I'm currently testing linux sandboxed builds of this PR, but I think it's also ready now. |
This is now building and ready for review @Profpatsch @mboes Got there in the end! Please see @uri-canva comment about thoughts of doing See below table for how I've tested this derivation on local Darwin and Linux. I'm confident that it will work on Hydra now. Linux should work on Ofborg and Hydra. Darwin might fail on Ofborg, but should succeed on Hydra given the testing that I've done.
|
@GrahamcOfBorg build bazel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from the darwin side. Thanks for fixing the sandbox issues and sorry for the confusion.
}; | ||
|
||
# Necessary for the tests to pass on Darwin with sandbox enabled. | ||
# Bazel starts a local server and needs to bind a local address. | ||
__darwinAllowLocalNetworking = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is inherent with bazel, is this a random or fixed port? If it's static hydra and local builds will have problems if multiple bazel builds are running at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is inherent to Bazel. It uses a daemon for faster builds. There used to be a --batch
option, but it is being removed: https://docs.bazel.build/versions/master/command-line-reference.html#flag--batch
The code that I looked at seems to allow the kernel to choose a random port.
@Profpatsch As far as I'm concerned we can merge.
|
@Profpatsch Any feedback? There is typically a new Bazel release every 2-4
weeks, so maybe we should land this one after all. If somebody needs an
older version, they can call a custom derivation. Anybody using Bazel has
to stay up to date with new versions anyway.
…On Sun, 31 Mar 2019 at 23:26, Mathieu Boespflug ***@***.***> wrote:
@Profpatsch As far as I'm concerned we can merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#58147 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAU9d0uoR4vSn6NiVSrYri-lz5cAcdcYks5vcKmPgaJpZM4cEZQ6>
.
|
Yep, we should merge even if we skip 0.23, the releases are too fast for the manpower we have here. Thanks for the great change! |
Should this be backported to 19.03 as well? |
I'd like this too, but it's a bit late in the game for 19.03 I think. They've been working really hard to get it out the door. I don't know what the policy is for late inclusions. I guess with Nix it should be safe, but 🤷♂️ |
Nah, it’s a major, incompatible update, so we shouldn’t backport it. |
Per NixOS#58147 (comment) sandboxing is not fully functional on macOS. .github: specify where sandboxing can be run Co-Authored-By: Jon <[email protected]> .github: remove macOS note
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)