Skip to content

Commit 785683b

Browse files
committed
fix: reduce sandbox size for d_library targets
Fixes #112
1 parent a104bea commit 785683b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

d/private/rules/common.bzl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,18 @@ def compilation_action(ctx, target_type = TARGET_TYPE.LIBRARY):
157157
else:
158158
fail("Unsupported target type: %s" % target_type)
159159

160+
transitive_library_inputs = []
161+
if target_type != TARGET_TYPE.LIBRARY:
162+
transitive_library_inputs += [d.libraries for d in d_deps] + [c_libraries]
163+
inputs = depset(
164+
direct = ctx.files.srcs + ctx.files.string_srcs,
165+
transitive = [toolchain.d_compiler[DefaultInfo].default_runfiles.files] +
166+
[d.interface_srcs for d in d_deps] +
167+
transitive_library_inputs,
168+
)
169+
160170
ctx.actions.run(
161-
inputs = depset(
162-
ctx.files.srcs + ctx.files.string_srcs,
163-
transitive = [toolchain.d_compiler[DefaultInfo].default_runfiles.files] +
164-
[d.interface_srcs for d in d_deps] +
165-
[d.libraries for d in d_deps] +
166-
[c_libraries],
167-
),
171+
inputs = inputs,
168172
outputs = [output],
169173
executable = toolchain.d_compiler[DefaultInfo].files_to_run,
170174
arguments = [args],

0 commit comments

Comments
 (0)