diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/ExecutionTransitionFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/config/ExecutionTransitionFactory.java index 54c07569fc196d..c0ee7501ae1ae3 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/ExecutionTransitionFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/ExecutionTransitionFactory.java @@ -109,8 +109,9 @@ public ImmutableSet> requiresOptionFragments() @Override public BuildOptions patch(BuildOptionsView options, EventHandler eventHandler) { - if (executionPlatform == null) { - // No execution platform is known, so don't change anything. + if (executionPlatform == null || options.get(CoreOptions.class).isExec) { + // If no execution platform is known or the input already comes from execution configuration, + // don't change anything and return the existing value. return options.underlying(); } return cache.applyTransition(