aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2017-01-10 17:20:05 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-10 19:42:25 +0000
commitffbddeb49b2aa8b2b8b25a9f66667cfd10cb31f9 (patch)
tree417889527b9b16252a284a37bc8bc4c6cc7f1057 /src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
parent9bd768c05c474c80e6ae7698573209becb5fcc17 (diff)
Skylark repositories: propage value from --action_env to repository_ctx.environ
The environment is now computed with a mixture of the client environment and the values specified by the --action_env flag. If a user want to overwrite its environment for skylark repository, they can do `--action_env FOO=BAR` and the repository will see FOO as having the value BAR, whichever value is set in the client environment. Also propagate it to all repository functions, and deduplicate the way the client environment is passed to repository functions. Design doc: https://bazel.build/designs/2016/10/18/repository-invalidation.html [step 1] RELNOTES[INC]: repository_ctx environment is now affected by --action_env flag (value from the client environment will be replaced by value given on the command line through --action_env). -- Change-Id: I131a9695439aa9949d5001f820e2ae450e41332f Reviewed-on: https://cr.bazel.build/7971 PiperOrigin-RevId: 144091492 MOS_MIGRATED_REVID=144091492
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java b/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
index e946287dac..a8d72cc0ea 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/BazelRepositoryModule.java
@@ -71,7 +71,6 @@ import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.common.options.OptionsBase;
import com.google.devtools.common.options.OptionsProvider;
-
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.Nullable;
@@ -190,8 +189,7 @@ public class BazelRepositoryModule extends BlazeModule {
@Override
public void beforeCommand(Command command, CommandEnvironment env) throws AbruptExitException {
- delegator.setClientEnvironment(env.getClientEnv());
- skylarkRepositoryFunction.setCommandEnvironment(env);
+ delegator.setClientEnvironment(env.getActionClientEnv());
}
@Override