Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support passing arguments to run_binary via param file #492

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vejbomar
Copy link

Allows to use run_binary in the case when the size of the command line can grow longer than the maximum size allowed by the system. We're currently hitting command line limits in our build setup.

Implementation inspired from Scala rules.

Allows to use run_binary in the case when the size of the command line
can grow longer than the maximum size allowed by the system.
Comment on lines +100 to +107
"param_file_format": attr.string(
doc = "If provided, Bazel can pass command-line arguments to the tool via file.\n\n" +
"Should be used when the size of the command line can grow longer than the " +
"maximum size allowed by the system. The format is the same as the format of " +
"`param_file_arg` in [`Args.param_file_arg`](https://bazel.build/rules/lib/builtins/Args#use_param_file). " +
"The `tool` has to support reading arguments from the file for this to work.",
default = "",
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had hard time understanding this and I needed to open Bazel's documentation. Although I used the functionality before.

I'd suggest just pasting the Bazel's doc here. Maybe adding that param files are only used if the attribute is set.

A format string with a single "%s". If the args are spilled to a params file then they are replaced with an argument consisting of this string formatted with the path of the params file.
For example, if the args are spilled to a params file "params.txt", then specifying "--file=%s" would cause the action command line to contain "--file=params.txt".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants