Skip to content

Add a FreeBSD platform, and make setup-freebsd.sh work again - #2836

Open
zakinko wants to merge 1 commit into
bazelbuild:masterfrom
zakinko:freebsd-platform
Open

Add a FreeBSD platform, and make setup-freebsd.sh work again#2836
zakinko wants to merge 1 commit into
bazelbuild:masterfrom
zakinko:freebsd-platform

Conversation

@zakinko

@zakinko zakinko commented Sep 1, 2026

Copy link
Copy Markdown

buildkite/setup-freebsd.sh has been here since 2017 and no platform refers
to it. bazelci.py has 31 platforms and none is a BSD, so nothing has run it
in that time and it no longer does what it was written to do.

It installs bazel, git, wget and zip. Building Bazel from source also needs
bash and unzip, which are not in the base system, a JDK, and python3. The
JDK's package does not put itself on the path, and the bootstrap reads
JAVA_HOME rather than searching, so it stops saying only "bash failed" or
that it cannot find java. With the changes here it takes a stock FreeBSD 14.3
to a completed bootstrap; I checked that on a clean machine with nothing else
installed.

The platform entry has the shape the other machine-backed platforms have:
macOS and Windows are queues rather than docker images. It publishes no
binary.

Please add a FreeBSD agent to the freebsd queue. Bazel has been broken on
FreeBSD and nothing here would have noticed. Building 9.2.0 from source stops
at 336 of 5,576 actions, on two defects that are each one line: the BSD C++
toolchain passes -lc++ but not -lm, so every binary using a hash
container fails to link on ceilf (bazelbuild/rules_cc#862), and
generate_jvm_module_options.sh names /bin/bash in its shebang, which the
BSDs do not have. The second one is already fixed on master - and that is the
point. It broke, shipped in a release, and was fixed, and none of those three
events was visible here. A platform nobody builds is a platform that quietly
stops working.

I already build all four BSDs from source on a fork, on GitHub's hosted
runners through vmactions, at no cost for a public repository - FreeBSD in
30m14s, NetBSD in 38m58s, DragonFly in 39m29s, OpenBSD in 48m35s, each of
them then running a genrule with the binary it produced, so the check covers
the server coming up and not just --version answering.

That does not help this project. It does not gate anything here; it only
tells me afterwards that something landed broken, which is where we are
today. If an agent in the fleet is not practical, I would rather send that
workflow as a change to this repository than keep it on a fork, so that a
break shows up on the pull request that causes it. Either way it needs to run
here.

setup-freebsd.sh has been here since 2017 and no platform refers to it.
bazelci.py has 31 platforms and none is a BSD, so nothing has run it in
that time and it no longer does what it was written to do.

It installs bazel, git, wget and zip.  Building Bazel from source also
needs bash and unzip, which are not in the base system, a JDK, and
python3.  The JDK's package does not put itself on the path, and the
bootstrap reads JAVA_HOME rather than searching, so it stops saying only
"bash failed" or that it cannot find java.  With the changes here it
takes a stock FreeBSD 14.3 to a completed bootstrap.

The platform entry has the shape the other machine-backed platforms
have: macOS and Windows are queues rather than docker images.  It
publishes no binary.
@meteorcloudy

Copy link
Copy Markdown
Member

Sorry, we probably don't have capacity to add this support in near future.

@zakinko

zakinko commented Sep 6, 2026

Copy link
Copy Markdown
Author

Understood, no problem. One thing worth separating, though: most of this is
not a new platform. setup-freebsd.sh as it stands installs bazel, git,
wget and zip and nothing else, so a machine it sets up cannot build Bazel —
no bash, no unzip, no JDK, no python3 — and it never sets JAVA_HOME. That
half is a fix to a file already in the repository and costs no capacity.

I am happy to drop the platform entry and leave only the script fix, if that
is easier to take, or to close this.

@meteorcloudy

Copy link
Copy Markdown
Member

I'm fine with merging the script update if it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants