Skip to content

Commit e7babc9

Browse files
committed
[dotnet] Make sure we can repin deps
1 parent c8d121e commit e7babc9

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

dotnet/0005-Ensure-csharp_library-files-are-unique.patch

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
diff --git a/dotnet/private/rules/common/binary.bzl b/dotnet/private/rules/common/binary.bzl
2-
index 1c48385..fc63f69 100644
2+
index 4063d24..9845f49 100644
33
--- a/dotnet/private/rules/common/binary.bzl
44
+++ b/dotnet/private/rules/common/binary.bzl
5-
@@ -98,7 +98,7 @@ def build_binary(ctx, compile_action):
5+
@@ -14,11 +14,12 @@ load(
6+
)
7+
load("//dotnet/private:providers.bzl", "DotnetBinaryInfo")
8+
9+
-def _create_shim_exe(ctx, dll):
10+
+def _create_shim_exe(ctx, tfm, dll):
11+
windows_constraint = ctx.attr._windows_constraint[platform_common.ConstraintValueInfo]
12+
13+
apphost = ctx.toolchains["@rules_dotnet//dotnet:toolchain_type"].apphost
14+
- output = ctx.actions.declare_file(paths.replace_extension(dll.basename, ".exe" if ctx.target_platform_has_constraint(windows_constraint) else ""), sibling = dll)
15+
+
16+
+ output = ctx.actions.declare_file("bazelout/%s/%s/%s" % (tfm, ctx.attr.name, paths.replace_extension(dll.basename, ".exe" if ctx.target_platform_has_constraint(windows_constraint) else "")))
17+
18+
ctx.actions.run(
19+
executable = ctx.attr.apphost_shimmer.files_to_run,
20+
@@ -88,7 +89,7 @@ def build_binary(ctx, compile_action):
21+
22+
app_host = None
23+
if ctx.attr.apphost_shimmer:
24+
- app_host = _create_shim_exe(ctx, dll)
25+
+ app_host = _create_shim_exe(ctx, tfm, dll)
26+
direct_runfiles.append(app_host)
27+
default_info_files = default_info_files.append(app_host)
28+
29+
@@ -98,7 +99,7 @@ def build_binary(ctx, compile_action):
630
depsjson = None
731
if is_core_framework(tfm):
832
# Create the runtimeconfig.json for the binary
@@ -11,7 +35,7 @@ index 1c48385..fc63f69 100644
1135
runtimeconfig_struct = generate_runtimeconfig(
1236
target_framework = tfm,
1337
project_sdk = ctx.attr.project_sdk,
14-
@@ -114,6 +114,8 @@ def build_binary(ctx, compile_action):
38+
@@ -114,6 +115,8 @@ def build_binary(ctx, compile_action):
1539
"./external",
1640
"../",
1741
"../external",
@@ -20,7 +44,7 @@ index 1c48385..fc63f69 100644
2044
# This one is for when the binary target is used as an tool in e.g. a custom rule
2145
"{}.runfiles".format(launcher.path),
2246
]
23-
@@ -122,7 +124,7 @@ def build_binary(ctx, compile_action):
47+
@@ -122,7 +125,7 @@ def build_binary(ctx, compile_action):
2448
content = json.encode_indent(runtimeconfig_struct),
2549
)
2650

0 commit comments

Comments
 (0)