diff --git a/src/main/java/com/google/devtools/build/lib/packages/StarlarkSemanticsOptions.java b/src/main/java/com/google/devtools/build/lib/packages/StarlarkSemanticsOptions.java index 9fe4dbec53a971..84c5d0b297e50c 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/StarlarkSemanticsOptions.java +++ b/src/main/java/com/google/devtools/build/lib/packages/StarlarkSemanticsOptions.java @@ -63,17 +63,6 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl // <== Add new options here in alphabetic order ==> - @Option( - name = "experimental_action_args", - defaultValue = "true", - documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS, - effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, - metadataTags = {OptionMetadataTag.EXPERIMENTAL}, - help = - "If set to true, Action objects support an `args` field: " - + "a frozen Args object which contains all action arguments.") - public boolean experimentalActionArgs; - @Option( name = "experimental_build_setting_api", defaultValue = "true", @@ -631,7 +620,6 @@ public StarlarkSemantics toStarlarkSemantics() { StarlarkSemantics semantics = StarlarkSemantics.builder() // <== Add new options here in alphabetic order ==> - .experimentalActionArgs(experimentalActionArgs) .experimentalAllowTagsPropagation(experimentalAllowTagsPropagation) .experimentalBuiltinsBzlPath(experimentalBuiltinsBzlPath) .experimentalCcStarlarkApiEnabledPackages(experimentalCcStarlarkApiEnabledPackages) diff --git a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/ActionApi.java b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/ActionApi.java index 52aad58998f729..0d37e308ee09dd 100644 --- a/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/ActionApi.java +++ b/src/main/java/com/google/devtools/build/lib/starlarkbuildapi/ActionApi.java @@ -82,8 +82,7 @@ public interface ActionApi extends StarlarkValue { + "

