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

Port Bazel to OpenBSD [duplicate of #9397] #10250

Closed
aldersondrive opened this issue Nov 15, 2019 · 4 comments
Closed

Port Bazel to OpenBSD [duplicate of #9397] #10250

aldersondrive opened this issue Nov 15, 2019 · 4 comments
Assignees
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request

Comments

@aldersondrive
Copy link
Contributor

Currently, building Bazel on OpenBSD fails. I have been working on porting it. The current status is that I can build a Bazel binary that appears to work.

Here's an issue to track related PRs. Feel free to assign it to me if you like.

bazel-io pushed a commit that referenced this issue Nov 18, 2019
The motivation for this change is to pick up commit bazelbuild/platforms@46993ef, for the OpenBSD port in #10250.

Closes #10251.

PiperOrigin-RevId: 281078178
@dslomov dslomov added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged labels Nov 25, 2019
@laszlocsomor laszlocsomor added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Nov 29, 2019
@laszlocsomor laszlocsomor changed the title Port Bazel to OpenBSD Port Bazel to OpenBSD [duplicate of #9397] Nov 29, 2019
bazel-io pushed a commit that referenced this issue Dec 6, 2019
This change, split out of the larger PR #10274, is part of the OpenBSD port in #10250.

Closes #10316.

PiperOrigin-RevId: 284198941
bazel-io pushed a commit that referenced this issue Dec 17, 2019
This change, split out of the larger PR #10274, is part of the OpenBSD port in #10250.

Closes #10386.

PiperOrigin-RevId: 285973120
bazel-io pushed a commit that referenced this issue Jan 10, 2020
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
bazel-io pushed a commit that referenced this issue Jan 21, 2020
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
bazel-io pushed a commit that referenced this issue Feb 4, 2020
Searching the `PATH` is the only feasible way to find the executable on OpenBSD when `argv[0]` is not an absolute path or a relative path. This change resolves a TODO.

This change moves a preexisting `Which` function for searching the `PATH` out of `blaze_util_linux.cc` and into `blaze_util_posix.cc`, so that the Linux code and the BSD code can share this function.

In my testing on OpenBSD 6.6-current, a bootstrap build of Bazel succeeds and the resulting `bazel` binary can find itself on the `PATH`. (One caveat: For the bootstrap build to succeed, I had to manually apply the unrelated change in #10639, since it's not merged yet.)

This change is part of the OpenBSD port in #10250.

@jmmv FYI.

Closes #10691.

PiperOrigin-RevId: 293183553
bazel-io pushed a commit that referenced this issue Feb 5, 2020
As discussed at #10432 (comment), Bazel is already switching to assume that the Python binary is called `python3`, not `python`.

This change is also useful for the OpenBSD port in #10250. (On OpenBSD, the python executable is called `python3`, and no `python` binary exists.)

Closes #10432.

PiperOrigin-RevId: 293351316
@aldersondrive
Copy link
Contributor Author

For anyone following along:

  • Other relevant commits include ba6be8a and ebf6a46.

  • A bootstrap build of Bazel on OpenBSD now succeeds and yields a bazel binary that works. One caveat is that the bootstrap build requires python to be on the PATH; it can just be a symlink to /usr/local/bin/python3.

@aldersondrive
Copy link
Contributor Author

FYI, the build is now packaged as an OpenBSD port (although currently the port is not merged into OpenBSD's ports tree).

luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
    As discussed at bazelbuild/bazel#10432 (comment), Bazel is already switching to assume that the Python binary is called `python3`, not `python`.

    This change is also useful for the OpenBSD port in bazelbuild/bazel#10250. (On OpenBSD, the python executable is called `python3`, and no `python` binary exists.)

    Closes #10432.

    PiperOrigin-RevId: 293351316
@aldersondrive
Copy link
Contributor Author

FYI, the port is now updated to Bazel 6.0.0-pre.20220922.1.

@aldersondrive
Copy link
Contributor Author

The port is now updated to Bazel 6.0.0, and available at https://github.com/aldersondrive/bazel_openbsd_port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants