Skip to content

Commit ab8b440

Browse files
committed
no flavors?
1 parent b28e8ce commit ab8b440

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

rust/private/rustc.bzl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,20 +1984,8 @@ def _portable_link_flags(lib, use_pic, get_lib_name, for_windows = False, for_da
19841984
):
19851985
return [] if for_darwin else ["-Clink-arg=%s" % artifact.path]
19861986

1987-
if for_windows:
1988-
if flavor_msvc:
1989-
return [
1990-
"-lstatic=%s" % get_lib_name(artifact),
1991-
"-Clink-arg={}".format(artifact.basename),
1992-
]
1993-
else:
1994-
return [
1995-
"-Clink-arg=%s" % artifact.path,
1996-
]
1997-
else:
1998-
return [
1999-
"-Clink-arg=%s" % artifact.path,
2000-
]
1987+
return ["-Clink-arg=%s" % artifact.path]
1988+
20011989
elif _is_dylib(lib):
20021990
return [
20031991
"-Clink-arg=%s" % artifact.path,

test/unit/ambiguous_libs/ambiguous_libs_test.bzl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ def _ambiguous_deps_test_impl(ctx):
2626
# in the form of "-Clink-arg=${pwd}/bazel-out/darwin_arm64-fastbuild/bin/test/unit/ambiguous_libs/first_dep/libnative_dep.a"
2727
for arg in rustc_action.argv:
2828
print("_ambiguous_deps_test_impl", arg)
29-
link_args = [arg for arg in rustc_action.argv if arg.endswith("libnative_dep{}.a".format(pic_suffix))]
29+
30+
if ctx.target_platform_has_constraint(
31+
ctx.attr._windows_constraint[platform_common.ConstraintValueInfo],
32+
):
33+
lib_name = "native_dep{}.lib".format(pic_suffix)
34+
else:
35+
lib_name = "libnative_dep{}.a".format(pic_suffix)
36+
37+
link_args = [arg for arg in rustc_action.argv if arg.endswith(lib_name)]
3038
asserts.equals(env, 2, len(link_args))
3139
asserts.false(env, link_args[0] == link_args[1])
3240

0 commit comments

Comments
 (0)