1
1
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
3
3
--- a/dotnet/private/rules/common/binary.bzl
4
4
+++ 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):
6
30
depsjson = None
7
31
if is_core_framework(tfm):
8
32
# Create the runtimeconfig.json for the binary
@@ -11,7 +35,7 @@ index 1c48385..fc63f69 100644
11
35
runtimeconfig_struct = generate_runtimeconfig(
12
36
target_framework = tfm,
13
37
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):
15
39
"./external",
16
40
"../",
17
41
"../external",
@@ -20,7 +44,7 @@ index 1c48385..fc63f69 100644
20
44
# This one is for when the binary target is used as an tool in e.g. a custom rule
21
45
"{}.runfiles".format(launcher.path),
22
46
]
23
- @@ -122,7 +124 ,7 @@ def build_binary(ctx, compile_action):
47
+ @@ -122,7 +125 ,7 @@ def build_binary(ctx, compile_action):
24
48
content = json.encode_indent(runtimeconfig_struct),
25
49
)
26
50
0 commit comments