-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow a bootstrap build of Bazel on OpenBSD to succeed. #10274
Conversation
Tested on OpenBSD 6.6-current (amd64 architecture), as follows: # Create a 'dist' tarball. Here, `bbazel` is a binary left over from the # porting work leading up to this patch. cd ~/git/aldersondrive_bazel /home/me/bin/bbazel build --host_javabase=@local_jdk//:jdk :bazel-distfile # Perform a bootstrap build based on the tarball. rm -rf ~/test_bootstrap mkdir ~/test_bootstrap cd ~/test_bootstrap unzip ~/git/aldersondrive_bazel/bazel-bin/bazel-distfile.zip EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" JAVA_HOME="/usr/local/jdk-1.8.0" BAZEL_JAVAC_OPTS="-J-Xmx2g -J-Xms200m" bash ./compile.sh The resulting Bazel binary appeared to work in some simple testing involving cc_library, cc_binary, java_library, and java_binary. Known issues/limitations: - For the above to work, I had to add `python` to my PATH. (On OpenBSD, the Python binary is called `python3`.) ln -s /usr/local/bin/python3 ~/bin/python - Buliding a java_binary's deploy JAR fails because the `singlejar` tool fails to build. I intend to look into this issue next. In file included from external/remote_java_tools_linux/java_tools/src/tools/singlejar/input_jar.cc:15: In file included from bazel-out/host/bin/external/remote_java_tools_linux/_virtual_includes/input_jar/src/tools/singlejar/input_jar.h:27: bazel-out/host/bin/external/remote_java_tools_linux/_virtual_includes/diag/src/tools/singlejar/diag.h:54:2: error: Unknown platform #error Unknown platform ^ - Running Bazel requires a `--host_javabase=@local_jdk//:jdk` flag. - Sandboxing is unsupported.
…ion. The reference to `//src/conditions:openbsd` was invalid, and caused breakage: ``` ERROR: Analysis of target '//java/main:JavaBinary' failed; build aborted: no such package 'src/conditions': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. ```
I've fixed the breakage; the tests pass now. PTAL. (In case you're wondering: I can't run the tests on OpenBSD because the |
This is a pretty big change. I wonder if it could be broken up. Most of the changes are trivial, but we may need to look more carefully at the added C++ code. |
I would be okay with dividing up this PR, but I don't understand the interdependencies well enough to be confident of a good way to do so. Are you able to suggest one? Regarding the added C++ code, it's mostly copy/pasted from the equivalent FreeBSD code, which is already in the repo. Thus, there's actually a lot less C++ code changing here than the Github interface suggests. |
Oh this is indeed too big for a PR. I'd split changes touching the client into one PR, one PR for the C++ toolchain configuration, one PR for the python semantics change, and maybe the rest. Do you have a CI testing story figured out already? @philwo is your point of contact for that. |
I'll actually unassign folks from this PR and will wait for the smaller PRs. Thank you! |
I've just filed bazelbuild/continuous-integration#876. (Earlier we briefly discussed FreeBSD CI also. There's already bazelbuild/continuous-integration#258 about that.) Smaller PRs are on the way. Thanks! |
In my limited testing, these changes appear to work. When I built Bazel on OpenBSD incorporating these changes, the resulting `bazel` binary could build C++ libraries and binaries. Likewise on FreeBSD. This change, split out of the larger PR #10274, is part of the OpenBSD port in #10250. Closes #10436. PiperOrigin-RevId: 289091510
I have tested these changes via a bootstrap build on OpenBSD 6.6-current (amd64 architecture). The resulting `bazel` binary appeared to work in some simple testing involving `cc_library`, `cc_binary`, `java_library`, and `java_binary`. Known issues/limitations: - Building a `java_binary`'s deploy JAR fails because the `singlejar` tool fails to build. I intend to investigate soon. - Running Bazel requires a `--host_javabase=@local_jdk//:jdk` flag. - Sandboxing is unsupported. This change, split out of the larger PR #10274, is part of the OpenBSD port in #10250. Most of the changes in that larger PR have already been committed via several smaller PRs (see the PRs linked from #10250). This PR collects the remaining changes. Closes #10567. PiperOrigin-RevId: 290745757
Tested on OpenBSD 6.6-current (amd64 architecture), as follows:
The resulting Bazel binary appeared to work in some simple testing involving cc_library, cc_binary, java_library, and java_binary.
Known issues/limitations:
python
to my PATH. (On OpenBSD, the Python binary is calledpython3
.)singlejar
tool fails to build. I intend to look into this issue next.Running Bazel requires a
--host_javabase=@local_jdk//:jdk
flag.Sandboxing is unsupported.
This change is part of the OpenBSD port in #10250.