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

Add C++ toolchain configuration for OpenBSD. #10436

Closed
wants to merge 5 commits into from
Closed

Add C++ toolchain configuration for OpenBSD. #10436

wants to merge 5 commits into from

Conversation

aldersondrive
Copy link
Contributor

@aldersondrive aldersondrive commented Dec 18, 2019

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.

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.

I am unfamiliar with these files. This PR basically mimics what was done previously for FreeBSD.

`openbsd_cc_toolchain_config.bzl` was created as follows:

```
cp freebsd_cc_toolchain_config.bzl openbsd_cc_toolchain_config.bzl
sed -i -e 's/freebsd/openbsd/g' openbsd_cc_toolchain_config.bzl
sed -i -e 's#/bin/false#/usr/bin/false#g' openbsd_cc_toolchain_config.bzl
sed -i -e 's#/usr/bin/dwp#/usr/bin/false#g' openbsd_cc_toolchain_config.bzl
```

`BUILD.static.openbsd` was created as follows:

```
cp BUILD.static.freebsd BUILD.static.openbsd
sed -i -e 's/Copyright 2018/Copyright 2019/' BUILD.static.openbsd
sed -i -e 's/FreeBSD/OpenBSD/g' BUILD.static.openbsd
sed -i -e 's/freebsd/openbsd/g' BUILD.static.openbsd
```
@jin jin added team-Rules-Server Issues for serverside rules included with Bazel team-Rules-CPP Issues for C++ rules and removed team-Rules-Server Issues for serverside rules included with Bazel labels Dec 20, 2019
@jin
Copy link
Member

jin commented Dec 26, 2019

cc @jmmv, who may know something about BSD here :)

@jmmv
Copy link
Contributor

jmmv commented Dec 26, 2019

I believe this works based on the description and what I see in the diff.

If the new OpenBSD-specific file was generated with a simple copy+find/replace, and given that both the old and new file are Starlark... could we generalize them instead? Similar to what we did with a single file for all BSDs in the C++ client code.

@aldersondrive
Copy link
Contributor Author

aldersondrive commented Jan 4, 2020

If the new OpenBSD-specific file was generated with a simple copy+find/replace, and given that both the old and new file are Starlark... could we generalize them instead? Similar to what we did with a single file for all BSDs in the C++ client code.

Done. PTAL.

tools/cpp/bsd_cc_toolchain_config.bzl Outdated Show resolved Hide resolved
tools/cpp/cc_toolchain_config.bzl Outdated Show resolved Hide resolved
@bazel-io bazel-io closed this in 644b7d4 Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants