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

Introduce rules_rust_unsupported_feature #2511

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

tpudlik
Copy link
Contributor

@tpudlik tpudlik commented Feb 22, 2024

Add a special sentinel feature name to the UNSUPPORTED_FEATURES list. This feature name can be used by authors of C++ toolchain configurations to house any configuration fragments (e.g., linker flags) that should NOT be applied when linking Rust targets.

The specific motivation for this is that I'm working on a project that includes -fsanitize=address in its clang configuration. This needs to be disabled when linking Rust.

I tried the more straightforward approach of adding the features attribute to rust_binary targets in my repo, but this is not sufficient: a rust_binary has implicit deps on targets like @rules_rust//util/process_wrapper:bootstrap_process_wrapper.

Add a special sentinel feature name to the UNSUPPORTED_FEATURES list.
This feature name can be used by authors of C++ toolchain configurations
to house any configuration fragments (e.g., linker flags) that should
NOT be applied when linking Rust targets.

The specific motivation for this is that I'm working on a project that
includes `-fsanitize=address` in its clang configuration. This needs to
be disabled when linking Rust.

I tried the more straightforward approach of adding the `features`
attribute to `rust_binary` targets in my repo, but this is not
sufficient: a `rust_binary` has implicit deps on targets like
@rules_rust//util/process_wrapper:bootstrap_process_wrapper.
Copy link
Collaborator

@scentini scentini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@scentini scentini added this pull request to the merge queue Feb 23, 2024
Merged via the queue into bazelbuild:main with commit 0e0241e Feb 23, 2024
3 checks passed
qtica added a commit to qtica/rules_rust that referenced this pull request Apr 1, 2024
Add a special sentinel feature name to the UNSUPPORTED_FEATURES list.
This feature name can be used by authors of C++ toolchain configurations
to house any configuration fragments (e.g., linker flags) that should
NOT be applied when linking Rust targets.

The specific motivation for this is that I'm working on a project that
includes `-fsanitize=address` in its clang configuration. This needs to
be disabled when linking Rust.

I tried the more straightforward approach of adding the `features`
attribute to `rust_binary` targets in my repo, but this is not
sufficient: a `rust_binary` has implicit deps on targets like
@rules_rust//util/process_wrapper:bootstrap_process_wrapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants