-
Notifications
You must be signed in to change notification settings - Fork 435
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
Deprecated rust_bindgen.leak_symbols
#2590
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dzbarsky
reviewed
Apr 1, 2024
illicitonion
approved these changes
Apr 2, 2024
fmeum
referenced
this pull request
in bazel-contrib/toolchains_llvm
Apr 2, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rules_rust](https://togithub.com/bazelbuild/rules_rust) | http_archive | patch | `0.41.0` -> `0.41.1` | --- ### Release Notes <details> <summary>bazelbuild/rules_rust (rules_rust)</summary> ### [`v0.41.1`](https://togithub.com/bazelbuild/rules_rust/releases/tag/0.41.1) [Compare Source](https://togithub.com/bazelbuild/rules_rust/compare/0.41.0...0.41.1) ### 0.41.1 ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_rust", integrity = "sha256-mUV3N2A8ORVVZbrm3O9yepAe/Kv4MD2ob9YQhB8aOI8=", urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.41.1/rules_rust-v0.41.1.tar.gz"], ) ``` Additional documentation can be found at: https://bazelbuild.github.io/rules_rust/#setup #### What's Changed - Add extra_rustc_flags_for_crate_types. by [@​granaghan](https://togithub.com/granaghan) in [https://github.com/bazelbuild/rules_rust/pull/2431](https://togithub.com/bazelbuild/rules_rust/pull/2431) - Android jobs should be using LTS Bazel releases by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2589](https://togithub.com/bazelbuild/rules_rust/pull/2589) - BUG-FIX: host-triple str for bzl mod by [@​ericmcbride](https://togithub.com/ericmcbride) in [https://github.com/bazelbuild/rules_rust/pull/2587](https://togithub.com/bazelbuild/rules_rust/pull/2587) - fix(cargo-bazel): ignore example crates when checking if proc-macro by [@​qtica](https://togithub.com/qtica) in [https://github.com/bazelbuild/rules_rust/pull/2596](https://togithub.com/bazelbuild/rules_rust/pull/2596) - Deprecated `rust_bindgen.leak_symbols` by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2590](https://togithub.com/bazelbuild/rules_rust/pull/2590) - Update test metadata for crate_universe by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2599](https://togithub.com/bazelbuild/rules_rust/pull/2599) - Fixed bug where crate_universe could match aliases to bench/example deps by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2600](https://togithub.com/bazelbuild/rules_rust/pull/2600) - Cleanup splicing utils by [@​dzbarsky](https://togithub.com/dzbarsky) in [https://github.com/bazelbuild/rules_rust/pull/2564](https://togithub.com/bazelbuild/rules_rust/pull/2564) - Updated repository rules to notify users about non-reproducible repos. by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2593](https://togithub.com/bazelbuild/rules_rust/pull/2593) - feat: Strip debug info from opt builds by [@​matte1](https://togithub.com/matte1) in [https://github.com/bazelbuild/rules_rust/pull/2513](https://togithub.com/bazelbuild/rules_rust/pull/2513) - Release 0.41.1 by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2592](https://togithub.com/bazelbuild/rules_rust/pull/2592) #### New Contributors - [@​qtica](https://togithub.com/qtica) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2596](https://togithub.com/bazelbuild/rules_rust/pull/2596) - [@​matte1](https://togithub.com/matte1) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2513](https://togithub.com/bazelbuild/rules_rust/pull/2513) **Full Changelog**: bazelbuild/rules_rust@0.41.0...0.41.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
hlopko
added a commit
to hlopko/rules_rust
that referenced
this pull request
Oct 24, 2024
This is a ~rollback of bazelbuild#2590, as it turns out the current behavior is incomatible with https://bazel.build/docs/user-manual#dynamic-mode (which is very hard to use in the OSS because of bazelbuild/bazel#4135). In short, the dynamic mode works as follows: * Each cc_library produces object files that are used to produce * a static library (often not materialized but objects get passed as `--start-lib`/`--end-lib` to the linker), * a shared library (only containing the objects, not transitive dependencies), * and an interface library (produced from .so by "stripping function bodies"). * When linking binaries, by default we use the static linking. * When linking tests, by default we use interface libraries for linking, and shared libraries for test execution. The motivation for this is to avoid lengthy linking actions when all that has changed between previous build is the method body (therefore Bazel produces the same interface library, so we don't need to reexecute linking action). We do not support dynamic mode in rules_rust yet. The current bindgen behavior works by taking object from `cc_lib`, and merging them into the `rlib` output. When dynamic_mode is on, we now have a linking action that has the rlib early on the command line, and then interface libraries of dependencies of the `cc_lib`, and then the interface library of the `cc_lib`. For reasons, lld prefers statically defined symbols, it sees that the `rlib` defines the same symbols as `cc_lib` but statically, and errors out with `backward reference detected`, even though `cc_lib` is positioned correctly. The fix for us is to not merge objects.
hlopko
added a commit
to hlopko/rules_rust
that referenced
this pull request
Nov 8, 2024
This is a ~rollback of bazelbuild#2590, as it turns out the current behavior is incomatible with https://bazel.build/docs/user-manual#dynamic-mode (which is very hard to use in the OSS because of bazelbuild/bazel#4135). In short, the dynamic mode works as follows: * Each cc_library produces object files that are used to produce * a static library (often not materialized but objects get passed as `--start-lib`/`--end-lib` to the linker), * a shared library (only containing the objects, not transitive dependencies), * and an interface library (produced from .so by "stripping function bodies"). * When linking binaries, by default we use the static linking. * When linking tests, by default we use interface libraries for linking, and shared libraries for test execution. The motivation for this is to avoid lengthy linking actions when all that has changed between previous build is the method body (therefore Bazel produces the same interface library, so we don't need to reexecute linking action). We do not support dynamic mode in rules_rust yet. The current bindgen behavior works by taking object from `cc_lib`, and merging them into the `rlib` output. When dynamic_mode is on, we now have a linking action that has the rlib early on the command line, and then interface libraries of dependencies of the `cc_lib`, and then the interface library of the `cc_lib`. For reasons, lld prefers statically defined symbols, it sees that the `rlib` defines the same symbols as `cc_lib` but statically, and errors out with `backward reference detected`, even though `cc_lib` is positioned correctly. The fix for us is to not merge objects.
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 8, 2024
This is a ~rollback of #2590, as it turns out the current behavior is incomatible with https://bazel.build/docs/user-manual#dynamic-mode (which is very hard to use in the OSS because of bazelbuild/bazel#4135). In short, the dynamic mode works as follows: * Each cc_library produces object files that are used to produce * a static library (often not materialized but objects get passed as `--start-lib`/`--end-lib` to the linker), * a shared library (only containing the objects, not transitive dependencies), * and an interface library (produced from .so by "stripping function bodies"). * When linking binaries, by default we use the static linking. * When linking tests, by default we use interface libraries for linking, and shared libraries for test execution. The motivation for this is to avoid lengthy linking actions when all that has changed between previous build is the method body (therefore Bazel produces the same interface library, so we don't need to reexecute linking action). We do not support dynamic mode in rules_rust yet. The current bindgen behavior works by taking object from `cc_lib`, and merging them into the `rlib` output. When dynamic_mode is on, we now have a linking action that has the rlib early on the command line, and then interface libraries of dependencies of the `cc_lib`, and then the interface library of the `cc_lib`. For reasons, lld prefers statically defined symbols, it sees that the `rlib` defines the same symbols as `cc_lib` but statically, and errors out with `backward reference detected`, even though `cc_lib` is positioned correctly. The fix for us is to not merge objects.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This also plumbs
target_compatible_with
andexec_compatible_with
into therust_bindgen
target fromrust_bindgen_library
to account for cases where the"manual"
tag is not sufficient in disabling the target (e.g.cquery
).