Remove remaining host references. This is mostly symbol names and documentation. This probably misses some references. I also didn't try to change flage like --host_cpu, etc. PiperOrigin-RevId: 500196744 Change-Id: I226d627d88911b8eee8642ced705c8a57b6d7b68
diff --git a/site/en/docs/user-manual.md b/site/en/docs/user-manual.md index 33f6816..50512cb 100644 --- a/site/en/docs/user-manual.md +++ b/site/en/docs/user-manual.md
@@ -162,30 +162,30 @@ #### `--host_copt={{ "<var>" }}cc-option{{ "</var>" }}` {:#host-copt} This option takes an argument which is to be passed to the compiler for source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--copt`](#copt) option, but applies only to the -host configuration. +exec configuration. #### `--host_conlyopt={{ "<var>" }}cc-option{{ "</var>" }}` {:#host-conlyopt} This option takes an argument which is to be passed to the compiler for C source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--conlyopt`](#cconlyopt) option, but applies only -to the host configuration. +to the exec configuration. #### `--host_cxxopt={{ "<var>" }}cc-option{{ "</var>" }}` {:#host-cxxopt} This option takes an argument which is to be passed to the compiler for C++ source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--cxxopt`](#cxxopt) option, but applies only to the -host configuration. +exec configuration. #### `--host_linkopt={{ "<var>" }}linker-option{{ "</var>" }}` {:#host-linkopt} This option takes an argument which is to be passed to the linker for source files -that are compiled in the host configuration. This is analogous to +that are compiled in the exec configuration. This is analogous to the [`--linkopt`](#linkopt) option, but applies only to -the host configuration. +the exec configuration. #### `--conlyopt={{ "<var>" }}cc-option{{ "</var>" }}` {:#cconlyopt} @@ -634,7 +634,7 @@ #### `--host_crosstool_top={{ "<var>" }}label{{ "</var>" }}` {:#host-crosstool-top} If not specified, Bazel uses the value of `--crosstool_top` to compile -code in the host configuration, such as tools run during the build. The main purpose of this flag +code in the exec configuration, such as tools run during the build. The main purpose of this flag is to enable cross-compilation. #### `--apple_crosstool_top={{ "<var>" }}label{{ "</var>" }}` {:#apple-crosstool-top} @@ -678,7 +678,7 @@ #### `--host_java_toolchain={{ "<var>" }}label{{ "</var>" }}` {:#host-java-toolchain} If not specified, bazel uses the value of `--java_toolchain` to compile -code in the host configuration, such as for tools run during the build. The main purpose of this flag +code in the exec configuration, such as for tools run during the build. The main purpose of this flag is to enable cross-compilation. #### `--javabase=({{ "<var>" }}label{{ "</var>" }})` {:#javabase} @@ -690,7 +690,7 @@ #### `--host_javabase={{ "<var>" }}label{{ "</var>" }}` {:#host-javabase} -This option sets the _label_ of the base Java installation to use in the host configuration, +This option sets the _label_ of the base Java installation to use in the exec configuration, for example for host build tools including JavaBuilder and Singlejar. This does not select the Java compiler that is used to compile Java @@ -1295,7 +1295,7 @@ a rule sets `stamp = -1` (the default for `*_binary` rules), this option determines whether stamping is enabled. -Bazel never stamps binaries that are built for the host configuration, +Bazel never stamps binaries that are built for the exec configuration, regardless of this option or the `stamp` attribute. For rules that set `stamp = 0` (the default for `*_test` rules), stamping is disabled regardless of `--[no]stamp`. Specifying `--stamp` does not force targets to be rebuilt if
diff --git a/site/en/query/cquery.md b/site/en/query/cquery.md index 5b182e4..e3fdc2e 100644 --- a/site/en/query/cquery.md +++ b/site/en/query/cquery.md
@@ -108,10 +108,6 @@ $ bazel config 9f87702 </pre> -The host configuration uses the special ID `(HOST)`. Non-generated source files, like -those commonly found in `srcs`, use the special ID `(null)` (because they -don't need to be configured). - `9f87702` is a prefix of the complete ID. This is because complete IDs are SHA-256 hashes, which are long and hard to follow. `cquery` understands any valid prefix of a complete ID, similar to @@ -134,12 +130,12 @@ <pre> # Analyzes //foo in the target configuration, but also analyzes -# //genrule_with_foo_as_tool which depends on a host-configured +# //genrule_with_foo_as_tool which depends on an exec-configured # //foo. So there are two configured target instances of //foo in # the build graph. $ bazel cquery //foo --universe_scope=//foo,//genrule_with_foo_as_tool //foo (9f87702) -//foo (HOST) +//foo (exec) </pre> If you want to precisely declare which instance to query over, use @@ -165,20 +161,20 @@ the label denoted by the first argument and configuration specified by the second argument. -Valid values for the second argument are `target`, `host`, `null`, or a +Valid values for the second argument are `null` or a [custom configuration hash](#configurations). Hashes can be retrieved from `$ bazel config` or a prevous `cquery`'s output. Examples: <pre> -$ bazel cquery "config(//bar, host)" --universe_scope=//foo +$ bazel cquery "config(//bar, 3732cc8)" --universe_scope=//foo </pre> <pre> $ bazel cquery "deps(//foo)" -//bar (HOST) -//baz (3732cc8) +//bar (exec) +//baz (exec) $ bazel cquery "config(//baz, 3732cc8)" </pre> @@ -219,7 +215,7 @@ </pre> Genrules configure their tools in the -[host configuration](/extending/rules#configurations) +[exec configuration](/extending/rules#configurations) so the following queries would produce the following outputs: <table class="table table-condensed table-bordered table-params"> @@ -239,7 +235,7 @@ <tr> <td>bazel cquery "//x:tool" --universe_scope="//x:my_gen"</td> <td>//x:my_gen</td> - <td>//x:tool(hostconfig)</td> + <td>//x:tool(execconfig)</td> </tr> </tbody> </table> @@ -307,7 +303,7 @@ are used to build targets underneath the top level targets in different configurations than the top level targets. -For example, a target might impose a transition to the host configuration on all +For example, a target might impose a transition to the exec configuration on all dependencies in its `tools` attribute. These are known as attribute transitions. Rules can also impose transitions on their own configurations, known as rule class transitions. This output format outputs information about @@ -577,9 +573,9 @@ `cquery` does not automatically wipe the build graph from previous commands and is therefore prone to picking up results from past -queries. For example, `genquery` exerts a host transition on +queries. For example, `genquery` exerts an exec transition on its `tools` attribute - that is, it configures its tools in the -[host configuration](/extending/rules#configurations). +[exec configuration](/extending/rules#configurations). You can see the lingering effects of that transition below. @@ -602,11 +598,11 @@ $ bazel cquery "deps(//foo:my_gen)" my_gen (target_config) -tool (host_config) +tool (exec_config) ... $ bazel cquery "//foo:tool" -tool(host_config) +tool(exec_config) </pre> Workaround: change any startup option to force re-analysis of configured targets.
diff --git a/site/en/run/build.md b/site/en/run/build.md index 3504b54..2112b19 100644 --- a/site/en/run/build.md +++ b/site/en/run/build.md
@@ -433,15 +433,15 @@ executables, but the build system must also build various tools used during the build itself—for example tools that are built from source, then subsequently used in, say, a genrule—and these must be built to run on your workstation. Thus -we can identify two configurations: the **host configuration**, which is used +we can identify two configurations: the **exec configuration**, which is used for building tools that run during the build, and the **target configuration** (or _request configuration_, but we say "target configuration" more often even though that word already has many meanings), which is used for building the binary you ultimately requested. Typically, there are many libraries that are prerequisites of both the requested -build target (`//foo:bin`) and one or more of the host tools, for example some -base libraries. Such libraries must be built twice, once for the host +build target (`//foo:bin`) and one or more of the exec tools, for example some +base libraries. Such libraries must be built twice, once for the exec configuration, and once for the target configuration. Bazel takes care of ensuring that both variants are built, and that the derived files are kept separate to avoid interference; usually such targets can be built concurrently, @@ -449,37 +449,7 @@ indicating that a given target is being built twice, this is most likely the explanation. -Bazel uses one of two ways to select the host configuration, based on the -`--distinct_host_configuration` option. This boolean option is somewhat subtle, -and the setting may improve (or worsen) the speed of your builds. - -#### `--distinct_host_configuration=false` {:#distinct-host-config-false} - -Caution: We do not recommend this option. If you frequently make changes to your -request configuration, such as alternating between `-c opt` and `-c dbg` builds, -or between simple- and cross-compilation, you will typically rebuild the -majority of your codebase each time you switch. - -When this option is false, the host and request configurations are identical: -all tools required during the build will be built in exactly the same way as -target programs. This setting means that no libraries need to be built twice -during a single build. - -However, it does mean that any change to your request configuration also affects -your host configuration, causing all the tools to be rebuilt, and then anything -that depends on the tool output to be rebuilt too. Thus, for example, simply -changing a linker option between builds might cause all tools to be re-linked, -and then all actions using them re-executed, and so on, resulting in a very -large rebuild. - -Note: If your host architecture is not capable of running your target binaries, -your build will not work. - -#### `--distinct_host_configuration=true` _(default)_ {:#distinct-host-config-true} - -If this option is true, then instead of using the same configuration for the -host and request, a completely distinct host configuration is used. The host -configuration is derived from the target configuration as follows: +The exec configuration is derived from the target configuration as follows: - Use the same version of Crosstool (`--crosstool_top`) as specified in the request configuration, unless `--host_crosstool_top` is specified. @@ -487,7 +457,7 @@ - Use the same values of these options as specified in the request configuration: `--compiler`, `--use_ijars`, and if `--host_crosstool_top` is used, then the value of `--host_cpu` is used to look up a - `default_toolchain` in the Crosstool (ignoring `--compiler`) for the host + `default_toolchain` in the Crosstool (ignoring `--compiler`) for the exec configuration. - Use the value of `--host_javabase` for `--javabase` - Use the value of `--host_java_toolchain` for `--java_toolchain` @@ -500,24 +470,18 @@ - Suppress stamping of binaries with build data (see `--embed_*` options). - All other values remain at their defaults. -There are many reasons why it might be preferable to select a distinct host -configuration from the request configuration. Some are too esoteric to mention -here, but two of them are worth pointing out. +There are many reasons why it might be preferable to select a distinct exec +configuration from the request configuration. Most importantly: Firstly, by using stripped, optimized binaries, you reduce the time spent linking and executing the tools, the disk space occupied by the tools, and the network I/O time in distributed builds. -Secondly, by decoupling the host and request configurations in all builds, you +Secondly, by decoupling the exec and request configurations in all builds, you avoid very expensive rebuilds that would result from minor changes to the request configuration (such as changing a linker options does), as described earlier. -That said, for certain builds, this option may be a hindrance. In particular, -builds in which changes of configuration are infrequent (especially certain Java -builds), and builds where the amount of code that must be built in both host and -target configurations is large, may not benefit. - ### Correct incremental rebuilds {:#correct-incremental-rebuilds} One of the primary goals of the Bazel project is to ensure correct incremental
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java index 370c603..43df362 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
@@ -242,7 +242,7 @@ BuildConfigurationValue configuration; TopLevelTargetsAndConfigsResult topLevelTargetsWithConfigsResult; // Configuration creation. - // TODO(gregce): Consider dropping this phase and passing on-the-fly target / host configs as + // TODO(gregce): Consider dropping this phase and passing on-the-fly target / exec configs as // needed. This requires cleaning up the invalidation in SkyframeBuildView.setConfigurations. try (SilentCloseable c = Profiler.instance().profile("createConfigurations")) { configuration = skyframeExecutor.createConfiguration(eventHandler, targetOptions, keepGoing);
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java index b03d399..5070ed4 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/CommandHelper.java
@@ -75,8 +75,7 @@ /** * Adds tools, as a set of executable binaries, by fetching them from the given attribute on the - * {@code ruleContext}, in HOST mode. Populates manifests, remoteRunfiles and label map where - * required. + * {@code ruleContext}. Populates manifests, remoteRunfiles and label map where required. */ @CanIgnoreReturnValue public Builder addHostToolDependencies(String toolAttributeName) { @@ -177,7 +176,7 @@ } for (Iterable<? extends TransitiveInfoCollection> tools : toolsList) { - for (TransitiveInfoCollection dep : tools) { // (Note: host configuration) + for (TransitiveInfoCollection dep : tools) { // (Note: exec configuration) FilesToRunProvider tool = dep.getProvider(FilesToRunProvider.class); if (tool == null) {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java index 216f17a..ee6a192 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/PlatformOptions.java
@@ -227,19 +227,19 @@ @Override public PlatformOptions getExec() { - PlatformOptions host = (PlatformOptions) getDefault(); - host.platforms = + PlatformOptions exec = (PlatformOptions) getDefault(); + exec.platforms = this.hostPlatform == null ? ImmutableList.of() : ImmutableList.of(this.hostPlatform); - host.hostPlatform = this.hostPlatform; - host.platformMappings = this.platformMappings; - host.extraExecutionPlatforms = this.extraExecutionPlatforms; - host.extraToolchains = this.extraToolchains; - host.toolchainResolutionDebug = this.toolchainResolutionDebug; - host.toolchainResolutionOverrides = this.toolchainResolutionOverrides; - host.autoConfigureHostPlatform = this.autoConfigureHostPlatform; - host.useToolchainResolutionForJavaRules = this.useToolchainResolutionForJavaRules; - host.targetPlatformFallback = this.targetPlatformFallback; - return host; + exec.hostPlatform = this.hostPlatform; + exec.platformMappings = this.platformMappings; + exec.extraExecutionPlatforms = this.extraExecutionPlatforms; + exec.extraToolchains = this.extraToolchains; + exec.toolchainResolutionDebug = this.toolchainResolutionDebug; + exec.toolchainResolutionOverrides = this.toolchainResolutionOverrides; + exec.autoConfigureHostPlatform = this.autoConfigureHostPlatform; + exec.useToolchainResolutionForJavaRules = this.useToolchainResolutionForJavaRules; + exec.targetPlatformFallback = this.targetPlatformFallback; + return exec; } /** Returns the intended target platform value based on options defined in this fragment. */
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetFactory.java index 8fc5f99..df37fec 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleConfiguredTargetFactory.java
@@ -30,7 +30,7 @@ * BuildConfigurationKey}, which is a key for a {@link BuildConfigurationValue}, which is a blob of * data that contains extra information about how the target should be built (for example, for which * platform or with which C++ preprocessor definitions). Accordingly, a target can give rise to - * multiple configured targets, for example, if it needs to be built both for the host and the + * multiple configured targets, for example, if it needs to be built both for the exec and the * target configuration. * * <p>The process of creating the appropriate {@link com.google.devtools.build.lib.actions.Action}s
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java index 6c010de..e595cd8 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -1330,15 +1330,6 @@ return transitiveInfoCollectionToArtifact(attributeName, target); } - /** - * Equivalent to getPrerequisiteArtifact(), but also asserts that host-configuration is - * appropriate for the specified attribute. - */ - // TODO(b/165916637): Fix callers to this method to use getPrerequisiteArtifact instead. - public Artifact getHostPrerequisiteArtifact(String attributeName) { - return getPrerequisiteArtifact(attributeName); - } - @Nullable private Artifact transitiveInfoCollectionToArtifact( String attributeName, TransitiveInfoCollection target) {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java index 76b410b..87a7cec 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/ShellConfiguration.java
@@ -148,10 +148,10 @@ @Override public Options getExec() { - Options host = (Options) getDefault(); - host.shellExecutable = shellExecutable; - host.useShBinaryStubScript = useShBinaryStubScript; - return host; + Options exec = (Options) getDefault(); + exec.shellExecutable = shellExecutable; + exec.useShBinaryStubScript = useShBinaryStubScript; + return exec; } } }
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java index 90253f8..5276e0e 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValue.java
@@ -473,8 +473,7 @@ * Returns the name of the base output directory under which actions in this configuration write * their outputs. * - * <p>This is the same as {@link #getMnemonic} except in the host configuration, in which case it - * is {@code "host"}. + * <p>This is the same as {@link #getMnemonic}. */ public String getOutputDirectoryName() { return outputDirectories.getOutputDirName();
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java index 702e606..e0cbef4 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
@@ -920,68 +920,68 @@ @Override public FragmentOptions getExec() { - CoreOptions host = (CoreOptions) getDefault(); + CoreOptions exec = (CoreOptions) getDefault(); - host.affectedByStarlarkTransition = affectedByStarlarkTransition; - host.outputDirectoryNamingScheme = outputDirectoryNamingScheme; - host.compilationMode = hostCompilationMode; - host.isExec = false; - host.execConfigurationDistinguisherScheme = execConfigurationDistinguisherScheme; - host.outputPathsMode = outputPathsMode; - host.enableRunfiles = enableRunfiles; - host.executionInfoModifier = executionInfoModifier; - host.commandLineBuildVariables = commandLineBuildVariables; - host.enforceConstraints = enforceConstraints; - host.mergeGenfilesDirectory = mergeGenfilesDirectory; - host.platformInOutputDir = platformInOutputDir; - host.cpu = hostCpu; - host.includeRequiredConfigFragmentsProvider = includeRequiredConfigFragmentsProvider; - host.debugSelectsAlwaysSucceed = debugSelectsAlwaysSucceed; - host.checkTestonlyForOutputFiles = checkTestonlyForOutputFiles; - host.useAutoExecGroups = useAutoExecGroups; + exec.affectedByStarlarkTransition = affectedByStarlarkTransition; + exec.outputDirectoryNamingScheme = outputDirectoryNamingScheme; + exec.compilationMode = hostCompilationMode; + exec.isExec = false; + exec.execConfigurationDistinguisherScheme = execConfigurationDistinguisherScheme; + exec.outputPathsMode = outputPathsMode; + exec.enableRunfiles = enableRunfiles; + exec.executionInfoModifier = executionInfoModifier; + exec.commandLineBuildVariables = commandLineBuildVariables; + exec.enforceConstraints = enforceConstraints; + exec.mergeGenfilesDirectory = mergeGenfilesDirectory; + exec.platformInOutputDir = platformInOutputDir; + exec.cpu = hostCpu; + exec.includeRequiredConfigFragmentsProvider = includeRequiredConfigFragmentsProvider; + exec.debugSelectsAlwaysSucceed = debugSelectsAlwaysSucceed; + exec.checkTestonlyForOutputFiles = checkTestonlyForOutputFiles; + exec.useAutoExecGroups = useAutoExecGroups; // === Runfiles === - host.buildRunfilesManifests = buildRunfilesManifests; - host.buildRunfiles = buildRunfiles; - host.legacyExternalRunfiles = legacyExternalRunfiles; - host.remotableSourceManifestActions = remotableSourceManifestActions; - host.skipRunfilesManifests = skipRunfilesManifests; - host.alwaysIncludeFilesToBuildInData = alwaysIncludeFilesToBuildInData; + exec.buildRunfilesManifests = buildRunfilesManifests; + exec.buildRunfiles = buildRunfiles; + exec.legacyExternalRunfiles = legacyExternalRunfiles; + exec.remotableSourceManifestActions = remotableSourceManifestActions; + exec.skipRunfilesManifests = skipRunfilesManifests; + exec.alwaysIncludeFilesToBuildInData = alwaysIncludeFilesToBuildInData; // === Filesets === - host.strictFilesetOutput = strictFilesetOutput; - host.strictFilesets = strictFilesets; + exec.strictFilesetOutput = strictFilesetOutput; + exec.strictFilesets = strictFilesets; // === Linkstamping === // Disable all link stamping for the exec configuration, to improve action // cache hit rates for tools. - host.stampBinaries = false; + exec.stampBinaries = false; // === Visibility === - host.checkVisibility = checkVisibility; + exec.checkVisibility = checkVisibility; // === Licenses === - host.checkLicenses = checkLicenses; + exec.checkLicenses = checkLicenses; // === Pass on C++ compiler features. - host.defaultFeatures = ImmutableList.copyOf(defaultFeatures); + exec.defaultFeatures = ImmutableList.copyOf(defaultFeatures); // Save host options in case of a further exec->host transition. - host.hostCpu = hostCpu; - host.hostCompilationMode = hostCompilationMode; + exec.hostCpu = hostCpu; + exec.hostCompilationMode = hostCompilationMode; - // Pass host action environment variables - host.actionEnvironment = hostActionEnvironment; - host.hostActionEnvironment = hostActionEnvironment; + // Pass exec action environment variables + exec.actionEnvironment = hostActionEnvironment; + exec.hostActionEnvironment = hostActionEnvironment; // Pass archived tree artifacts filter. - host.archivedArtifactsMnemonicsFilter = archivedArtifactsMnemonicsFilter; + exec.archivedArtifactsMnemonicsFilter = archivedArtifactsMnemonicsFilter; - host.enableAspectHints = enableAspectHints; - host.allowUnresolvedSymlinks = allowUnresolvedSymlinks; + exec.enableAspectHints = enableAspectHints; + exec.allowUnresolvedSymlinks = allowUnresolvedSymlinks; - host.usePlatformsRepoForConstraints = usePlatformsRepoForConstraints; - return host; + exec.usePlatformsRepoForConstraints = usePlatformsRepoForConstraints; + return exec; } /// Normalizes --define flags, preserving the last one to appear in the event of conflicts.
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/OutputDirectories.java b/src/main/java/com/google/devtools/build/lib/analysis/config/OutputDirectories.java index 54e0840..349b9f3 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/OutputDirectories.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/OutputDirectories.java
@@ -73,11 +73,6 @@ * build step, you're guaranteed not to have to rebuild it. The important exception has to do with * multiple configurations: every configuration in the build must have a different output * directory name so that their artifacts do not conflict. - * - * <p>The host configuration is special-cased: in order to guarantee that its output directory is - * always separate from that of the target configuration, we simply pin it to "host". We do this - * so that the build works even if the two configurations are too close (which is common) and so - * that the path of artifacts in the host configuration is a bit more readable. */ public enum OutputDirectory { BIN("bin"),
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ComposingTransitionFactory.java b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ComposingTransitionFactory.java index 9664386..74c9cf100 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ComposingTransitionFactory.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/config/transitions/ComposingTransitionFactory.java
@@ -63,10 +63,7 @@ // Since transitionFactory2 causes no changes, use transitionFactory1 directly. return transitionFactory1; } else if (isFinal(transitionFactory2)) { - // When the second transition is null there's no need to compose. But this also improves - // performance: host transitions are common, and ConfiguredTargetFunction has special - // optimized logic to handle them. If they were buried in the last segment of a - // ComposingTransition, those optimizations wouldn't trigger. + // When the second transition is null there's no need to compose. return transitionFactory2; }
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java index b9a1cc6..02b4aa3 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java
@@ -231,7 +231,7 @@ throw Starlark.errorf( "late-bound attributes must not have a split configuration transition"); } - // TODO(b/203203933): Officially deprecate HOST transition and remove this. + // TODO(b/203203933): remove after removing --incompatible_disable_starlark_host_transitions. if (trans.equals("host")) { boolean disableStarlarkHostTransitions = thread
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java index f86c67d..75c9e0d 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestActionBuilder.java
@@ -236,14 +236,14 @@ Artifact testActionExecutable = isUsingTestWrapperInsteadOfTestSetupScript - ? ruleContext.getHostPrerequisiteArtifact("$test_wrapper") - : ruleContext.getHostPrerequisiteArtifact("$test_setup_script"); + ? ruleContext.getPrerequisiteArtifact("$test_wrapper") + : ruleContext.getPrerequisiteArtifact("$test_setup_script"); inputsBuilder.add(testActionExecutable); Artifact testXmlGeneratorExecutable = isUsingTestWrapperInsteadOfTestSetupScript - ? ruleContext.getHostPrerequisiteArtifact("$xml_writer") - : ruleContext.getHostPrerequisiteArtifact("$xml_generator_script"); + ? ruleContext.getPrerequisiteArtifact("$xml_writer") + : ruleContext.getPrerequisiteArtifact("$xml_generator_script"); inputsBuilder.add(testXmlGeneratorExecutable); Artifact collectCoverageScript = null; @@ -256,7 +256,7 @@ TestTargetExecutionSettings executionSettings; if (collectCodeCoverage) { - collectCoverageScript = ruleContext.getHostPrerequisiteArtifact("$collect_coverage_script"); + collectCoverageScript = ruleContext.getPrerequisiteArtifact("$collect_coverage_script"); inputsBuilder.add(collectCoverageScript); inputsBuilder.addTransitive(instrumentedFiles.getCoverageSupportFiles()); // Add instrumented file manifest artifact to the list of inputs. This file will contain @@ -272,8 +272,7 @@ .getAllArtifacts()); if (ruleContext.isAttrDefined("$collect_cc_coverage", LABEL)) { - Artifact collectCcCoverage = - ruleContext.getHostPrerequisiteArtifact("$collect_cc_coverage"); + Artifact collectCcCoverage = ruleContext.getPrerequisiteArtifact("$collect_cc_coverage"); inputsBuilder.add(collectCcCoverage); extraTestEnv.put(CC_CODE_COVERAGE_SCRIPT, collectCcCoverage.getExecPathString()); }
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java index f6626e0..203c020 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestConfiguration.java
@@ -285,7 +285,7 @@ public FragmentOptions getExec() { // Options here are either: // 1. Applicable only for the test actions, which are relevant only for the top-level targets - // before host or exec transitions can apply. + // before exec transitions can apply. // 2. Supposed to be build-universal and thus non-transitionable anyways // (e.g. trim_test_configuration) // And thus the options should just be copied and not reset by the exec transition (as
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java index 6a2c96b..bee8e13 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
@@ -160,9 +160,9 @@ @Override public StrictActionEnvOptions getExec() { - StrictActionEnvOptions host = (StrictActionEnvOptions) getDefault(); - host.useStrictActionEnv = useStrictActionEnv; - return host; + StrictActionEnvOptions exec = (StrictActionEnvOptions) getDefault(); + exec.useStrictActionEnv = useStrictActionEnv; + return exec; } } @@ -552,8 +552,8 @@ // searches PATH for "python3", so if we don't include this directory then we can't run PY3 // targets with this toolchain if strict action environment is on. // - // Note that --action_env does not propagate to the host config, so it is not a viable - // workaround when a genrule is itself built in the host config (e.g. nested genrules). See + // Note that --action_env does not propagate to the exec config, so it is not a viable + // workaround when a genrule is itself built in the exec config (e.g. nested genrules). See // #8536. return "/bin:/usr/bin:/usr/local/bin"; }
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java index 93ac408..2b8f89a 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/genrule/BazelGenRuleRule.java
@@ -81,7 +81,7 @@ Do not use a genrule for running tests. There are special dispensations for tests and test results, including caching policies and environment variables. Tests generally need to be run after the build is complete and on the target architecture, whereas genrules are executed during - the build and on the host architecture (the two may be different). If you need a general purpose + the build and on the exec architecture (the two may be different). If you need a general purpose testing rule, use <a href="${link sh_test}"><code>sh_test</code></a>. </p> @@ -99,7 +99,7 @@ itself has to. </p> <p> - The build system uses the host configuration to describe the machine(s) on which the build runs + The build system uses the exec configuration to describe the machine(s) on which the build runs and the target configuration to describe the machine(s) on which the output of the build is supposed to run. It provides options to configure each of these and it segregates the corresponding files into separate directories to avoid conflicts. @@ -107,7 +107,7 @@ <p> For genrules, the build system ensures that dependencies are built appropriately: <code>srcs</code> are built (if necessary) for the <em>target</em> configuration, - <code>tools</code> are built for the <em>host</em> configuration, and the output is considered to + <code>tools</code> are built for the <em>exec</em> configuration, and the output is considered to be for the <em>target</em> configuration. It also provides <a href="${link make-variables}"> "Make" variables</a> that genrule commands can pass to the corresponding tools. </p> @@ -121,12 +121,12 @@ <h4>Special Cases</h4> <p> - <i>Host-host compilation</i>: in some cases, the build system needs to run genrules such that the + <i>Exec-exec compilation</i>: in some cases, the build system needs to run genrules such that the output can also be executed during the build. If for example a genrule builds some custom compiler which is subsequently used by another genrule, the first one has to produce its output for the - host configuration, because that's where the compiler will run in the other genrule. In this case, + exec configuration, because that's where the compiler will run in the other genrule. In this case, the build system does the right thing automatically: it builds the <code>srcs</code> and - <code>outs</code> of the first genrule for the host configuration instead of the target + <code>outs</code> of the first genrule for the exec configuration instead of the target configuration. See <a href="${link user-manual#configurations}">the user manual</a> for more info. </p>
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java index 22050a2..1c4766a 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonConfiguration.java
@@ -95,10 +95,10 @@ + "is less likely to experience import name collisions.") public boolean experimentalPythonImportAllRepositories; - /** Make Python configuration options available for host configurations as well */ + /** Make Python configuration options available for exec configurations as well */ @Override public FragmentOptions getExec() { - return clone(); // host options are the same as target options + return clone(); // exec options are the same as target options } }
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java index 363098d..4427218 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
@@ -159,7 +159,7 @@ // The python code coverage tool to use, if any. String coverageTool = getCoverageTool(ruleContext, common); - // Version information for host config diagnostic warning. + // Version information for exec config diagnostic warning. PythonVersion attrVersion = PyCommon.readPythonVersionFromAttribute(ruleContext.attributes()); boolean attrVersionSpecifiedExplicitly = attrVersion != null; if (!attrVersionSpecifiedExplicitly) {
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java index 8cbbcc6..6fb4ebb 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
@@ -479,7 +479,7 @@ /** * Declares that the implementation of the associated aspect definition requires the given - * fragments to be present in this rule's host and target configurations. + * fragments to be present in this rule's exec and target configurations. * * <p>The value is inherited by subclasses. */
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java index 55a06c8..a59244b 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Attribute.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Attribute.java
@@ -1565,7 +1565,7 @@ /** * Returns the input type that the attribute expects. This is almost always a configuration - * fragment to be retrieved from the target's configuration (or the host configuration). + * fragment to be retrieved from the target's configuration (or the exec configuration). * * <p>It may also be {@link Void} to receive null. This is rarely necessary, but can be used, * e.g., if the attribute is named to match an attribute in another rule which is late-bound.
diff --git a/src/main/java/com/google/devtools/build/lib/packages/ConfigurationFragmentPolicy.java b/src/main/java/com/google/devtools/build/lib/packages/ConfigurationFragmentPolicy.java index a93153e..ef05289 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/ConfigurationFragmentPolicy.java +++ b/src/main/java/com/google/devtools/build/lib/packages/ConfigurationFragmentPolicy.java
@@ -13,20 +13,16 @@ // limitations under the License. package com.google.devtools.build.lib.packages; -import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSetMultimap; -import com.google.common.collect.LinkedHashMultimap; -import com.google.common.collect.SetMultimap; +import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.analysis.config.Fragment; import com.google.devtools.build.lib.analysis.config.FragmentClassSet; -import com.google.devtools.build.lib.analysis.config.transitions.ConfigurationTransition; -import com.google.devtools.build.lib.analysis.config.transitions.NoTransition; import com.google.errorprone.annotations.CanIgnoreReturnValue; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import net.starlark.java.annot.StarlarkAnnotations; @@ -74,12 +70,11 @@ /** * Sets of configuration fragments required by this rule, as defined by their Starlark names - * (see {@link StarlarkBuiltin}, a set for each configuration. + * (see {@link StarlarkBuiltin}. * * <p>Duplicate entries will automatically be ignored by the SetMultimap. */ - private final SetMultimap<ConfigurationTransition, String> - starlarkRequiredConfigurationFragments = LinkedHashMultimap.create(); + private final Set<String> starlarkRequiredConfigurationFragments = new LinkedHashSet<>(); private final Map<Class<?>, MissingFragmentPolicy> missingFragmentPolicy = new LinkedHashMap<>(); @@ -99,7 +94,7 @@ /** * Declares that the implementation of the associated rule class requires the given fragments to - * be present in this rule's target configuration only. + * be present for this rule. * * <p>In contrast to {@link #requiresConfigurationFragments(Collection)}, this method takes the * names of fragments (as determined by {@link StarlarkBuiltin}) instead of their classes. @@ -109,28 +104,7 @@ @CanIgnoreReturnValue public Builder requiresConfigurationFragmentsByStarlarkBuiltinName( Collection<String> configurationFragmentNames) { - - requiresConfigurationFragmentsByStarlarkBuiltinName( - NoTransition.INSTANCE, configurationFragmentNames); - return this; - } - - /** - * Declares the configuration fragments that are required by this rule for the specified - * configuration. Valid transition values are HOST for the host configuration and NONE for the - * target configuration. - * - * <p>In contrast to {@link #requiresConfigurationFragments(ConfigurationTransition, - * Collection)}, this method takes the names of fragments (as determined by {@link - * StarlarkBuiltin}) instead of their classes. - */ - @CanIgnoreReturnValue - public Builder requiresConfigurationFragmentsByStarlarkBuiltinName( - ConfigurationTransition transition, Collection<String> configurationFragmentNames) { - // We can relax this assumption if needed. But it's already sketchy to let a rule see more - // than its own configuration. So we don't want to casually proliferate this pattern. - Preconditions.checkArgument(transition == NoTransition.INSTANCE); - starlarkRequiredConfigurationFragments.putAll(transition, configurationFragmentNames); + starlarkRequiredConfigurationFragments.addAll(configurationFragmentNames); return this; } @@ -142,7 +116,7 @@ @CanIgnoreReturnValue public Builder includeConfigurationFragmentsFrom(ConfigurationFragmentPolicy other) { requiredConfigurationFragments.addAll(other.requiredConfigurationFragments); - starlarkRequiredConfigurationFragments.putAll(other.starlarkRequiredConfigurationFragments); + starlarkRequiredConfigurationFragments.addAll(other.starlarkRequiredConfigurationFragments); missingFragmentPolicy.putAll(other.missingFragmentPolicy); return this; } @@ -161,26 +135,22 @@ public ConfigurationFragmentPolicy build() { return new ConfigurationFragmentPolicy( FragmentClassSet.of(requiredConfigurationFragments), - ImmutableSetMultimap.copyOf(starlarkRequiredConfigurationFragments), + ImmutableSet.copyOf(starlarkRequiredConfigurationFragments), ImmutableMap.copyOf(missingFragmentPolicy)); } } private final FragmentClassSet requiredConfigurationFragments; - /** - * A dictionary that maps configurations (NONE for target configuration, HOST for host - * configuration) to lists of Starlark module names of required configuration fragments. - */ - private final ImmutableSetMultimap<ConfigurationTransition, String> - starlarkRequiredConfigurationFragments; + /** A set of Starlark module names of required configuration fragments. */ + private final ImmutableSet<String> starlarkRequiredConfigurationFragments; /** What to do during analysis if a configuration fragment is missing. */ private final ImmutableMap<Class<?>, MissingFragmentPolicy> missingFragmentPolicy; private ConfigurationFragmentPolicy( FragmentClassSet requiredConfigurationFragments, - ImmutableSetMultimap<ConfigurationTransition, String> starlarkRequiredConfigurationFragments, + ImmutableSet<String> starlarkRequiredConfigurationFragments, ImmutableMap<Class<?>, MissingFragmentPolicy> missingFragmentPolicy) { this.requiredConfigurationFragments = requiredConfigurationFragments; this.starlarkRequiredConfigurationFragments = starlarkRequiredConfigurationFragments; @@ -204,7 +174,7 @@ * can be used to convert this to Java fragment instances. */ public ImmutableCollection<String> getRequiredStarlarkFragments() { - return starlarkRequiredConfigurationFragments.values(); + return starlarkRequiredConfigurationFragments; } /** @@ -224,7 +194,7 @@ StarlarkBuiltin fragmentModule = StarlarkAnnotations.getStarlarkBuiltin(configurationFragment); return fragmentModule != null - && starlarkRequiredConfigurationFragments.containsValue(fragmentModule.name()); + && starlarkRequiredConfigurationFragments.contains(fragmentModule.name()); } /**
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java index ec319e3..460da0b 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java +++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -994,7 +994,7 @@ /** * Declares that the implementation of the associated rule class requires the given fragments to - * be present in this rule's host and target configurations. + * be present. * * <p>The value is inherited by subclasses. */
diff --git a/src/main/java/com/google/devtools/build/lib/query2/common/CommonQueryOptions.java b/src/main/java/com/google/devtools/build/lib/query2/common/CommonQueryOptions.java index 693c88f..ca839aa 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/common/CommonQueryOptions.java +++ b/src/main/java/com/google/devtools/build/lib/query2/common/CommonQueryOptions.java
@@ -90,16 +90,16 @@ documentationCategory = OptionDocumentationCategory.QUERY, effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS}, help = - "Query: If disabled, dependencies on 'host configuration' or 'execution' targets will" - + " not be included in the dependency graph over which the query operates. A 'host" + "Query: If disabled, dependencies on 'exec configuration' will" + + " not be included in the dependency graph over which the query operates. An 'exec" + " configuration' dependency edge, such as the one from any 'proto_library' rule to" + " the Protocol Compiler, usually points to a tool executed during the build rather" + " than a part of the same 'target' program. \n" - + "Cquery: If disabled, filters out all configured targets which cross a host or" + + "Cquery: If disabled, filters out all configured targets which cross an" + " execution transition from the top-level target that discovered this configured" + " target. That means if the top-level target is in the target configuration, only" + " configured targets also in the target configuration will be returned. If the" - + " top-level target is in the host configuration, only host configured targets will" + + " top-level target is in the exec configuration, only exec configured targets will" + " be returned. This option will NOT exclude resolved toolchains.") public boolean includeToolDeps;
diff --git a/src/main/java/com/google/devtools/build/lib/query2/cquery/ConfigFunction.java b/src/main/java/com/google/devtools/build/lib/query2/cquery/ConfigFunction.java index 740520b..4aa1032 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/cquery/ConfigFunction.java +++ b/src/main/java/com/google/devtools/build/lib/query2/cquery/ConfigFunction.java
@@ -29,11 +29,10 @@ /** * A "config" query expression for cquery. The first argument is the expression to be evaluated. The - * second argument is either "host", "target", "null", or an arbitrary configuration's hash (the - * same hash cquery annotates label outputs with) to specify which configuration the user is seeking - * to query in. If some but not all results of expr can be found in the specified config, the subset - * that can be is returned. If no results of expr can be found in the specified config, an error is - * thrown. + * second argument is "target", "null", or an arbitrary configuration's hash (the same hash cquery + * annotates label outputs with) to specify which configuration the user is seeking to query in. If + * some but not all results of expr can be found in the specified config, the subset that can be is + * returned. If no results of expr can be found in the specified config, an error is thrown. * * <pre> expr ::= CONFIG '(' expr ',' word ')'</pre> */
diff --git a/src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java index 2071cdd..e0955c8 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java +++ b/src/main/java/com/google/devtools/build/lib/query2/query/output/ProtoOutputFormatter.java
@@ -244,7 +244,7 @@ } // Include explicit elements for all direct inputs and outputs of a rule; this goes beyond // what is available from the attributes above, since it may also (depending on options) - // include implicit outputs, host-configuration outputs, and default values. + // include implicit outputs, exec-configuration outputs, and default values. rule.getSortedLabels(dependencyFilter) .forEach(input -> rulePb.addRuleInput(input.toString())); rule.getOutputFiles().stream()
diff --git a/src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java b/src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java index 9690836..702083a 100644 --- a/src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java +++ b/src/main/java/com/google/devtools/build/lib/query2/query/output/XmlOutputFormatter.java
@@ -173,10 +173,9 @@ } } - // Include explicit elements for all direct inputs and outputs of a rule; - // this goes beyond what is available from the attributes above, since it - // may also (depending on options) include implicit outputs, - // host-configuration outputs, and default values. + // Include explicit elements for all direct inputs and outputs of a rule; this goes beyond + // what is available from the attributes above, since it may also (depending on options) + // include implicit outputs, exec-configuration outputs, and default values. for (Label label : rule.getSortedLabels(dependencyFilter)) { Element inputElem = doc.createElement("rule-input"); inputElem.setAttribute("name", label.toString());
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java index 5b2edb4..7c00f82 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
@@ -385,7 +385,7 @@ if (!keys.isEmpty()) { return keys; } - return ImmutableList.of(ruleContext.getHostPrerequisiteArtifact("debug_key")); + return ImmutableList.of(ruleContext.getPrerequisiteArtifact("debug_key")); } private void compileResources(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java index 8d67706..6586f49 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidConfiguration.java
@@ -1068,38 +1068,38 @@ @Override public FragmentOptions getExec() { - Options host = (Options) super.getExec(); - host.hwasan = false; - host.androidCrosstoolTop = androidCrosstoolTop; - host.sdk = sdk; - host.fatApkCpus = ImmutableList.of(); // Fat APK archs don't apply to the host. - host.incompatibleUseToolchainResolution = incompatibleUseToolchainResolution; - host.androidPlatformsTransitionsUpdateAffected = androidPlatformsTransitionsUpdateAffected; + Options exec = (Options) super.getExec(); + exec.hwasan = false; + exec.androidCrosstoolTop = androidCrosstoolTop; + exec.sdk = sdk; + exec.fatApkCpus = ImmutableList.of(); // Fat APK archs don't apply to the exec platform.. + exec.incompatibleUseToolchainResolution = incompatibleUseToolchainResolution; + exec.androidPlatformsTransitionsUpdateAffected = androidPlatformsTransitionsUpdateAffected; - host.desugarJava8 = desugarJava8; - host.desugarJava8Libs = desugarJava8Libs; - host.checkDesugarDeps = checkDesugarDeps; - host.incrementalDexing = incrementalDexing; - host.incrementalDexingShardsAfterProguard = incrementalDexingShardsAfterProguard; - host.incrementalDexingUseDexSharder = incrementalDexingUseDexSharder; - host.incrementalDexingAfterProguardByDefault = incrementalDexingAfterProguardByDefault; - host.assumeMinSdkVersion = assumeMinSdkVersion; - host.nonIncrementalPerTargetDexopts = nonIncrementalPerTargetDexopts; - host.dexoptsSupportedInIncrementalDexing = dexoptsSupportedInIncrementalDexing; - host.dexoptsSupportedInDexMerger = dexoptsSupportedInDexMerger; - host.dexoptsSupportedInDexSharder = dexoptsSupportedInDexSharder; - host.useWorkersWithDexbuilder = useWorkersWithDexbuilder; - host.manifestMerger = manifestMerger; - host.manifestMergerOrder = manifestMergerOrder; - host.allowAndroidLibraryDepsWithoutSrcs = allowAndroidLibraryDepsWithoutSrcs; - host.oneVersionEnforcementUseTransitiveJarsForBinaryUnderTest = + exec.desugarJava8 = desugarJava8; + exec.desugarJava8Libs = desugarJava8Libs; + exec.checkDesugarDeps = checkDesugarDeps; + exec.incrementalDexing = incrementalDexing; + exec.incrementalDexingShardsAfterProguard = incrementalDexingShardsAfterProguard; + exec.incrementalDexingUseDexSharder = incrementalDexingUseDexSharder; + exec.incrementalDexingAfterProguardByDefault = incrementalDexingAfterProguardByDefault; + exec.assumeMinSdkVersion = assumeMinSdkVersion; + exec.nonIncrementalPerTargetDexopts = nonIncrementalPerTargetDexopts; + exec.dexoptsSupportedInIncrementalDexing = dexoptsSupportedInIncrementalDexing; + exec.dexoptsSupportedInDexMerger = dexoptsSupportedInDexMerger; + exec.dexoptsSupportedInDexSharder = dexoptsSupportedInDexSharder; + exec.useWorkersWithDexbuilder = useWorkersWithDexbuilder; + exec.manifestMerger = manifestMerger; + exec.manifestMergerOrder = manifestMergerOrder; + exec.allowAndroidLibraryDepsWithoutSrcs = allowAndroidLibraryDepsWithoutSrcs; + exec.oneVersionEnforcementUseTransitiveJarsForBinaryUnderTest = oneVersionEnforcementUseTransitiveJarsForBinaryUnderTest; - host.persistentBusyboxTools = persistentBusyboxTools; - host.disableNativeAndroidRules = disableNativeAndroidRules; + exec.persistentBusyboxTools = persistentBusyboxTools; + exec.disableNativeAndroidRules = disableNativeAndroidRules; - // Unless the build was started from an Android device, host means MAIN. - host.configurationDistinguisher = ConfigurationDistinguisher.MAIN; - return host; + // Unless the build was started from an Android device, exec means MAIN. + exec.configurationDistinguisher = ConfigurationDistinguisher.MAIN; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDex2OatInfo.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDex2OatInfo.java index 3476ce3..69d2f40 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDex2OatInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidDex2OatInfo.java
@@ -59,7 +59,7 @@ } private final boolean dex2OatEnabled; - private final boolean executeDex2OatOnHost; + private final boolean executeDex2OatOnExecPlatform; private final FilesToRunProvider sandboxForPregeneratingOatFilesForTests; private final Artifact framework; private final Artifact dalvikCache; @@ -73,7 +73,7 @@ Artifact dalvikCache, Artifact deviceProps) { this.dex2OatEnabled = dex2OatEnabled; - this.executeDex2OatOnHost = executeDex2OatOnHost; + this.executeDex2OatOnExecPlatform = executeDex2OatOnHost; this.sandboxForPregeneratingOatFilesForTests = sandboxForPregeneratingOatFilesForTests; this.framework = framework; this.dalvikCache = dalvikCache; @@ -90,12 +90,12 @@ return dex2OatEnabled; } - /** Returns whether dex2oat should be executed on the host. */ - public boolean executeDex2OatOnHost() { - return executeDex2OatOnHost; + /** Returns whether dex2oat should be executed on the exec platform. */ + public boolean executeDex2OatOnExecPlatform() { + return executeDex2OatOnExecPlatform; } - /** Returns the virtual device executable to run dex2oat on the host */ + /** Returns the virtual device executable to run dex2oat on the exec platform */ @Nullable public FilesToRunProvider getSandboxForPregeneratingOatFilesForTests() { return sandboxForPregeneratingOatFilesForTests;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBase.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBase.java index 23c43bf..3472ec4 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBase.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkBase.java
@@ -71,7 +71,7 @@ Artifact frameworkAidl = ruleContext.getPrerequisiteArtifact("framework_aidl"); TransitiveInfoCollection aidlLib = ruleContext.getPrerequisite("aidl_lib"); Artifact androidJar = ruleContext.getPrerequisiteArtifact("android_jar"); - Artifact sourceProperties = ruleContext.getHostPrerequisiteArtifact("source_properties"); + Artifact sourceProperties = ruleContext.getPrerequisiteArtifact("source_properties"); Artifact shrinkedAndroidJar = ruleContext.getPrerequisiteArtifact("shrinked_android_jar"); Artifact mainDexClasses = ruleContext.getPrerequisiteArtifact("main_dex_classes"); BootClassPathInfo system = ruleContext.getPrerequisite("system", BootClassPathInfo.PROVIDER);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java index ee8e51e..fe67b9f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleCommandLineOptions.java
@@ -490,33 +490,33 @@ @Override public FragmentOptions getExec() { - AppleCommandLineOptions host = (AppleCommandLineOptions) super.getExec(); + AppleCommandLineOptions exec = (AppleCommandLineOptions) super.getExec(); - // Set options needed in the host configuration. - host.xcodeVersionConfig = xcodeVersionConfig; - host.xcodeVersion = xcodeVersion; - host.iosSdkVersion = iosSdkVersion; - host.watchOsSdkVersion = watchOsSdkVersion; - host.tvOsSdkVersion = tvOsSdkVersion; - host.macOsSdkVersion = macOsSdkVersion; - host.macosMinimumOs = hostMacosMinimumOs; - // The host apple platform type will always be MACOS, as no other apple platform type can + // Set options needed in the exec configuration. + exec.xcodeVersionConfig = xcodeVersionConfig; + exec.xcodeVersion = xcodeVersion; + exec.iosSdkVersion = iosSdkVersion; + exec.watchOsSdkVersion = watchOsSdkVersion; + exec.tvOsSdkVersion = tvOsSdkVersion; + exec.macOsSdkVersion = macOsSdkVersion; + exec.macosMinimumOs = hostMacosMinimumOs; + // The exec apple platform type will always be MACOS, as no other apple platform type can // currently execute build actions. If that were the case, a host_apple_platform_type flag might // be needed. - host.applePlatformType = PlatformType.MACOS; - host.configurationDistinguisher = ConfigurationDistinguisher.UNKNOWN; + exec.applePlatformType = PlatformType.MACOS; + exec.configurationDistinguisher = ConfigurationDistinguisher.UNKNOWN; // Preseve Xcode selection preferences so that the same Xcode version is used throughout the // build. - host.preferMutualXcode = preferMutualXcode; - host.includeXcodeExecutionRequirements = includeXcodeExecutionRequirements; - host.appleCrosstoolTop = appleCrosstoolTop; - host.applePlatforms = applePlatforms; - host.incompatibleUseToolchainResolution = incompatibleUseToolchainResolution; + exec.preferMutualXcode = preferMutualXcode; + exec.includeXcodeExecutionRequirements = includeXcodeExecutionRequirements; + exec.appleCrosstoolTop = appleCrosstoolTop; + exec.applePlatforms = applePlatforms; + exec.incompatibleUseToolchainResolution = incompatibleUseToolchainResolution; // Save host option for further use. - host.hostMacosMinimumOs = hostMacosMinimumOs; + exec.hostMacosMinimumOs = hostMacosMinimumOs; - return host; + return exec; } void serialize(SerializationContext context, CodedOutputStream out)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java index dc7abdb..512b985 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java
@@ -396,7 +396,7 @@ } /** - * Returns the label of the xcode_config rule to use for resolving the host system xcode version. + * Returns the label of the xcode_config rule to use for resolving the exec system xcode version. */ @StarlarkConfigurationField( name = "xcode_config_label",
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/cpp/AppleCcToolchain.java b/src/main/java/com/google/devtools/build/lib/rules/apple/cpp/AppleCcToolchain.java index 7e787df..1832860a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/apple/cpp/AppleCcToolchain.java +++ b/src/main/java/com/google/devtools/build/lib/rules/apple/cpp/AppleCcToolchain.java
@@ -55,10 +55,10 @@ @Override protected AdditionalBuildVariablesComputer getAdditionalBuildVariablesComputer( - RuleContext ruleContextPossiblyInHostConfiguration) { - // xcode config is shared between target and host configuration therefore we can use it. + RuleContext ruleContextPossiblyInExecConfiguration) { + // xcode config is shared between target and exec configuration therefore we can use it. XcodeConfigInfo xcodeConfig = - XcodeConfig.getXcodeConfigInfo(ruleContextPossiblyInHostConfiguration); + XcodeConfig.getXcodeConfigInfo(ruleContextPossiblyInExecConfiguration); return getAdditionalBuildVariablesComputer(xcodeConfig); }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/swift/SwiftCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/apple/swift/SwiftCommandLineOptions.java index f3cffe4..2d18a8f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/apple/swift/SwiftCommandLineOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/apple/swift/SwiftCommandLineOptions.java
@@ -37,17 +37,17 @@ defaultValue = "null", documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, - help = "Additional options to pass to swiftc for host tools.") + help = "Additional options to pass to swiftc for exec tools.") public List<String> hostSwiftcoptList; @Override public FragmentOptions getExec() { - SwiftCommandLineOptions host = (SwiftCommandLineOptions) super.getExec(); - host.copts = this.hostSwiftcoptList; + SwiftCommandLineOptions exec = (SwiftCommandLineOptions) super.getExec(); + exec.copts = this.hostSwiftcoptList; - // Save host options in case of a further exec->host transition. - host.hostSwiftcoptList = hostSwiftcoptList; + // Save exec options in case of a further exec->host transition. + exec.hostSwiftcoptList = hostSwiftcoptList; - return host; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagOptions.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagOptions.java index 3a9e078..99fc2f9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigFeatureFlagOptions.java
@@ -61,9 +61,9 @@ @Override public ConfigFeatureFlagOptions getExec() { - ConfigFeatureFlagOptions host = (ConfigFeatureFlagOptions) super.getExec(); - host.enforceTransitiveConfigsForConfigFeatureFlag = false; - host.allFeatureFlagValuesArePresent = this.allFeatureFlagValuesArePresent; - return host; + ConfigFeatureFlagOptions exec = (ConfigFeatureFlagOptions) super.getExec(); + exec.enforceTransitiveConfigsForConfigFeatureFlag = false; + exec.allFeatureFlagValuesArePresent = this.allFeatureFlagValuesArePresent; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java index d2ee4e5..0282f7e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/config/ConfigRuleClasses.java
@@ -170,7 +170,7 @@ <p>For convenience's sake, configuration values are specified as build flags (without the preceding <code>"--"</code>). But keep in mind that the two are not the same. This is because targets can be built in multiple configurations within the same - build. For example, a host configuration's "cpu" matches the value of + build. For example, an exec configuration's "cpu" matches the value of <code>--host_cpu</code>, not <code>--cpu</code>. So different instances of the same <code>config_setting</code> may match the same invocation differently depending on the configuration of the rule using them.
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java index 8d05cd7..172fe14 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java
@@ -2009,7 +2009,7 @@ } } if (dwoFile != null) { - // Host targets don't produce .dwo files. + // Exec configuration targets don't produce .dwo files. result.addPicDwoFile(dwoFile); } if (gcnoFile != null) { @@ -2080,7 +2080,7 @@ } } if (noPicDwoFile != null) { - // Host targets don't produce .dwo files. + // Exec configuration targets don't produce .dwo files. result.addDwoFile(noPicDwoFile); } if (gcnoFile != null) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java index 3b99e5b..49bd21f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchain.java
@@ -147,7 +147,7 @@ /** Returns a function that will be called to retrieve root {@link CcToolchainVariables}. */ protected AdditionalBuildVariablesComputer getAdditionalBuildVariablesComputer( - RuleContext ruleContextPossiblyInHostConfiguration) { + RuleContext ruleContextPossiblyInExecConfiguration) { return (AdditionalBuildVariablesComputer & Serializable) (options) -> CcToolchainVariables.EMPTY; }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java index 5d39227..710edc3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainProvider.java
@@ -627,7 +627,7 @@ /** * Returns the name of the directory where the solib symlinks for the dynamic runtime libraries - * live. The directory itself will be under the root of the host configuration in the 'bin' + * live. The directory itself will be under the root of the exec configuration in the 'bin' * directory. */ public PathFragment getDynamicRuntimeSolibDir() { @@ -716,9 +716,9 @@ * * <p>If C++ rules use platforms/toolchains without * https://github.com/bazelbuild/proposals/blob/master/designs/2019-02-12-toolchain-transitions.md - * implemented, CcToolchain is analyzed in the host configuration. This configuration is not what + * implemented, CcToolchain is analyzed in the exec configuration. This configuration is not what * should be used by rules using the toolchain. This method should only be used to access stuff - * from CppConfiguration that is identical between host and target (e.g. incompatible flag + * from CppConfiguration that is identical between exec and target (e.g. incompatible flag * values). Don't use it if you don't know what you're doing. * * <p>Once toolchain transitions are implemented, we can safely use the CppConfiguration from the @@ -737,7 +737,7 @@ public CcToolchainVariables getBuildVariables( BuildOptions buildOptions, CppConfiguration cppConfiguration) { if (cppConfiguration.enableCcToolchainResolution()) { - // With platforms, cc toolchain is analyzed in the host configuration, so we cannot reuse + // With platforms, cc toolchain is analyzed in the exec configuration, so we cannot reuse // build variables instance. return CcToolchainProviderHelper.getBuildVariables( buildOptions,
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java index b1e7851..5eb4818 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java
@@ -596,7 +596,7 @@ // This is an assertion check vs. user error because users can't trigger this state. // TODO(b/253313672): uncomment the below and check tests don't fail. This was originally set - // check the host configuration doesn't apply FDO settings. With the host configuration gone + // check the exec configuration doesn't apply FDO settings. With the host configuration gone // we should migrate this check to the exec config. Since there's a chance of breakage it's best // to test this as its own dedicated change. // Verify.verify(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java index 85cf572..4a26b40 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java
@@ -605,7 +605,7 @@ }, help = "By default, the --crosstool_top and --compiler options are also used " - + "for the host configuration. If this flag is provided, Bazel uses the default libc " + + "for the exec configuration. If this flag is provided, Bazel uses the default libc " + "and compiler for the given crosstool_top.") public Label hostCrosstoolTop; @@ -616,7 +616,7 @@ documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = - "Additional options to pass to the C compiler for tools built in the host or exec" + "Additional options to pass to the C compiler for tools built in the exec" + " configurations.") public List<String> hostCoptList; @@ -627,7 +627,7 @@ documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = - "Additional options to pass to C++ compiler for tools built in the host or exec" + "Additional options to pass to C++ compiler for tools built in the exec" + " configurations.") public List<String> hostCxxoptList; @@ -639,7 +639,7 @@ effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = "Additional option to pass to the C compiler when compiling C (but not C++) source files" - + " in the host or exec configurations.") + + " in the exec configurations.") public List<String> hostConlyoptList; @Option( @@ -651,7 +651,7 @@ effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = "Additional options to selectively pass to the C/C++ compiler when " - + "compiling certain files in the host or exec configurations. " + + "compiling certain files in the exec configurations. " + "This option can be passed multiple times. " + "Syntax: regex_filter@option_1,option_2,...,option_n. Where regex_filter stands " + "for a list of include and exclude regular expression patterns (Also see " @@ -671,8 +671,7 @@ documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = - "Additional option to pass to linker when linking tools in the host or exec" - + " configurations.") + "Additional option to pass to linker when linking tools in the exec" + " configurations.") public List<String> hostLinkoptList; @Option( @@ -694,14 +693,14 @@ effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS}, help = "If specified, this setting overrides the libc top-level directory (--grte_top) " - + "for the host configuration.") + + "for the exec configuration.") public Label hostLibcTopLabel; /** See {@link #targetLibcTopLabel} documentation. * */ private static final String TARGET_LIBC_TOP_NOT_YET_SET = "TARGET LIBC TOP NOT YET SET"; /** - * This is a fake option used to pass data from target configuration to the host configuration. + * This is a fake option used to pass data from target configuration to the exec configuration. * It's a horrible hack that will be removed once toolchain-transitions are implemented. * * <p>We want to make sure this stays bound to the top-level configuration (as opposed to a @@ -1217,18 +1216,18 @@ @Override public FragmentOptions getExec() { - CppOptions host = (CppOptions) getDefault(); + CppOptions exec = (CppOptions) getDefault(); - host.crosstoolTop = hostCrosstoolTop; - host.cppCompiler = hostCppCompiler; + exec.crosstoolTop = hostCrosstoolTop; + exec.cppCompiler = hostCppCompiler; // hostLibcTop doesn't default to the target's libcTop. // Only an explicit command-line option will change it. // The default is whatever the host's crosstool (which might have been specified // by --host_crosstool_top, or --crosstool_top as a fallback) says it should be. - host.libcTopLabel = hostLibcTopLabel; + exec.libcTopLabel = hostLibcTopLabel; // TODO(b/129045294): Remove once toolchain-transitions are implemented. - host.targetLibcTopLabel = targetLibcTopLabel; + exec.targetLibcTopLabel = targetLibcTopLabel; // -g0 is the default, but allowMultiple options cannot have default values so we just pass // -g0 first and let the user options override it. @@ -1240,58 +1239,58 @@ coptListBuilder.add("-g0"); cxxoptListBuilder.add("-g0"); } - host.experimentalLinkStaticLibrariesOnce = experimentalLinkStaticLibrariesOnce; - host.experimentalEnableTargetExportCheck = experimentalEnableTargetExportCheck; - host.experimentalCcSharedLibraryDebug = experimentalCcSharedLibraryDebug; - host.experimentalCcImplementationDeps = experimentalCcImplementationDeps; + exec.experimentalLinkStaticLibrariesOnce = experimentalLinkStaticLibrariesOnce; + exec.experimentalEnableTargetExportCheck = experimentalEnableTargetExportCheck; + exec.experimentalCcSharedLibraryDebug = experimentalCcSharedLibraryDebug; + exec.experimentalCcImplementationDeps = experimentalCcImplementationDeps; - host.coptList = coptListBuilder.addAll(hostCoptList).build(); - host.cxxoptList = cxxoptListBuilder.addAll(hostCxxoptList).build(); - host.conlyoptList = ImmutableList.copyOf(hostConlyoptList); - host.perFileCopts = ImmutableList.copyOf(hostPerFileCoptsList); - host.linkoptList = ImmutableList.copyOf(hostLinkoptList); + exec.coptList = coptListBuilder.addAll(hostCoptList).build(); + exec.cxxoptList = cxxoptListBuilder.addAll(hostCxxoptList).build(); + exec.conlyoptList = ImmutableList.copyOf(hostConlyoptList); + exec.perFileCopts = ImmutableList.copyOf(hostPerFileCoptsList); + exec.linkoptList = ImmutableList.copyOf(hostLinkoptList); - host.useStartEndLib = useStartEndLib; - host.stripBinaries = StripMode.ALWAYS; - host.inmemoryDotdFiles = inmemoryDotdFiles; + exec.useStartEndLib = useStartEndLib; + exec.stripBinaries = StripMode.ALWAYS; + exec.inmemoryDotdFiles = inmemoryDotdFiles; - host.disableExpandIfAllAvailableInFlagSet = disableExpandIfAllAvailableInFlagSet; - host.disableLegacyCcProvider = disableLegacyCcProvider; - host.removeCpuCompilerCcToolchainAttributes = removeCpuCompilerCcToolchainAttributes; - host.enableCcToolchainResolution = enableCcToolchainResolution; - host.removeLegacyWholeArchive = removeLegacyWholeArchive; - host.dontEnableHostNonhost = dontEnableHostNonhost; - host.requireCtxInConfigureFeatures = requireCtxInConfigureFeatures; - host.useStandaloneLtoIndexingCommandLines = useStandaloneLtoIndexingCommandLines; - host.useSpecificToolFiles = useSpecificToolFiles; - host.disableNoCopts = disableNoCopts; - host.loadCcRulesFromBzl = loadCcRulesFromBzl; - host.validateTopLevelHeaderInclusions = validateTopLevelHeaderInclusions; - host.parseHeadersSkippedIfCorrespondingSrcsFound = parseHeadersSkippedIfCorrespondingSrcsFound; - host.strictSystemIncludes = strictSystemIncludes; - host.useArgsParamsFile = useArgsParamsFile; - host.ignoreParamFile = ignoreParamFile; - host.experimentalIncludeScanning = experimentalIncludeScanning; - host.renameDLL = renameDLL; - host.enableCcTestFeature = enableCcTestFeature; - host.forceStrictHeaderCheckFromStarlark = forceStrictHeaderCheckFromStarlark; - host.useCppCompileHeaderMnemonic = useCppCompileHeaderMnemonic; + exec.disableExpandIfAllAvailableInFlagSet = disableExpandIfAllAvailableInFlagSet; + exec.disableLegacyCcProvider = disableLegacyCcProvider; + exec.removeCpuCompilerCcToolchainAttributes = removeCpuCompilerCcToolchainAttributes; + exec.enableCcToolchainResolution = enableCcToolchainResolution; + exec.removeLegacyWholeArchive = removeLegacyWholeArchive; + exec.dontEnableHostNonhost = dontEnableHostNonhost; + exec.requireCtxInConfigureFeatures = requireCtxInConfigureFeatures; + exec.useStandaloneLtoIndexingCommandLines = useStandaloneLtoIndexingCommandLines; + exec.useSpecificToolFiles = useSpecificToolFiles; + exec.disableNoCopts = disableNoCopts; + exec.loadCcRulesFromBzl = loadCcRulesFromBzl; + exec.validateTopLevelHeaderInclusions = validateTopLevelHeaderInclusions; + exec.parseHeadersSkippedIfCorrespondingSrcsFound = parseHeadersSkippedIfCorrespondingSrcsFound; + exec.strictSystemIncludes = strictSystemIncludes; + exec.useArgsParamsFile = useArgsParamsFile; + exec.ignoreParamFile = ignoreParamFile; + exec.experimentalIncludeScanning = experimentalIncludeScanning; + exec.renameDLL = renameDLL; + exec.enableCcTestFeature = enableCcTestFeature; + exec.forceStrictHeaderCheckFromStarlark = forceStrictHeaderCheckFromStarlark; + exec.useCppCompileHeaderMnemonic = useCppCompileHeaderMnemonic; // Save host options for further use. - host.hostCoptList = hostCoptList; - host.hostConlyoptList = hostConlyoptList; - host.hostCppCompiler = hostCppCompiler; - host.hostCrosstoolTop = hostCrosstoolTop; - host.hostCxxoptList = hostCxxoptList; - host.hostPerFileCoptsList = hostPerFileCoptsList; - host.hostLibcTopLabel = hostLibcTopLabel; - host.hostLinkoptList = hostLinkoptList; + exec.hostCoptList = hostCoptList; + exec.hostConlyoptList = hostConlyoptList; + exec.hostCppCompiler = hostCppCompiler; + exec.hostCrosstoolTop = hostCrosstoolTop; + exec.hostCxxoptList = hostCxxoptList; + exec.hostPerFileCoptsList = hostPerFileCoptsList; + exec.hostLibcTopLabel = hostLibcTopLabel; + exec.hostLinkoptList = hostLinkoptList; - host.experimentalStarlarkCcImport = experimentalStarlarkCcImport; + exec.experimentalStarlarkCcImport = experimentalStarlarkCcImport; - host.macosSetInstallName = macosSetInstallName; + exec.macosSetInstallName = macosSetInstallName; - return host; + return exec; } /** Returns true if targets under this configuration should apply FDO. */
diff --git a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionRule.java b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionRule.java index 4489bfc..f693de5 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/extra/ExtraActionRule.java
@@ -45,7 +45,7 @@ <p> The build system ensures these prerequisites are built before running the <code>extra_action</code> command; they are built using the - <a href='${link user-manual#configurations}'><code>host</code>configuration</a>, + <a href='${link user-manual#configurations}'><code>exec</code>configuration</a>, since they must run as a tool during the build itself. The path of an individual <code>tools</code> target <code>//x:y</code> can be obtained using <code>$(location //x:y)</code>.
diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java index 2c8c086..09533e3 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java
@@ -257,18 +257,18 @@ CompositeRunfilesSupplier.fromSuppliers(commandHelper.getToolsRunfilesSuppliers()), progressMessage)); - RunfilesProvider runfilesProvider = RunfilesProvider.withData( - // No runfiles provided if not a data dependency. - Runfiles.EMPTY, - // We only need to consider the outputs of a genrule - // No need to visit the dependencies of a genrule. They cross from the target into the host - // configuration, because the dependencies of a genrule are always built for the host - // configuration. - new Runfiles.Builder( - ruleContext.getWorkspaceName(), - ruleContext.getConfiguration().legacyExternalRunfiles()) - .addTransitiveArtifacts(filesToBuild) - .build()); + RunfilesProvider runfilesProvider = + RunfilesProvider.withData( + // No runfiles provided if not a data dependency. + Runfiles.EMPTY, + // We only need to consider the outputs of a genrule. No need to visit the dependencies + // of a genrule. They cross from the target into the exec configuration, because the + // dependencies of a genrule are always built for the exec configuration. + new Runfiles.Builder( + ruleContext.getWorkspaceName(), + ruleContext.getConfiguration().legacyExternalRunfiles()) + .addTransitiveArtifacts(filesToBuild) + .build()); return new RuleConfiguredTargetBuilder(ruleContext) .setFilesToBuild(filesToBuild)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java index a095d8c..c256bcb 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java
@@ -70,7 +70,7 @@ <a href="${link build-ref#deps}">dependencies</a> for more information. <br/> <p> The build system ensures these prerequisites are built before running the genrule command; - they are built using the <a href='${link guide#configurations}'><i>host</i> + they are built using the <a href='${link guide#configurations}'><i>exec</i> configuration</a>, since these tools are executed as part of the build. The path of an individual <code>tools</code> target <code>//x:y</code> can be obtained using <code>$(location //x:y)</code>. @@ -88,10 +88,10 @@ /* <!-- #BLAZE_RULE(genrule).ATTRIBUTE(exec_tools) --> A list of <i>tool</i> dependencies for this rule. This behaves exactly like the <a href="#genrule.tools"><code>tools</code></a> attribute, except that these dependencies - will be configured for the rule's execution platform instead of the host configuration. + will be configured for the rule's execution platform instead of the exec configuration. This means that dependencies in <code>exec_tools</code> are not subject to the same limitations as dependencies in <code>tools</code>. In particular, they are not required to - use the host configuration for their own transitive dependencies. See + use the exec configuration for their own transitive dependencies. See <a href="#genrule.tools"><code>tools</code></a> for further details. <p> @@ -144,7 +144,7 @@ <li> Next, <a href="${link make-variables}">"Make" variables</a> are expanded. Note that predefined variables <code>$(JAVA)</code>, <code>$(JAVAC)</code> and - <code>$(JAVABASE)</code> expand under the <i>host</i> configuration, so Java invocations + <code>$(JAVABASE)</code> expand under the <i>exec</i> configuration, so Java invocations that run as part of a build step can correctly load shared libraries and other dependencies. </li>
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java index c3c2f2a..62f219b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaOptions.java
@@ -485,10 +485,9 @@ help = "Roll-out flag for making java_proto_library propagate CcLinkParamsStore. DO NOT USE.") public boolean jplPropagateCcLinkParamsStore; - // Plugins are built using the host config. To avoid cycles we just don't propagate - // this option to the host config. If one day we decide to use plugins when building - // host tools, we can improve this by (for example) creating a compiler configuration that is - // used only for building plugins. + // Plugins are built using the exec config. To avoid cycles we just don't propagate this option to + // the exec config. If one day we decide to use plugins when building exec tools, we can improve + // this by (for example) creating a compiler configuration that is used only for building plugins. @Option( name = "plugin", converter = LabelListConverter.class, @@ -613,70 +612,69 @@ @Override public FragmentOptions getExec() { - // Note validation actions don't run in host config, so no need copying flags related to that. - // TODO(b/171078539): revisit if relevant validations are run in host config - JavaOptions host = (JavaOptions) getDefault(); + // Note validation actions don't run in exec config, so no need copying flags related to that. + // TODO(b/171078539): revisit if relevant validations are run in exec config + JavaOptions exec = (JavaOptions) getDefault(); if (hostJvmOpts == null || hostJvmOpts.isEmpty()) { - host.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr"); + exec.jvmOpts = ImmutableList.of("-XX:ErrorFile=/dev/stderr"); } else { - host.jvmOpts = hostJvmOpts; + exec.jvmOpts = hostJvmOpts; } + exec.javacOpts = hostJavacOpts; - host.javacOpts = hostJavacOpts; - - host.javaLauncher = hostJavaLauncher; + exec.javaLauncher = hostJavaLauncher; // Java builds often contain complicated code generators for which // incremental build performance is important. - host.useIjars = useIjars; - host.headerCompilation = headerCompilation; + exec.useIjars = useIjars; + exec.headerCompilation = headerCompilation; - host.javaDeps = javaDeps; - host.javaClasspath = javaClasspath; - host.inmemoryJdepsFiles = inmemoryJdepsFiles; + exec.javaDeps = javaDeps; + exec.javaClasspath = javaClasspath; + exec.inmemoryJdepsFiles = inmemoryJdepsFiles; - host.strictJavaDeps = strictJavaDeps; - host.fixDepsTool = fixDepsTool; + exec.strictJavaDeps = strictJavaDeps; + exec.fixDepsTool = fixDepsTool; - host.enforceOneVersion = enforceOneVersion; - host.importDepsCheckingLevel = importDepsCheckingLevel; - // java_test targets can be used as a host tool, Ex: as a validating tool on a genrule. - host.enforceOneVersionOnJavaTests = enforceOneVersionOnJavaTests; - host.allowRuntimeDepsOnNeverLink = allowRuntimeDepsOnNeverLink; - host.addTestSupportToCompileTimeDeps = addTestSupportToCompileTimeDeps; + exec.enforceOneVersion = enforceOneVersion; + exec.importDepsCheckingLevel = importDepsCheckingLevel; + // java_test targets can be used as a exec tool, Ex: as a validating tool on a genrule. + exec.enforceOneVersionOnJavaTests = enforceOneVersionOnJavaTests; + exec.allowRuntimeDepsOnNeverLink = allowRuntimeDepsOnNeverLink; + exec.addTestSupportToCompileTimeDeps = addTestSupportToCompileTimeDeps; - host.jplPropagateCcLinkParamsStore = jplPropagateCcLinkParamsStore; + exec.jplPropagateCcLinkParamsStore = jplPropagateCcLinkParamsStore; - host.disallowResourceJars = disallowResourceJars; + exec.disallowResourceJars = disallowResourceJars; - host.javaRuntimeVersion = hostJavaRuntimeVersion; - host.javaLanguageVersion = hostJavaLanguageVersion; + exec.javaRuntimeVersion = hostJavaRuntimeVersion; + exec.javaLanguageVersion = hostJavaLanguageVersion; - host.bytecodeOptimizers = bytecodeOptimizers; - host.splitBytecodeOptimizationPass = splitBytecodeOptimizationPass; - host.bytecodeOptimizationPassActions = bytecodeOptimizationPassActions; + exec.bytecodeOptimizers = bytecodeOptimizers; + exec.splitBytecodeOptimizationPass = splitBytecodeOptimizationPass; + exec.bytecodeOptimizationPassActions = bytecodeOptimizationPassActions; - host.enforceProguardFileExtension = enforceProguardFileExtension; - host.proguard = proguard; + exec.enforceProguardFileExtension = enforceProguardFileExtension; + exec.proguard = proguard; // Save host options for further use. - host.hostJavacOpts = hostJavacOpts; - host.hostJavaLauncher = hostJavaLauncher; - host.hostJavaRuntimeVersion = hostJavaRuntimeVersion; - host.hostJavaLanguageVersion = hostJavaLanguageVersion; + exec.hostJavacOpts = hostJavacOpts; + exec.hostJavaLauncher = hostJavaLauncher; + exec.hostJavaRuntimeVersion = hostJavaRuntimeVersion; + exec.hostJavaLanguageVersion = hostJavaLanguageVersion; - host.experimentalTurbineAnnotationProcessing = experimentalTurbineAnnotationProcessing; + exec.experimentalTurbineAnnotationProcessing = experimentalTurbineAnnotationProcessing; - host.requireJavaPluginInfo = requireJavaPluginInfo; + exec.requireJavaPluginInfo = requireJavaPluginInfo; - host.multiReleaseDeployJars = multiReleaseDeployJars; + exec.multiReleaseDeployJars = multiReleaseDeployJars; - host.disallowJavaImportExports = disallowJavaImportExports; + exec.disallowJavaImportExports = disallowJavaImportExports; - host.disallowJavaImportEmptyJars = disallowJavaImportEmptyJars; + exec.disallowJavaImportEmptyJars = disallowJavaImportEmptyJars; - return host; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java index 01369f5..d49569b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommandLineOptions.java
@@ -196,11 +196,11 @@ @Override public FragmentOptions getExec() { - ObjcCommandLineOptions host = (ObjcCommandLineOptions) getDefault(); - host.enableCcDeps = enableCcDeps; - host.incompatibleAvoidHardcodedObjcCompilationFlags = + ObjcCommandLineOptions exec = (ObjcCommandLineOptions) getDefault(); + exec.enableCcDeps = enableCcDeps; + exec.incompatibleAvoidHardcodedObjcCompilationFlags = incompatibleAvoidHardcodedObjcCompilationFlags; - host.incompatibleObjcLinkingInfoMigration = incompatibleObjcLinkingInfoMigration; - return host; + exec.incompatibleObjcLinkingInfoMigration = incompatibleObjcLinkingInfoMigration; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java index f0b07ef..86a2eb7 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
@@ -79,7 +79,7 @@ * Creates a new spawn action builder with apple environment variables set that are typically * needed by the apple toolchain. This should be used to start to build spawn actions that, in * order to run, require both a darwin architecture and a collection of environment variables - * which contain information about the target and host architectures. + * which contain information about the target and exec architectures. */ static SpawnAction.Builder spawnAppleEnvActionBuilder( XcodeConfigInfo xcodeConfigInfo, ApplePlatform targetPlatform) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java index f921b10..f90c8f2 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoConfiguration.java
@@ -37,7 +37,7 @@ /** Configuration for Protocol Buffer Libraries. */ @Immutable -// This module needs to be exported to Starlark so it can be passed as a mandatory host/target +// This module needs to be exported to Starlark so it can be passed as a mandatory exec/target // configuration fragment in aspect definitions. @RequiresOptions(options = {ProtoConfiguration.Options.class}) public class ProtoConfiguration extends Fragment implements ProtoConfigurationApi { @@ -184,22 +184,22 @@ @Override public FragmentOptions getExec() { - Options host = (Options) super.getExec(); - host.protoCompiler = protoCompiler; - host.protocOpts = protocOpts; - host.experimentalProtoDescriptorSetsIncludeSourceInfo = + Options exec = (Options) super.getExec(); + exec.protoCompiler = protoCompiler; + exec.protocOpts = protocOpts; + exec.experimentalProtoDescriptorSetsIncludeSourceInfo = experimentalProtoDescriptorSetsIncludeSourceInfo; - host.experimentalProtoExtraActions = experimentalProtoExtraActions; - host.protoToolchainForJava = protoToolchainForJava; - host.protoToolchainForJ2objc = protoToolchainForJ2objc; - host.protoToolchainForJavaLite = protoToolchainForJavaLite; - host.protoToolchainForCc = protoToolchainForCc; - host.strictProtoDeps = strictProtoDeps; - host.strictPublicImports = strictPublicImports; - host.ccProtoLibraryHeaderSuffixes = ccProtoLibraryHeaderSuffixes; - host.ccProtoLibrarySourceSuffixes = ccProtoLibrarySourceSuffixes; - host.generatedProtosInVirtualImports = generatedProtosInVirtualImports; - return host; + exec.experimentalProtoExtraActions = experimentalProtoExtraActions; + exec.protoToolchainForJava = protoToolchainForJava; + exec.protoToolchainForJ2objc = protoToolchainForJ2objc; + exec.protoToolchainForJavaLite = protoToolchainForJavaLite; + exec.protoToolchainForCc = protoToolchainForCc; + exec.strictProtoDeps = strictProtoDeps; + exec.strictPublicImports = strictPublicImports; + exec.ccProtoLibraryHeaderSuffixes = ccProtoLibraryHeaderSuffixes; + exec.ccProtoLibrarySourceSuffixes = ccProtoLibrarySourceSuffixes; + exec.generatedProtosInVirtualImports = generatedProtosInVirtualImports; + return exec; } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonOptions.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonOptions.java index 74675d4..e142ac1 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonOptions.java
@@ -193,7 +193,7 @@ converter = TargetPythonVersionConverter.class, documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS, effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS, OptionEffectTag.AFFECTS_OUTPUTS}, - help = "Overrides the Python version for the host configuration. Can be \"PY2\" or \"PY3\".") + help = "Overrides the Python version for the exec configuration. Can be \"PY2\" or \"PY3\".") public PythonVersion hostForcePython; private static final OptionDefinition HOST_FORCE_PYTHON_DEFINITION =
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java index 53ee0fb..b2b447a 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java
@@ -1284,7 +1284,7 @@ /** * Returns a progress message like: * - * <p>[2608/6445] Compiling foo/bar.cc [host] + * <p>[2608/6445] Compiling foo/bar.cc [exec] */ private String prependExecPhaseStats(String message) { if (progressSupplier == null) {
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AnalysisCachingTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AnalysisCachingTest.java index ed3853d..ed2e7a5 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AnalysisCachingTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AnalysisCachingTest.java
@@ -720,9 +720,9 @@ @Override public DiffResetOptions getExec() { - DiffResetOptions host = ((DiffResetOptions) super.getExec()); - host.definitelyRelevantOption = hostRelevantOption; - return host; + DiffResetOptions exec = ((DiffResetOptions) super.getExec()); + exec.definitelyRelevantOption = hostRelevantOption; + return exec; } }
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java index e03b04f..c5aa465 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectValueTest.java
@@ -58,7 +58,7 @@ ExtraAttributeAspect a2 = TestAspects.EXTRA_ATTRIBUTE_ASPECT; // label: //a:l1 or //a:l2 - // baseConfiguration: target or host + // baseConfiguration: target or exec // aspect: Attribute or ExtraAttribute // parameters: bar or baz
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java b/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java index 39b3e89..9e67ec3 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/DependencyTest.java
@@ -149,7 +149,7 @@ Label aExplicit = Label.parseCanonical("//a:a"); Label b = Label.parseCanonical("//b"); - BuildConfigurationValue host = getExecConfiguration(); + BuildConfigurationValue exec = getExecConfiguration(); BuildConfigurationValue target = getTargetConfiguration(); AspectDescriptor simpleAspect = new AspectDescriptor(TestAspects.SIMPLE_ASPECT); @@ -166,38 +166,38 @@ new EqualsTester() .addEqualityGroup( - // base set: //a, host configuration, normal aspect set - Dependency.builder().setLabel(a).setConfiguration(host).setAspects(twoAspects).build(), + // base set: //a, exec configuration, normal aspect set + Dependency.builder().setLabel(a).setConfiguration(exec).setAspects(twoAspects).build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(twoAspects) .build(), Dependency.builder() .setLabel(a) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(inverseAspects) .build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(inverseAspects) .build(), - Dependency.builder().setLabel(a).setConfiguration(host).setAspects(twoAspects).build(), + Dependency.builder().setLabel(a).setConfiguration(exec).setAspects(twoAspects).build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(twoAspects) .build()) .addEqualityGroup( // base set but with label //b - Dependency.builder().setLabel(b).setConfiguration(host).setAspects(twoAspects).build(), + Dependency.builder().setLabel(b).setConfiguration(exec).setAspects(twoAspects).build(), Dependency.builder() .setLabel(b) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(inverseAspects) .build(), - Dependency.builder().setLabel(b).setConfiguration(host).setAspects(twoAspects).build()) + Dependency.builder().setLabel(b).setConfiguration(exec).setAspects(twoAspects).build()) .addEqualityGroup( // base set but with target configuration Dependency.builder() @@ -238,22 +238,22 @@ // base set but with different aspects Dependency.builder() .setLabel(a) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build(), Dependency.builder() .setLabel(a) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build()) .addEqualityGroup( @@ -280,12 +280,12 @@ // base set but with label //b and different aspects Dependency.builder() .setLabel(b) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build(), Dependency.builder() .setLabel(b) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(differentAspects) .build()) .addEqualityGroup( @@ -324,25 +324,25 @@ .build()) .addEqualityGroup( // base set but with no aspects - Dependency.builder().setLabel(a).setConfiguration(host).build(), - Dependency.builder().setLabel(aExplicit).setConfiguration(host).build(), - Dependency.builder().setLabel(a).setConfiguration(host).setAspects(noAspects).build(), + Dependency.builder().setLabel(a).setConfiguration(exec).build(), + Dependency.builder().setLabel(aExplicit).setConfiguration(exec).build(), + Dependency.builder().setLabel(a).setConfiguration(exec).setAspects(noAspects).build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(noAspects) .build(), - Dependency.builder().setLabel(a).setConfiguration(host).setAspects(noAspects).build(), + Dependency.builder().setLabel(a).setConfiguration(exec).setAspects(noAspects).build(), Dependency.builder() .setLabel(aExplicit) - .setConfiguration(host) + .setConfiguration(exec) .setAspects(noAspects) .build()) .addEqualityGroup( // base set but with label //b and no aspects - Dependency.builder().setLabel(b).setConfiguration(host).build(), - Dependency.builder().setLabel(b).setConfiguration(host).setAspects(noAspects).build(), - Dependency.builder().setLabel(b).setConfiguration(host).setAspects(noAspects).build()) + Dependency.builder().setLabel(b).setConfiguration(exec).build(), + Dependency.builder().setLabel(b).setConfiguration(exec).setAspects(noAspects).build(), + Dependency.builder().setLabel(b).setConfiguration(exec).setAspects(noAspects).build()) .addEqualityGroup( // base set but with target configuration and no aspects Dependency.builder().setLabel(a).setConfiguration(target).build(),
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/OutputFileConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/analysis/OutputFileConfiguredTargetTest.java index 18fddc2..c000d1c 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/OutputFileConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/OutputFileConfiguredTargetTest.java
@@ -17,9 +17,6 @@ import com.google.devtools.build.lib.analysis.configuredtargets.OutputFileConfiguredTarget; import com.google.devtools.build.lib.analysis.util.BuildViewTestBase; -import com.google.devtools.build.lib.skyframe.BuildConfigurationFunction; -import com.google.devtools.build.lib.skyframe.ConfiguredTargetAndData; -import com.google.devtools.build.lib.skyframe.SkyframeBuildView; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -43,71 +40,4 @@ assertThat(generatedSource.getGeneratingRule()) .isSameInstanceAs(getConfiguredTarget("//foo:generating_rule", getExecConfiguration())); } - - /** - * Bazel maintains a host configuration cache that stores configurations instantiated outside of - * Skyframe. We shouldn't, in general, instantiate configurations outside of {@link - * BuildConfigurationFunction}. But in this specific case Bazel performance suffers through the - * Skyframe interface and maintaining a local cache is much faster. See {@link SkyframeBuildView} - * for details. - * - * <p>One consequence of this is that requesting a config that would be a Skyframe cache hit can - * still produce a distinct instance. Meaning you can get cases where {@code - * config1.equals(config2) && config1 != config2}. - * - * <p>This test checks for such a case: perform three consecutive Bazel builds. The first builds - * with default options, producing top-level host config H1 and configured target - * <host_generated_file_producer, H1>. The second builds with {@code --host_copt=a=b}, producing - * host config H2 (and clearing the top-level host config cache since the host config changed). - * The third builds back with default options. This once again clears the host config cache, since - * the host config changed again. So that cache creates a new config H3 where H3.equals(H1) and - * instantiates new configured target <host_src3.cc, H3>. It then requests dependency - * <host_generated_file_producer, H3> from Skyframe, but the Skyframe SkyKey interner reduces this - * to the previously seen <host_generated_file_producer, H1> and returns that instead. - * - * <p>This produces the expected scenario where the output file's config is value-equal but not - * reference-equal to its generating rule's config. - */ - @Test - public void hostConfigSwitch() throws Exception { - scratch.file( - "foo/BUILD", - "genrule(", - " name = 'host_generated_file_producer',", - " srcs = [],", - " outs = [", - " 'host_src1.cc',", - " 'host_src2.cc',", - " 'host_src3.cc',", - " ],", - " cmd = 'echo hi > $(location host_src1.cc); echo hi > $(location host_src2.cc); " - + "echo hi > $(location host_src3.cc)')", - "", - "cc_binary(name = 'host_generated_file_consumer1', srcs = ['host_src1.cc'])", - "cc_binary(name = 'host_generated_file_consumer2', srcs = ['host_src2.cc'])", - "cc_binary(name = 'host_generated_file_consumer3', srcs = ['host_src3.cc'])", - "", - "genrule(name = 'gen1', srcs = [], outs = ['gen1.out'], cmd = 'echo hi > $@',", - " tools = [':host_generated_file_consumer1'])", - "genrule(name = 'gen2', srcs = [], outs = ['gen2.out'], cmd = 'echo hi > $@',", - " tools = [':host_generated_file_consumer2'])", - "genrule(name = 'gen3', srcs = [], outs = ['gen3.out'], cmd = 'echo hi > $@',", - " tools = [':host_generated_file_consumer3'])"); - - useConfiguration(); - update("//foo:gen1"); - useConfiguration("--host_copt", "a=b"); - update("//foo:gen2"); - useConfiguration(); - update("//foo:gen3"); - - ConfiguredTargetAndData hostSrc3 = - getConfiguredTargetAndData("//foo:host_src3.cc", getExecConfiguration()); - ConfiguredTarget hostGeneratedFileConsumer3 = - ((OutputFileConfiguredTarget) hostSrc3.getConfiguredTarget()).getGeneratingRule(); - assertThat(hostSrc3.getConfiguration()).isEqualTo(getConfiguration(hostGeneratedFileConsumer3)); - // TODO(gregce): enable below for Bazel tests, which for some reason realize the same instance - // assertThat(hostSrc3.getConfiguration()) - // .isNotSameAs(hostGeneratedFileConsumer3.getConfiguration()); - } }
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValueTest.java b/src/test/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValueTest.java index 1eb7ab4..cf4f221 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValueTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/config/BuildConfigurationValueTest.java
@@ -96,8 +96,8 @@ assertThat(config.getFragment(CppConfiguration.class).getRuleProvidingCcToolchainProvider()) .isEqualTo(Label.parseAbsoluteUnchecked("//tools/cpp:toolchain")); - BuildConfigurationValue hostConfig = createExec(); - assertThat(hostConfig.getFragment(CppConfiguration.class).getRuleProvidingCcToolchainProvider()) + BuildConfigurationValue execConfig = createExec(); + assertThat(execConfig.getFragment(CppConfiguration.class).getRuleProvidingCcToolchainProvider()) .isEqualTo(Label.parseAbsoluteUnchecked("//tools/cpp:toolchain")); } @@ -233,7 +233,7 @@ } @Test - public void testHostDefine() throws Exception { + public void testExecDefine() throws Exception { BuildConfigurationValue cfg = createExec("--define=foo=bar"); assertThat(cfg.getCommandLineBuildVariables().get("foo")).isEqualTo("bar"); } @@ -253,11 +253,11 @@ @Test public void testIncompatibleMergeGenfilesDirectory() throws Exception { BuildConfigurationValue target = create("--incompatible_merge_genfiles_directory"); - BuildConfigurationValue host = createExec("--incompatible_merge_genfiles_directory"); + BuildConfigurationValue exec = createExec("--incompatible_merge_genfiles_directory"); assertThat(target.getGenfilesDirectory(RepositoryName.MAIN)) .isEqualTo(target.getBinDirectory(RepositoryName.MAIN)); - assertThat(host.getGenfilesDirectory(RepositoryName.MAIN)) - .isEqualTo(host.getBinDirectory(RepositoryName.MAIN)); + assertThat(exec.getGenfilesDirectory(RepositoryName.MAIN)) + .isEqualTo(exec.getBinDirectory(RepositoryName.MAIN)); } private ImmutableList<BuildConfigurationValue> getTestConfigurations() throws Exception {
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java index a690484..c57d333 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/constraints/ConstraintsTest.java
@@ -584,23 +584,6 @@ } @Test - public void constraintEnforcementDisabledHostConfig() throws Exception { - useConfiguration("--enforce_constraints=0"); - new EnvironmentGroupMaker("buildenv/foo").setEnvironments("a", "b", "c").setDefaults().make(); - scratch.file("hello/BUILD", - "genrule(", - " name = 'gen',", - " srcs = [],", - " outs = ['gen.out'],", - " cmd = '',", - " tools = [':main'])", - getDependencyRule(), - getDependingRule(compatibleWith("//buildenv/foo:a"))); - assertThat(getConfiguredTarget("//hello:gen")).isNotNull(); - assertNoEvents(); - } - - @Test public void constraintEnforcementDisabledExecConfig() throws Exception { useConfiguration("--enforce_constraints=0"); new EnvironmentGroupMaker("buildenv/foo").setEnvironments("a", "b", "c").setDefaults().make(); @@ -653,8 +636,8 @@ } /** - * Tests that package defaults restriction produces an valid dependency that would otherwise - * be invalid. + * Tests that package defaults restriction produces a valid dependency that would otherwise be + * invalid. */ @Test public void restrictionPackageDefaults() throws Exception {
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java index 10706c5..b04838c 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/AnalysisTestCase.java
@@ -307,7 +307,7 @@ } /** - * Sets host and target configuration using the specified options, falling back to the default + * Sets exec and target configuration using the specified options, falling back to the default * options for unspecified ones, and recreates the build view. */ public void useConfiguration(String... args) throws Exception {
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleConfiguredTargetTest.java index 483eac6..c9fdbed 100644 --- a/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/bazel/rules/genrule/GenRuleConfiguredTargetTest.java
@@ -393,7 +393,7 @@ } @Test - public void testToolsAreHostConfiguration() throws Exception { + public void testToolsAreExecConfiguration() throws Exception { scratch.file( "config/BUILD", "genrule(name='src', outs=['src.out'], cmd=':')",
diff --git a/src/test/java/com/google/devtools/build/lib/buildtool/ProgressReportingTest.java b/src/test/java/com/google/devtools/build/lib/buildtool/ProgressReportingTest.java index e825a1a..1500274 100644 --- a/src/test/java/com/google/devtools/build/lib/buildtool/ProgressReportingTest.java +++ b/src/test/java/com/google/devtools/build/lib/buildtool/ProgressReportingTest.java
@@ -78,7 +78,7 @@ } /** - * Tests that [for tool] tags are added to the progress messages of actions in the host + * Tests that [for tool] tags are added to the progress messages of actions in the exec * configuration, but not in the target configuration. */ @Test
diff --git a/src/test/java/com/google/devtools/build/lib/packages/AttributeTest.java b/src/test/java/com/google/devtools/build/lib/packages/AttributeTest.java index 31c21f6..afeff05 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/AttributeTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/AttributeTest.java
@@ -275,7 +275,7 @@ } @Test - public void testHostTransition() throws Exception { + public void testExecTransition() throws Exception { Attribute attr = attr("foo", LABEL).cfg(ExecutionTransitionFactory.create()).allowedFileTypes().build(); assertThat(attr.getTransitionFactory().isTool()).isTrue();
diff --git a/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java b/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java index ec3d6f2..d1a77dc 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java +++ b/src/test/java/com/google/devtools/build/lib/packages/util/MockPlatformSupport.java
@@ -21,7 +21,7 @@ /** Mocking support for platforms and toolchains. */ public class MockPlatformSupport { - /** Adds mocks for basic host and target platform. */ + /** Adds mocks for basic exec and target platform. */ public static void setup(MockToolsConfig mockToolsConfig) throws IOException { setup( mockToolsConfig, @@ -32,7 +32,7 @@ TestConstants.LOCAL_CONFIG_PLATFORM_PATH); } - /** Adds mocks for basic host and target platform. */ + /** Adds mocks for basic exec and target platform. */ public static void setup( MockToolsConfig mockToolsConfig, String platformsPath,
diff --git a/src/test/java/com/google/devtools/build/lib/query2/cquery/GraphOutputFormatterCallbackTest.java b/src/test/java/com/google/devtools/build/lib/query2/cquery/GraphOutputFormatterCallbackTest.java index e1a735e..2e96a44 100644 --- a/src/test/java/com/google/devtools/build/lib/query2/cquery/GraphOutputFormatterCallbackTest.java +++ b/src/test/java/com/google/devtools/build/lib/query2/cquery/GraphOutputFormatterCallbackTest.java
@@ -52,7 +52,7 @@ " implementation = _impl,", " attrs = {", " 'deps': attr.label_list(allow_files = True),", - " 'host_deps': attr.label_list(cfg = 'exec')", + " 'tool_deps': attr.label_list(cfg = 'exec')", " }", ")"); writeFile("defs/BUILD"); @@ -149,21 +149,20 @@ "}")); } - // TODO(b/203203933): Replace "host" with "exec" throughout this test. @Test - public void nullAndHostDeps() throws Exception { + public void nullAndToolDeps() throws Exception { writeFile( "test/BUILD", "load('//defs:defs.bzl', 'simple_rule')", - "simple_rule(name = 'a', deps = [':b', ':file.src'], host_deps = [':host_dep'])", + "simple_rule(name = 'a', deps = [':b', ':file.src'], tool_deps = [':tool_dep'])", "simple_rule(name = 'b')", - "simple_rule(name = 'host_dep')"); + "simple_rule(name = 'tool_dep')"); writeFile("test/file.src"); List<String> output = getOutput("deps(//test:a)"); String firstNode = output.get(2); String configHash = firstNode.substring(firstNode.indexOf("(") + 1, firstNode.length() - 2); - String hostNode = output.get(6); - String execConfigHash = hostNode.substring(hostNode.indexOf("(") + 1, hostNode.length() - 2); + String toolNode = output.get(6); + String execConfigHash = toolNode.substring(toolNode.indexOf("(") + 1, toolNode.length() - 2); assertThat(getOutput("deps(//test:a)")) .isEqualTo( withConfigHash( @@ -173,8 +172,8 @@ " \"//test:a (%s)\"", " \"//test:a (%s)\" -> \"//test:b (%s)\"", " \"//test:a (%s)\" -> \"//test:file.src (null)\"", - " \"//test:a (%s)\" -> \"//test:host_dep (" + execConfigHash + ")\"", - " \"//test:host_dep (" + execConfigHash + ")\"", + " \"//test:a (%s)\" -> \"//test:tool_dep (" + execConfigHash + ")\"", + " \"//test:tool_dep (" + execConfigHash + ")\"", " \"//test:file.src (null)\"", " \"//test:b (%s)\"", "}"));
diff --git a/src/test/java/com/google/devtools/build/lib/rules/config/FeatureFlagManualTrimmingTest.java b/src/test/java/com/google/devtools/build/lib/rules/config/FeatureFlagManualTrimmingTest.java index f7aef9a..4495212 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/config/FeatureFlagManualTrimmingTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/config/FeatureFlagManualTrimmingTest.java
@@ -653,7 +653,7 @@ } @Test - public void featureFlagInHostConfiguration_HasDefaultValue() throws Exception { + public void featureFlagInExecConfiguration_hasDefaultValue() throws Exception { scratch.file( "test/BUILD", "load(':host_transition.bzl', 'host_transition')", @@ -690,7 +690,7 @@ } @Test - public void featureFlagInHostConfiguration_HasNoTransitiveConfigEnforcement() throws Exception { + public void featureFlagInExecConfiguration_hasNoTransitiveConfigEnforcement() throws Exception { scratch.file( "test/BUILD", "load(':host_transition.bzl', 'host_transition')",
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcHostToolchainAliasTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcHostToolchainAliasTest.java index f3d6129..94980ad 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcHostToolchainAliasTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcHostToolchainAliasTest.java
@@ -27,7 +27,7 @@ public class CcHostToolchainAliasTest extends BuildViewTestCase { @Test - public void testCcHostToolchainAliasRuleHasHostConfiguration() throws Exception { + public void testCcHostToolchainAliasRuleHasExecConfiguration() throws Exception { scratch.file("a/BUILD", "cc_host_toolchain_alias(name='current_cc_host_toolchain')"); ConfiguredTarget target = getConfiguredTarget("//a:current_cc_host_toolchain");
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppSysrootTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppSysrootTest.java index bb3430a..2b0fc12 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppSysrootTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppSysrootTest.java
@@ -71,10 +71,10 @@ "--host_grte_top=//a/grte/top", "--noincompatible_enable_cc_toolchain_resolution"); BuildConfigurationValue target = getTargetConfiguration(); CcToolchainProvider targetCcProvider = getCcToolchainProvider(target); - BuildConfigurationValue host = getExecConfiguration(); - CcToolchainProvider hostCcProvider = getCcToolchainProvider(host); + BuildConfigurationValue exec = getExecConfiguration(); + CcToolchainProvider hostCcProvider = getCcToolchainProvider(exec); - testCCFlagsContainsSysroot(host, "a/grte/top", true); + testCCFlagsContainsSysroot(exec, "a/grte/top", true); assertThat(hostCcProvider.getSysroot().equals(targetCcProvider.getSysroot())).isFalse(); } @@ -88,16 +88,16 @@ "--noincompatible_enable_cc_toolchain_resolution"); BuildConfigurationValue target = getTargetConfiguration(); CcToolchainProvider targetCcProvider = getCcToolchainProvider(target); - BuildConfigurationValue host = getExecConfiguration(); - CcToolchainProvider hostCcProvider = getCcToolchainProvider(host); + BuildConfigurationValue exec = getExecConfiguration(); + CcToolchainProvider hostCcProvider = getCcToolchainProvider(exec); assertThat(targetCcProvider.getSysroot()).isEqualTo("a/grte/top"); assertThat(hostCcProvider.getSysroot()).isEqualTo("b/grte/top"); testCCFlagsContainsSysroot(target, "a/grte/top", true); testCCFlagsContainsSysroot(target, "b/grte/top", false); - testCCFlagsContainsSysroot(host, "b/grte/top", true); - testCCFlagsContainsSysroot(host, "a/grte/top", false); + testCCFlagsContainsSysroot(exec, "b/grte/top", true); + testCCFlagsContainsSysroot(exec, "a/grte/top", false); } @Test @@ -155,14 +155,14 @@ } @Test - public void testSysrootWithHostConfig() throws Exception { - // The host BuildConfigurationValue shouldn't provide a sysroot option by default. + public void testSysrootWithExecConfig() throws Exception { + // The exec BuildConfigurationValue shouldn't provide a sysroot option by default. for (String cpu : new String[] {"piii", "k8"}) { useConfiguration("--cpu=" + cpu, "--noincompatible_enable_cc_toolchain_resolution"); BuildConfigurationValue config = getExecConfiguration(); testCCFlagsContainsSysroot(config, "/usr/grte/v1", true); } - // The host BuildConfigurationValue should work with label grte_top options. + // The exec BuildConfigurationValue should work with label grte_top options. scratch.file("a/grte/top/BUILD", "filegroup(name='everything')"); for (String cpu : new String[] {"piii", "k8"}) { useConfiguration( @@ -172,7 +172,7 @@ BuildConfigurationValue config = getExecConfiguration(); testCCFlagsContainsSysroot(config, "a/grte/top", true); - // "--grte_top" does *not* set the host grte_top, + // "--grte_top" does *not* set the exec grte_top, // so we don't get "a/grte/top" here, but instead the default "/usr/grte/v1" useConfiguration( "--cpu=" + cpu, @@ -181,7 +181,7 @@ config = getExecConfiguration(); testCCFlagsContainsSysroot(config, "/usr/grte/v1", true); - // If a host_crosstool_top is set, we shouldn't see the grte_top option in the host config. + // If a host_crosstool_top is set, we shouldn't see the grte_top option in the exec config. // (Assuming there was not also a --host_grte_top specified) useConfiguration( "--cpu=" + cpu,
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java index 074e737..29bd787 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java
@@ -149,8 +149,8 @@ OrderedSetMultimap<DependencyKind, ConfiguredTargetAndData> depMap = ConfiguredTargetFunction.computeDependencies( new ConfiguredTargetFunction.ComputeDependenciesState(), - /*transitivePackagesForPackageRootResolution=*/ null, - /*transitiveRootCauses=*/ NestedSetBuilder.stableOrder(), + /* transitivePackages= */ null, + /* transitiveRootCauses= */ NestedSetBuilder.stableOrder(), env, new SkyframeDependencyResolver(env), targetAndConfiguration, @@ -317,12 +317,7 @@ } } - /** - * Tests dependencies in attribute with host transition. - * - * <p>Note: This cannot be used to test exec transition, because mocks don't set up toolchain - * contexts. - */ + /** Tests dependencies in attribute with exec transition. */ @Test public void execDeps() throws Exception { scratch.file(
diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java index 0a4ee3d..db8a155 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkIntegrationTest.java
@@ -1219,7 +1219,7 @@ " 'srcs': attr.label_list(allow_files = True),", " 'wrapped': attr.label(mandatory = True),", " 'wrapped_list': attr.label_list(),", - // Host deps aren't forwarded by default, since they don't provide code/binaries executed + // Exec deps aren't forwarded by default, since they don't provide code/binaries executed // at runtime. " 'tool': attr.label(cfg = 'exec', executable = True, mandatory = True),", " })");
diff --git a/src/test/java/com/google/devtools/build/lib/view/java/JavaConfigurationTest.java b/src/test/java/com/google/devtools/build/lib/view/java/JavaConfigurationTest.java index c19e5e0..2c7d686 100644 --- a/src/test/java/com/google/devtools/build/lib/view/java/JavaConfigurationTest.java +++ b/src/test/java/com/google/devtools/build/lib/view/java/JavaConfigurationTest.java
@@ -53,8 +53,8 @@ .isEqualTo( Label.parseAbsoluteUnchecked(TestConstants.TOOLS_REPOSITORY + "//tools/cpp:toolchain")); - BuildConfigurationValue hostConfig = createExec(); - assertThat(hostConfig.getFragment(CppConfiguration.class).getRuleProvidingCcToolchainProvider()) + BuildConfigurationValue execConfig = createExec(); + assertThat(execConfig.getFragment(CppConfiguration.class).getRuleProvidingCcToolchainProvider()) .isEqualTo( Label.parseAbsoluteUnchecked(TestConstants.TOOLS_REPOSITORY + "//tools/cpp:toolchain")); }