Skip to content

Commit cd24f39

Browse files
Googlercopybara-github
Googler
authored andcommitted
Add paramfile support for def_parser, since in rare cases on Windows command line character limit was reached.
PiperOrigin-RevId: 427962422
1 parent 0a2b455 commit cd24f39

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/starlark/builtins_bzl/common/cc/cc_helper.bzl

+6-3
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,19 @@ def _should_generate_def_file(ctx, feature_configuration):
173173

174174
def _generate_def_file(ctx, def_parser, object_files, dll_name):
175175
def_file = ctx.actions.declare_file(ctx.label.name + ".gen.def")
176+
args = ctx.actions.args()
177+
args.add(def_file)
178+
args.add(dll_name)
176179
argv = ctx.actions.args()
177-
argv.add(def_file)
178-
argv.add(dll_name)
180+
argv.use_param_file("@%s", use_always = True)
181+
argv.set_param_file_format("shell")
179182
for object_file in object_files:
180183
argv.add(object_file.path)
181184

182185
ctx.actions.run(
183186
mnemonic = "DefParser",
184187
executable = def_parser,
185-
arguments = [argv],
188+
arguments = [args, argv],
186189
inputs = object_files,
187190
outputs = [def_file],
188191
use_default_shell_env = True,

0 commit comments

Comments
 (0)