Note that some types of actions do not yet support exposure of this field." + " For such action types, this is None.", structField = true, - allowReturnNones = true, - enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ACTION_ARGS) + allowReturnNones = true) Sequence getStarlarkArgs() throws EvalException; /** diff --git a/src/main/java/com/google/devtools/build/lib/syntax/StarlarkSemantics.java b/src/main/java/com/google/devtools/build/lib/syntax/StarlarkSemantics.java index 089fbc7ac528c0..85b203d8826bc9 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/StarlarkSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/StarlarkSemantics.java @@ -72,7 +72,6 @@ private FlagIdentifier() {} // uninstantiable // consistent as they may appear in error messages. // TODO(adonovan): move these constants up into the relevant packages of // Bazel, and make them identical to the strings used in flag declarations. - public static final String EXPERIMENTAL_ACTION_ARGS = "experimental_action_args"; public static final String EXPERIMENTAL_DISABLE_EXTERNAL_PACKGE = "experimental_disable_external_package"; public static final String EXPERIMENTAL_SIBLING_REPOSITORY_LAYOUT = @@ -113,8 +112,6 @@ private FlagIdentifier() {} // uninstantiable // return Boolean.TRUE.equals(map.get(flag)). public boolean flagValue(String flag) { switch (flag) { - case FlagIdentifier.EXPERIMENTAL_ACTION_ARGS: - return experimentalActionArgs(); case FlagIdentifier.EXPERIMENTAL_DISABLE_EXTERNAL_PACKGE: return experimentalDisableExternalPackage(); case FlagIdentifier.EXPERIMENTAL_SIBLING_REPOSITORY_LAYOUT: @@ -194,8 +191,6 @@ boolean isFeatureEnabledBasedOnTogglingFlags(String enablingFlag, String disabli AutoValue_StarlarkSemantics.class; // <== Add new options here in alphabetic order ==> - public abstract boolean experimentalActionArgs(); - public abstract String experimentalBuiltinsBzlPath(); public abstract ImmutableList experimentalCcStarlarkApiEnabledPackages(); @@ -307,7 +302,6 @@ public static Builder builderWithDefaults() { public static final StarlarkSemantics DEFAULT = builder() // <== Add new options here in alphabetic order ==> - .experimentalActionArgs(true) .experimentalAllowTagsPropagation(false) .experimentalBuiltinsBzlPath("") .experimentalCcStarlarkApiEnabledPackages(ImmutableList.of()) @@ -354,8 +348,6 @@ public static Builder builderWithDefaults() { public abstract static class Builder { // <== Add new options here in alphabetic order ==> - public abstract Builder experimentalActionArgs(boolean value); - public abstract Builder experimentalAllowTagsPropagation(boolean value); public abstract Builder experimentalBuiltinsBzlPath(String value); diff --git a/src/test/java/com/google/devtools/build/lib/packages/StarlarkSemanticsConsistencyTest.java b/src/test/java/com/google/devtools/build/lib/packages/StarlarkSemanticsConsistencyTest.java index 460dff0d5e5e16..a3261249c1a736 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/StarlarkSemanticsConsistencyTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/StarlarkSemanticsConsistencyTest.java @@ -119,7 +119,6 @@ public void canGetBuilderFromInstance() { private static StarlarkSemanticsOptions buildRandomOptions(Random rand) throws Exception { return parseOptions( // <== Add new options here in alphabetic order ==> - "--experimental_action_args=" + rand.nextBoolean(), "--experimental_disable_external_package=" + rand.nextBoolean(), "--experimental_sibling_repository_layout=" + rand.nextBoolean(), "--experimental_builtins_bzl_path=" + rand.nextDouble(), @@ -171,7 +170,6 @@ private static StarlarkSemanticsOptions buildRandomOptions(Random rand) throws E private static StarlarkSemantics buildRandomSemantics(Random rand) { return StarlarkSemantics.builder() // <== Add new options here in alphabetic order ==> - .experimentalActionArgs(rand.nextBoolean()) .experimentalDisableExternalPackage(rand.nextBoolean()) .experimentalSiblingRepositoryLayout(rand.nextBoolean()) .experimentalBuiltinsBzlPath(String.valueOf(rand.nextDouble())) diff --git a/src/test/java/net/starlark/java/annot/processor/testsources/EnablingAndDisablingFlagParam.java b/src/test/java/net/starlark/java/annot/processor/testsources/EnablingAndDisablingFlagParam.java index 0dc59997f2bef5..3108d032b91361 100644 --- a/src/test/java/net/starlark/java/annot/processor/testsources/EnablingAndDisablingFlagParam.java +++ b/src/test/java/net/starlark/java/annot/processor/testsources/EnablingAndDisablingFlagParam.java @@ -34,8 +34,8 @@ public class EnablingAndDisablingFlagParam implements StarlarkValue { name = "two", type = Integer.class, named = true, - enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ACTION_ARGS, - disableWithFlag = FlagIdentifier.EXPERIMENTAL_ACTION_ARGS), + enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, + disableWithFlag = FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API), }) public String someMethod(String one, Integer two) { return "foo"; diff --git a/src/test/java/net/starlark/java/annot/processor/testsources/ToggledKwargsParam.java b/src/test/java/net/starlark/java/annot/processor/testsources/ToggledKwargsParam.java index 9f8e18f8fb90e8..d53733d8c89a03 100644 --- a/src/test/java/net/starlark/java/annot/processor/testsources/ToggledKwargsParam.java +++ b/src/test/java/net/starlark/java/annot/processor/testsources/ToggledKwargsParam.java @@ -37,7 +37,9 @@ public class ToggledKwargsParam implements StarlarkValue { }, extraPositionals = @Param(name = "args"), extraKeywords = - @Param(name = "kwargs", enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ACTION_ARGS), + @Param( + name = "kwargs", + enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API), useStarlarkThread = true) public String toggledKwargsMethod( String one, Integer two, Sequence args, Dict kwargs, StarlarkThread thread) { diff --git a/src/test/java/net/starlark/java/annot/processor/testsources/ToggledParamNoDisabledValue.java b/src/test/java/net/starlark/java/annot/processor/testsources/ToggledParamNoDisabledValue.java index 0706782dd143ae..b4ed66df567830 100644 --- a/src/test/java/net/starlark/java/annot/processor/testsources/ToggledParamNoDisabledValue.java +++ b/src/test/java/net/starlark/java/annot/processor/testsources/ToggledParamNoDisabledValue.java @@ -33,7 +33,7 @@ public class ToggledParamNoDisabledValue implements StarlarkValue { @Param( name = "two", named = true, - enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ACTION_ARGS, + enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_GOOGLE_LEGACY_API, positional = true) }) public Integer noDisabledValueMethod(Integer one, Integer two) { diff --git a/src/test/shell/bazel/cc_integration_test.sh b/src/test/shell/bazel/cc_integration_test.sh index bbd8cc2fba9326..d9a762c0729cb3 100755 --- a/src/test/shell/bazel/cc_integration_test.sh +++ b/src/test/shell/bazel/cc_integration_test.sh @@ -703,7 +703,7 @@ EOF bazel build "${package}:x" \ --aspects="//${package}:lib.bzl%actions_test_aspect" \ - --output_groups=out --experimental_action_args + --output_groups=out cat "bazel-bin/${package}/aspect_out" | grep "\(ar\|libtool\)" \ || fail "args didn't contain the tool path" @@ -741,7 +741,7 @@ EOF bazel build "${package}:x" \ --aspects="//${package}:lib.bzl%actions_test_aspect" \ - --output_groups=out --experimental_action_args + --output_groups=out cat "bazel-bin/${package}/aspect_out" | \ grep "\(gcc\|clang\|clanc-cl.exe\|cl.exe\)" \ @@ -898,14 +898,14 @@ EOF # Test that actions are reconstructible under default configuration bazel build "${package}:a" \ --aspects="//${package}:lib.bzl%actions_test_aspect" \ - --output_groups=out --experimental_action_args || \ + --output_groups=out || \ fail "bazel build should've passed" - # Test that compile actions are reconstructible when using param files - bazel build "${package}:a" \ + # Test that compile actions are reconstructible when using param files + bazel build "${package}:a" \ --features=compiler_param_file \ --aspects="//${package}:lib.bzl%actions_test_aspect" \ - --output_groups=out --experimental_action_args || \ + --output_groups=out || \ fail "bazel build should've passed with --features=compiler_param_file" } diff --git a/src/test/shell/integration/action_aspect_test.sh b/src/test/shell/integration/action_aspect_test.sh index 9fdfd1e5ab08ba..37e94d5bdce0cd 100755 --- a/src/test/shell/integration/action_aspect_test.sh +++ b/src/test/shell/integration/action_aspect_test.sh @@ -127,14 +127,13 @@ load(":lib.bzl", "tree_art_rule") tree_art_rule(name = "x") EOF - bazel build package:x --experimental_action_args \ - || fail "Unexpected build failure" + bazel build package:x || fail "Unexpected build failure" cat "${PRODUCT_NAME}-bin/package/digest" | grep "a.txt.*b.txt.*c.txt" \ || fail "rule digest does not contain tree artifact args" bazel build package:x --aspects=//package:lib.bzl%actions_test_aspect \ - --output_groups=out --experimental_action_args + --output_groups=out cat "${PRODUCT_NAME}-bin/package/aspect_out" | grep "a.txt.*b.txt.*c.txt" \ || fail "aspect Args do not contain tree artifact args" @@ -218,14 +217,13 @@ load(":lib.bzl", "tree_art_rule") tree_art_rule(name = "x") EOF - bazel build package:x --experimental_action_args \ - || fail "Unexpected build failure" + bazel build package:x || fail "Unexpected build failure" cat "${PRODUCT_NAME}-bin/package/digest" | grep "a.txt.*b.txt.*c.txt" \ || fail "rule digest does not contain tree artifact args" bazel build package:x --aspects=//package:lib.bzl%actions_test_aspect \ - --output_groups=out --experimental_action_args + --output_groups=out cat "${PRODUCT_NAME}-bin/package/raw_args_out" | grep ".params" \ || fail "aspect Args does not contain a params file" diff --git a/src/test/shell/integration/java_integration_test.sh b/src/test/shell/integration/java_integration_test.sh index c6d0df7a612e4b..4e43d746606ded 100755 --- a/src/test/shell/integration/java_integration_test.sh +++ b/src/test/shell/integration/java_integration_test.sh @@ -880,7 +880,7 @@ EOF bazel build "${package}:x" \ --aspects="//${package}:lib.bzl%actions_test_aspect" \ - --output_groups=out --experimental_action_args + --output_groups=out cat "${PRODUCT_NAME}-bin/${package}/aspect_out" | grep "0.params .*1.params" \ || fail "aspect Args do not contain both params files"