Skip to content

Commit

Permalink
Move CoreOptions exec modifiations out of ExecutionTransitionFactory
Browse files Browse the repository at this point in the history
Now that the host configuration is gone, fixed changes to the
`CoreOptions` when switching to the exec configuration are better
handled in `CoreOptions#getExec`.
  • Loading branch information
fmeum committed Apr 6, 2023
1 parent 9f2cc56 commit 22bc76f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ public FragmentOptions getExec() {
exec.affectedByStarlarkTransition = affectedByStarlarkTransition;
exec.outputDirectoryNamingScheme = outputDirectoryNamingScheme;
exec.compilationMode = hostCompilationMode;
exec.isExec = false;
exec.isExec = true;
exec.execConfigurationDistinguisherScheme = execConfigurationDistinguisherScheme;
exec.outputPathsMode = outputPathsMode;
exec.enableRunfiles = enableRunfiles;
Expand Down Expand Up @@ -1048,6 +1048,9 @@ public FragmentOptions getExec() {
exec.allowUnresolvedSymlinks = allowUnresolvedSymlinks;

exec.usePlatformsRepoForConstraints = usePlatformsRepoForConstraints;

// Disable extra actions
exec.actionListeners = ImmutableList.of();
return exec;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,6 @@ private static BuildOptions transitionImpl(BuildOptionsView options, Label execu
BuildOptionsView execOptions =
new BuildOptionsView(options.underlying().createExecOptions(), FRAGMENTS);

CoreOptions coreOptions = checkNotNull(execOptions.get(CoreOptions.class));
coreOptions.isExec = true;
// Disable extra actions
coreOptions.actionListeners = ImmutableList.of();

// Then set the target to the saved execution platform if there is one.
PlatformOptions platformOptions = execOptions.get(PlatformOptions.class);
if (platformOptions != null) {
Expand All @@ -154,7 +149,7 @@ private static BuildOptions transitionImpl(BuildOptionsView options, Label execu

// The conditional use of a Builder above may have replaced result and underlying options
// with a clone so must refresh it.
coreOptions = result.get(CoreOptions.class);
CoreOptions coreOptions = result.get(CoreOptions.class);
// TODO(blaze-configurability-team): These updates probably requires a bit too much knowledge
// of exactly how the immutable state and mutable state of BuildOptions is interacting.
// Might be good to have an option to wipeout that state rather than cloning so much.
Expand Down

0 comments on commit 22bc76f

Please sign in to comment.