Skip to content

Update example subdirectory to be a local repository#25

Merged
katre merged 7 commits into
bazelbuild:masterfrom
katre:example-repository
Dec 15, 2016
Merged

Update example subdirectory to be a local repository#25
katre merged 7 commits into
bazelbuild:masterfrom
katre:example-repository

Conversation

@katre

@katre katre commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

This makes the examples slightly clearer by using a syntax that is closer to how end-users will use the rust rules, and helps to ensure that example rules can't be accidentally used from the main rust rules.

@katre

katre commented Nov 29, 2016

Copy link
Copy Markdown
Contributor Author

The latest changes to the test/ package won't work properly until https://bazel-review.googlesource.com/c/7571/ is merged and released.

@katre

katre commented Dec 7, 2016

Copy link
Copy Markdown
Contributor Author

I've added a fork of test_rules.bzl so that tests pass, we can remove it when released Bazel includes bazelbuild/bazel@b89f30e

@davidzchen

Copy link
Copy Markdown
Member

Sounds good. Thanks, @katre. Is this ready for review now?

@katre

katre commented Dec 14, 2016

Copy link
Copy Markdown
Contributor Author

Yes, with the fork of test_rules.bzl this is ready for review.

When the fixed test_rules.bzl is released (next month, I guess?) I'll send another PR to remove it.

@davidzchen

Copy link
Copy Markdown
Member

LGTM. Thanks!

@katre katre merged commit f5846e9 into bazelbuild:master Dec 15, 2016
@katre katre deleted the example-repository branch December 15, 2016 14:56
walter-zeromatter added a commit to walter-zeromatter/rules_rust that referenced this pull request Jun 11, 2026
bazelbuild#25)

rust_shared_library links the cc toolchain's C++ runtime
(libstdc++/libc++ and the unwinder) dynamically, so it becomes an
external DT_NEEDED on the produced shared library. When shipping a
self-contained .so to a consumer that uses a different C++ stdlib,
that dynamic dependency is undesirable.

Add a `cc_runtime_linkage` attribute on rust_shared_library
(dynamic|static, default dynamic so existing behavior is unchanged).
When static, the C++ runtime is linked via
cc_toolchain.static_runtime_lib so it is embedded in the shared
library and no libstdc++/libc++/libunwind DT_NEEDED is emitted.

get_cc_toolchain_runtime_libs gains a `linkage` parameter resolved
from the attribute. Non-shared crate types are unchanged.
walter-zeromatter added a commit to ZeromatterOSS/rules_rust that referenced this pull request Jun 24, 2026
bazelbuild#25)

rust_shared_library links the cc toolchain's C++ runtime
(libstdc++/libc++ and the unwinder) dynamically, so it becomes an
external DT_NEEDED on the produced shared library. When shipping a
self-contained .so to a consumer that uses a different C++ stdlib,
that dynamic dependency is undesirable.

Add a `cc_runtime_linkage` attribute on rust_shared_library
(dynamic|static, default dynamic so existing behavior is unchanged).
When static, the C++ runtime is linked via
cc_toolchain.static_runtime_lib so it is embedded in the shared
library and no libstdc++/libc++/libunwind DT_NEEDED is emitted.

get_cc_toolchain_runtime_libs gains a `linkage` parameter resolved
from the attribute. Non-shared crate types are unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants