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

Add --host_action_env option #12122

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,30 @@ public String getTypeDescription() {
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES},
help =
"Specifies the set of environment variables available to actions. "
"Specifies the set of environment variables available to actions with target configuration. "
+ "Variables can be either specified by name, in which case the value will be "
+ "taken from the invocation environment, or by the name=value pair which sets "
+ "the value independent of the invocation environment. This option can be used "
+ "multiple times; for options given for the same variable, the latest wins, options "
+ "for different variables accumulate.")
public List<Map.Entry<String, String>> actionEnvironment;

@Option(
name = "host_action_env",
converter = Converters.OptionalAssignmentConverter.class,
allowMultiple = true,
defaultValue = "null",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES},
help =
"Specifies the set of environment variables available to actions with host or execution "
+ "configurations. Variables can be either specified by name, in which case the value "
+ "will be taken from the invocation environment, or by the name=value pair which sets "
+ "the value independent of the invocation environment. This option can be used "
+ "multiple times; for options given for the same variable, the latest wins, options "
+ "for different variables accumulate.")
public List<Map.Entry<String, String>> hostActionEnvironment;

@Option(
name = "repo_env",
converter = Converters.OptionalAssignmentConverter.class,
Expand Down Expand Up @@ -957,6 +973,9 @@ public FragmentOptions getHost() {
host.hostCpu = hostCpu;
host.hostCompilationMode = hostCompilationMode;

// Pass host action environment variables
host.actionEnvironment = hostActionEnvironment;

return host;
}

Expand Down