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

rust_protobuf_library up to custom_rule #28

Closed
wants to merge 21 commits into from
Closed

Conversation

aherrmann
Copy link
Contributor

This defines an open source version of rust_protobuf_library rule up to the point where it requires custom_rule.
The code has been tested on Linux to build buck2_data with a genrule based replacement of custom_rule that is commented out in this PR.

Protoc and the protobuf standard library is fetched in a user defined rule from the protobuf release on Github.

This PR also unifies the required rule shims in shim/shims.bzl and defines re-exports to expose them under the appropriate labels.
Relatedly it defines extra utilities to replace internal labels in deps, os_deps, and build_env attributes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 19, 2022
shim/shims.bzl Outdated Show resolved Hide resolved
shim/third-party/proto/update.py Show resolved Hide resolved
shim/third-party/proto/releases.bzl Outdated Show resolved Hide resolved
The OUT_DIR variable depends on the value of $OUT so it cannot be set
through the env attribute but needs to be evaluated by the shell.
@facebook-github-bot
Copy link
Contributor

@ndmitchell has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@aherrmann aherrmann mentioned this pull request Oct 20, 2022
facebook-github-bot pushed a commit that referenced this pull request Oct 25, 2022
Summary:
Depends on #28.
Do not merge before #28.
This uses #28 as its base branch.

With this PR I can build cli:buck2 successfully on Ubuntu 22.04. I have tested the following commands successfully with the resulting binary:
```
buck2 --help
buck2 uquery cli:buck2
```

This addes
* A few missing cargo dependencies for buck2.
* Defines a cfg `buck_oss_build` to designate an open source build with buck2 itself.
* Uses the above cfg to disable jemalloc. The corresponding Rust crate depends on jemalloc-sys, which includes a `build.rs` that runs an autotools build for jemalloc, which does not translate straightforwardly to a `cxx_library`.
* Adds a fixup to build the `zstd-sys` C library.
* Fixes the linking order with the vendored openssl library.
* Adds `-lc` to the vendored `libcrypto`, which requires the `atexit` symbol from libc.

Pull Request resolved: #31

Reviewed By: stepancheg

Differential Revision: D40634228

Pulled By: ndmitchell

fbshipit-source-id: 62bddd380b295f313af3ed975ff82bc13e84e5e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants