-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Sandboxed execution breaks Kythe build #397
Comments
Can you add more details? |
Can you give me instructions how to reproduce the build failure and the error message? |
Building Kythe instructions: http://www.kythe.io/contributing#building-source-code Remove the
Example error messages:
|
I'm trying to reproduce this, but that tools/modules/update.sh script that I'm supposed to run before "bazel build //..." is building a lot of .cpp files with llvm since over an hour already :| On a 4-CPU 16GB SSD GCE instance... |
That script never finished, but it turned out that the bazel build parts work fine without it. :) These are all errors caused by different reasons:
In your tools/build_rules/kythe.bzl, you shouldn't hardcode the path to external/local-jdk/bin/javac, but instead resolve that via javac's label. Also javac + the JDK is missing from the action inputs, which is why you get the "file not found" error for javac when running in the sandbox. Same for "jar", which would fail right after javac, as it's also not included in the inputs. Check our experimental Java Skylark rules for ideas how to do this: My commit here basically fixed the same issues in our own rules, I think you can just adapt it (the parts that affect the .bzl file):
|
In the tools attribute. |
I've been fixing some of the build issues. Along the way, I ran into the symlink issue, and I also ran into the following error:
Any hack around this kind of issue? Can this limit be increased? |
Also, |
Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102343972
*** Reason for rollback *** Totally broke Bazel tests (100% failures!). Found by git bisect after running the update script. *** Original change description *** sandbox: We have to move all generated outputs, not just regular files. Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102354724
FYI, I filed #424 about the |
Yes, I'll implement our standard Bazel hack for this, which is to write the arguments into a file and then pass the name of that file prefixed with "@" to the namespace-runner. |
Fix for a part of bug #397. -- MOS_MIGRATED_REVID=102564902
@schroederc Can you check whether this commit already helped a bit regarding the "Argument list too long" issue? It should cut the amount of command-line parameters passed to the sandbox runner in half on average (because the mount target is now inferred from the source path, unless a custom target path is necessary - this should only be the case for runfiles and never for inputs). |
Just tried the three test cases from above again and //third_party/go:protobuf and //tools/modules:check_modules work fine for me now. bazel test //kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg:names_tests fails with: philwo@philwo-bazel-debian81:~/kythe$ bazel test //kythe/javatests/com/google/devtools/kythe/analyzers/java/testdata/pkg:names_tests The missing package that it can't find seems to be in: I think this is because in tools/build_rules/go.bzl you construct the path to the include: but that "dep.go_archive.path + '_gopath'" directory is not in the inputs of the action. Indeed, you can see via --sandbox_debug that the archive itself is being mounted, but not the _gopath directory: src/main/tools/namespace-sandbox.c:393: mount: /home/philwo/.cache/bazel/_bazel_philwo/0a87a7957485c05598ee2035800ac806/kythe/bazel-out/local_linux-fastbuild/bin/third_party/go/protobuf.a The _gopath directory comes from the symlink created in the "if setupGOPATH" part in line 78 and 114. I think you can just add it to the outputs of the go_library definition and then pass it to the inputs of the action that depend on it in the go_compile method. Maybe this helps in fixing the issue? Is there anything else remaining? |
seems that this is not a bazel issue, so I'll close. |
As per e0ac088, here's a bug filed about Kythe's build breaking due to the --spawn_strategy and --genrule_strategy default value changes.
The text was updated successfully, but these errors were encountered: