diff --git a/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java b/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java index c64f1185ce0218..4a0526fcfed75c 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/StarlarkAttrTransitionProviderTest.java @@ -2257,7 +2257,7 @@ public void testBuildSettingTransitionsWorkWithExecTransitions() throws Exceptio " srcs = [],", " outs = ['with_exec_tool.out'],", " cmd = 'echo hi > $@',", - " exec_tools = [':int_reader'])", + " tools = [':int_reader'])", "int_flag_reading_rule(", " name = 'int_reader',", " out = 'int_reader.out')", 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 83c253aaa5726b..2a68451cae2859 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 @@ -596,7 +596,7 @@ public void constraintEnforcementDisabledExecConfig() throws Exception { " srcs = [],", " outs = ['gen.out'],", " cmd = '',", - " exec_tools = [':main'])", + " tools = [':main'])", getDependencyRule(), getDependingRule(compatibleWith("//buildenv/foo:a"))); assertThat(getConfiguredTarget("//hello:gen")).isNotNull(); @@ -740,15 +740,15 @@ public void execDependenciesAreNotChecked() throws Exception { new EnvironmentGroupMaker("buildenv/foo").setEnvironments("a", "b").setDefaults("a").make(); scratch.file( "hello/BUILD", - "sh_binary(name = 'host_tool',", - " srcs = ['host_tool.sh'],", + "sh_binary(name = 'tool',", + " srcs = ['tool.sh'],", " restricted_to = ['//buildenv/foo:b'])", "genrule(", " name = 'hello',", " srcs = [],", " outs = ['hello.out'],", " cmd = '',", - " exec_tools = [':host_tool'],", + " tools = [':tool'],", " compatible_with = ['//buildenv/foo:a'])"); assertThat(getConfiguredTarget("//hello:hello")).isNotNull(); assertNoEvents(); 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 b0ee1a43077151..5a14522976a023 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 @@ -617,22 +617,22 @@ public void testDuplicateLocalFlags() throws Exception { } @Test - public void testExecToolsAreExecConfiguration() throws Exception { + public void testToolsHaveExecOutputDir() throws Exception { scratch.file( "config/BUILD", "genrule(name='src', outs=['src.out'], cmd=':')", - "genrule(name='exec_tool', outs=['exec_tool.out'], cmd=':')", + "genrule(name='tool', outs=['tool.out'], cmd=':')", "genrule(name='config', ", - " srcs=[':src'], exec_tools=[':exec_tool'], outs=['out'],", - " cmd='$(location :exec_tool)')"); + " srcs=[':src'], tools=[':tool'], outs=['out'],", + " cmd='$(location :tool)')"); ConfiguredTarget parentTarget = getConfiguredTarget("//config"); // Cannot use getDirectPrerequisites, as this re-configures that target incorrectly. Artifact out = getFilesToBuild(parentTarget).toList().get(0); assertThat(getGeneratingAction(out).getTools().toList()).hasSize(1); - Artifact execTool = getGeneratingAction(out).getTools().getSingleton(); + Artifact tool = getGeneratingAction(out).getTools().getSingleton(); // This is the output dir fragment for the execution transition. - assertThat(execTool.getExecPathString()).contains("-exec-"); + assertThat(tool.getExecPathString()).contains("-exec-"); } } diff --git a/src/test/py/bazel/bazel_windows_symlinks_test.py b/src/test/py/bazel/bazel_windows_symlinks_test.py index f8dc7128e1a896..8a550565f9aa57 100644 --- a/src/test/py/bazel/bazel_windows_symlinks_test.py +++ b/src/test/py/bazel/bazel_windows_symlinks_test.py @@ -20,21 +20,24 @@ class BazelWindowsSymlinksTest(test_base.TestBase): def createProjectFiles(self): self.CreateWorkspaceWithDefaultRepos('WORKSPACE') - self.ScratchFile('foo/BUILD', [ - 'genrule(', - ' name = "x",', - ' srcs = ["sample"],', - ' outs = ["link"],', - ' exec_tools = ["sym.bat"],', - ' cmd = "$(location sym.bat) $< $@",', - ')', - 'genrule(', - ' name = "y",', - ' outs = ["dangling-link"],', - ' exec_tools = ["sym.bat"],', - ' cmd = "$(location sym.bat) does-not-exist $@",', - ')', - ]) + self.ScratchFile( + 'foo/BUILD', + [ + 'genrule(', + ' name = "x",', + ' srcs = ["sample"],', + ' outs = ["link"],', + ' tools = ["sym.bat"],', + ' cmd = "$(location sym.bat) $< $@",', + ')', + 'genrule(', + ' name = "y",', + ' outs = ["dangling-link"],', + ' tools = ["sym.bat"],', + ' cmd = "$(location sym.bat) does-not-exist $@",', + ')', + ], + ) self.ScratchFile( 'foo/sym.bat', [ '@set IN=%1', diff --git a/src/test/shell/bazel/bazel_symlink_test.sh b/src/test/shell/bazel/bazel_symlink_test.sh index 5f681f92d85f5e..9e8aa031d4f8cd 100755 --- a/src/test/shell/bazel/bazel_symlink_test.sh +++ b/src/test/shell/bazel/bazel_symlink_test.sh @@ -719,7 +719,7 @@ genrule( srcs = [], outs = ["out"], cmd = "touch $@", - exec_tools = [":a"], + tools = [":a"], ) EOF diff --git a/src/test/shell/bazel/platform_mapping_test.sh b/src/test/shell/bazel/platform_mapping_test.sh index 7ff621520d907b..c0f3378999a15e 100755 --- a/src/test/shell/bazel/platform_mapping_test.sh +++ b/src/test/shell/bazel/platform_mapping_test.sh @@ -121,7 +121,7 @@ genrule( name = "genrule1", outs = ["genrule1.out"], cmd = "echo hello > \$@", - exec_tools = [ + tools = [ ":genrule2", ], ) @@ -129,7 +129,7 @@ genrule( name = "genrule2", outs = ["genrule2.out"], cmd = "echo hello > \$@", - exec_tools = [ + tools = [ ":report", ], ) diff --git a/src/test/shell/bazel/platforms_test.sh b/src/test/shell/bazel/platforms_test.sh index 8ac86f1396adb5..415819acda076c 100755 --- a/src/test/shell/bazel/platforms_test.sh +++ b/src/test/shell/bazel/platforms_test.sh @@ -87,7 +87,7 @@ genrule( name = "hello", outs = ["hello.txt"], cmd = "echo 'Hello' > $@", - exec_tools = ["tool"], + tools = ["tool"], ) genrule( diff --git a/src/test/shell/integration/action_env_test.sh b/src/test/shell/integration/action_env_test.sh index 08af2abd059630..224a2424e027e5 100755 --- a/src/test/shell/integration/action_env_test.sh +++ b/src/test/shell/integration/action_env_test.sh @@ -53,17 +53,10 @@ genrule( ) genrule( - name = "show_host_env_using_exec_tools", - exec_tools = ["env.txt"], - outs = ["exec_tools_env.txt"], - cmd = "cp \$(location env.txt) \"\$@\"" -) - -genrule( - name = "show_host_env_using_successive_exec_tools", - exec_tools = ["exec_tools_env.txt"], - outs = ["successive_exec_tools_env.txt"], - cmd = "cp \$(location exec_tools_env.txt) \"\$@\"" + name = "show_host_env_using_successive_tools", + tools = ["tools_env.txt"], + outs = ["successive_tools_env.txt"], + cmd = "cp \$(location tools_env.txt) \"\$@\"" ) EOF cat > pkg/build.bzl < $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=bar" # But if FOO is passed using --action_env, it should not be listed in host env vars - bazel build --action_env=FOO=bar pkg:show_host_env_using_exec_tools \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + bazel build --action_env=FOO=bar pkg:show_host_env_using_tools \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_not_log "FOO=bar" } -function test_host_env_using_exec_tools_latest_wins() { +function test_host_env_using_tools_latest_wins() { export FOO=environmentfoo export BAR=environmentbar bazel build --host_action_env=FOO=foo \ - --host_action_env=BAR=willbeoverridden --host_action_env=BAR=bar pkg:show_host_env_using_exec_tools \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + --host_action_env=BAR=willbeoverridden --host_action_env=BAR=bar pkg:show_host_env_using_tools \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=foo" expect_log "BAR=bar" } -function test_client_env_using_exec_tools() { +function test_client_env_using_tools() { export FOO=startup_foo bazel clean --expunge bazel help build > /dev/null || fail "${PRODUCT_NAME} help failed" export FOO=client_foo - bazel build --host_action_env=FOO pkg:show_host_env_using_exec_tools || \ - fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + bazel build --host_action_env=FOO pkg:show_host_env_using_tools || \ + fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=client_foo" } -function test_redo_host_env_using_exec_tools() { +function test_redo_host_env_using_tools() { export FOO=initial_foo export UNRELATED=some_value - bazel build --host_action_env=FOO pkg:show_host_env_using_exec_tools \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + bazel build --host_action_env=FOO pkg:show_host_env_using_tools \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=initial_foo" # If an unrelated value changes, we expect the action not to be executed again export UNRELATED=some_other_value - bazel build --host_action_env=FOO -s pkg:show_host_env_using_exec_tools 2> $TEST_log \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" - expect_not_log '^SUBCOMMAND.*pkg:show_host_env_using_exec_tools' + bazel build --host_action_env=FOO -s pkg:show_host_env_using_tools 2> $TEST_log \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" + expect_not_log '^SUBCOMMAND.*pkg:show_host_env_using_tools' # However, if a used variable changes, we expect the change to be propagated export FOO=changed_foo - bazel build --host_action_env=FOO -s pkg:show_host_env_using_exec_tools 2> $TEST_log \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" - expect_log '^SUBCOMMAND.*pkg:show_host_env_using_exec_tools' - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + bazel build --host_action_env=FOO -s pkg:show_host_env_using_tools 2> $TEST_log \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" + expect_log '^SUBCOMMAND.*pkg:show_host_env_using_tools' + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=changed_foo" # But repeating the build with no further changes, no action should happen - bazel build --host_action_env=FOO -s pkg:show_host_env_using_exec_tools 2> $TEST_log \ - || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" - expect_not_log '^SUBCOMMAND.*pkg:show_host_env_using_exec_tools' + bazel build --host_action_env=FOO -s pkg:show_host_env_using_tools 2> $TEST_log \ + || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" + expect_not_log '^SUBCOMMAND.*pkg:show_host_env_using_tools' } -function test_latest_wins_arg_using_exec_tools() { +function test_latest_wins_arg_using_tools() { export FOO=bar export BAR=baz bazel build --host_action_env=BAR --host_action_env=FOO --host_action_env=FOO=foo \ - pkg:show_host_env_using_exec_tools || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + pkg:show_host_env_using_tools || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=foo" expect_log "BAR=baz" expect_not_log "FOO=bar" } -function test_latest_wins_env_using_exec_tools() { +function test_latest_wins_env_using_tools() { export FOO=bar export BAR=baz bazel build --host_action_env=BAR --host_action_env=FOO=foo --host_action_env=FOO \ - pkg:show_host_env_using_exec_tools || fail "${PRODUCT_NAME} build show_host_env_using_exec_tools failed" + pkg:show_host_env_using_tools || fail "${PRODUCT_NAME} build show_host_env_using_tools failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/tools_env.txt > $TEST_log expect_log "FOO=bar" expect_log "BAR=baz" expect_not_log "FOO=foo" } -function test_host_env_using_successive_exec_tools_simple() { +function test_host_env_using_successive_tools_simple() { export FOO=baz - bazel build --host_action_env=FOO=bar pkg:show_host_env_using_successive_exec_tools \ - || fail "${PRODUCT_NAME} build show_host_env_using_successive_exec_tool failed" + bazel build --host_action_env=FOO=bar pkg:show_host_env_using_successive_tools \ + || fail "${PRODUCT_NAME} build show_host_env_using_successive_tool failed" - cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/successive_exec_tools_env.txt > $TEST_log + cat `bazel info ${PRODUCT_NAME}-genfiles`/pkg/successive_tools_env.txt > $TEST_log expect_log "FOO=bar" } diff --git a/src/test/shell/integration/validation_actions_test.sh b/src/test/shell/integration/validation_actions_test.sh index d053e70ded4065..8050aa623ddbf3 100755 --- a/src/test/shell/integration/validation_actions_test.sh +++ b/src/test/shell/integration/validation_actions_test.sh @@ -160,9 +160,9 @@ rule_with_implicit_and_host_deps(name = "target_with_implicit_and_host_deps") rule_with_implicit_outs_and_validation(name = "some_tool_dep") genrule( - name = "genrule_with_exec_tool_deps", - exec_tools = [":some_tool_dep"], - outs = ["genrule_with_exec_tool_deps_out"], + name = "genrule_with_tool_deps", + tools = [":some_tool_dep"], + outs = ["genrule_with_tool_deps_out"], cmd = "touch $@", ) @@ -380,7 +380,7 @@ function test_failing_validation_action_for_tool_dep_does_not_fail_build() { # Validation actions in the exec configuration or from implicit deps should # not fail the overall build, since those dependencies should have their own # builds and tests that should surface any failing validations. - bazel build --experimental_run_validations //validation_actions:genrule_with_exec_tool_deps >& "$TEST_log" || fail "Expected build to succeed" + bazel build --experimental_run_validations //validation_actions:genrule_with_tool_deps >& "$TEST_log" || fail "Expected build to succeed" expect_not_log "validation failed!" }