Skip to content

Commit

Permalink
prelude: Correctly set linker_type for prebuilt Rust libraries
Browse files Browse the repository at this point in the history
Summary: ^

Reviewed By: capickett

Differential Revision: D51771164

fbshipit-source-id: d65a70916b236e6532fe76f8af08a582ec37ae16
  • Loading branch information
JakobDegen authored and facebook-github-bot committed Dec 1, 2023
1 parent c21703e commit a14f211
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions prelude/rust/rust_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ def prebuilt_rust_library_impl(ctx: AnalysisContext) -> list[Provider]:
),
)

linker_info = get_cxx_toolchain_info(ctx).linker_info

# Native link provier.
link = LinkInfos(
default = LinkInfo(
linkables = [
ArchiveLinkable(
archive = Archive(artifact = ctx.attrs.rlib),
linker_type = "unknown",
linker_type = linker_info.type,
),
],
),
Expand All @@ -183,7 +185,7 @@ def prebuilt_rust_library_impl(ctx: AnalysisContext) -> list[Provider]:
obj = ctx.attrs.rlib,
),
),
linker_type = "unknown",
linker_type = linker_info.type,
),
],
),
Expand All @@ -201,7 +203,6 @@ def prebuilt_rust_library_impl(ctx: AnalysisContext) -> list[Provider]:
)

# Native link graph setup.
linker_info = get_cxx_toolchain_info(ctx).linker_info
linkable_graph = create_linkable_graph(
ctx,
node = create_linkable_graph_node(
Expand Down

0 comments on commit a14f211

Please sign in to comment.