-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: add freebsd support #57039
bazel: add freebsd support #57039
Conversation
Fixes cockroachdb#56013. We're picking up bazel-contrib/rules_foreign_cc/pull/387 (included in our new fork at cockroachdb/rules_foreign_cc). We've also picked up Oliver's PR adding autoconf support (bazel-contrib/rules_foreign_cc/pull/432); we were pointing to Oliver's own fork previously to pick up those changes. Release note: None
5904712
to
ed964c0
Compare
i think bazel-contrib/rules_foreign_cc#387 needs to pick up changes from bazel-contrib/rules_foreign_cc#377. looks like a straightforward delete of unsupported linux flags in bsd, if you were looking for copy paste. |
This is the diff I have after cherry-picking those SHAs (I think bazel-contrib/rules_foreign_cc#387 was already rebased atop bazel-contrib/rules_foreign_cc#377).
$ git diff HEAD:./bsd_commands.bzl ./linux_commands.bzl
diff --git o/tools/build_defs/shell_toolchain/toolchains/impl/bsd_commands.bzl w/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl
index 99b73f7..4fdceb8 100644
--- o/tools/build_defs/shell_toolchain/toolchains/impl/bsd_commands.bzl
+++ w/tools/build_defs/shell_toolchain/toolchains/impl/linux_commands.bzl
@@ -3,7 +3,7 @@ load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_an
_REPLACE_VALUE = "\\${EXT_BUILD_DEPS}"
def os_name():
- return "bsd"
+ return "linux"
def pwd():
return "$(pwd)"
@@ -61,7 +61,7 @@ fi
)
def copy_dir_contents_to_dir(source, target):
- return """gcp -L -r --no-target-directory "{}" "{}" """.format(source, target)
+ return """cp -L -r --no-target-directory "{}" "{}" """.format(source, target)
def symlink_contents_to_dir(source, target):
text = """local target="$2"
@@ -84,9 +84,9 @@ def symlink_to_dir(source, target):
text = """local target="$2"
mkdir -p "$target"
if [[ -f "$1" ]]; then
- gln -s -t "$target" "$1"
+ ln -s -f -t "$target" "$1"
elif [[ -L "$1" ]]; then
- gcp $1 $2
+ cp $1 $2
elif [[ -d "$1" ]]; then
local children=$(find -H "$1" -maxdepth 1 -mindepth 1)
local dirname=$(basename "$1") Where it's reaching for the gnu coreutils ls/cp instead. Are these typically installed on freebsd machines? Too cumbersome to ask as a pre-req? |
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.
ah makes sense. in that case, LGTM
feel free to merge and ask @knz to check when he's up the next morning :)
Cause we still haven't really pinned toolchains, it'll still probably not work for Rafa (though we're one step closer). Just tried it on my gceworker and I think it's not using the right compilers. References for myself for later: |
The problem here is that BSD If I go and manually change the strings in (Ideally these rules would default to Finally after make goes forward, I get a different link error
This is because this link is missing a (This problem does not exist when I run So I went forward and manually edited Now my I can't find my executable!? It's not in the top directory, and it's also not in There are 3 issues here:
|
yeah the idea is that you run |
do you mind sending a PR for this change? I think we want a copy of that linux line for freebsd/dragonfly/netbsd. |
yikes. we'd have to change all the
or something of the ilk. |
But like Oliver said, the wrapper will place it in the top-level dir. Will be happy to take over any WIP PR/branch you have with the changes you needed. I'll merge this one for now. bors r+ |
I assume the thing uses |
Build succeeded: |
Fixes #56013. We're picking up bazel-contrib/rules_foreign_cc/pull/387
(included in our new fork at cockroachdb/rules_foreign_cc). We've also
picked up Oliver's PR adding autoconf support
(bazel-contrib/rules_foreign_cc/pull/432); we were pointing to Oliver's own
fork previously to pick up those changes.
Release note: None
@knz, wanna try this branch out and see if it works? If not, I should probably spin up a freebsd AMI next once someone shows me how.