From 0c100efeba05577b8bc334e1fae31149854bb0b7 Mon Sep 17 00:00:00 2001 From: Googler Date: Mon, 30 Sep 2024 17:31:27 -0700 Subject: [PATCH] Flip symbolic macro flags This enables `--experimental_enable_first_class_macros` and `--incompatible_simplify_unconditional_selects_in_rule_attrs` to true. The former releases Symbolic Macros, and with it, Finalizers and Macro-Aware Visibility. The latter is a quality-of-life improvement for macro users that is technically a breaking change: Any rule instantiated with an attribute value of `select({"//conditions:default": foo})` instead sees just `foo`. Main milestone of #19922. RELNOTES: Symbolic Macros -- and with them, Finalizers and the new Macro-Aware Visibility model -- are now generally available (`--experimental_enable_first_class_macros` now defaults to true). Trivial `select()` values are automatically unwrapped (`--incompatible_simplify_unconditional_selects_in_rule_attrs` now defaults to true). PiperOrigin-RevId: 680779247 Change-Id: Icdbf4b47bc893ba61417eddc22c79d85b6f5d920 --- .../semantics/BuildLanguageOptions.java | 10 +++---- .../AspectAwareAttributeMapperTest.java | 20 ++++++++++--- .../analysis/ConfigurableAttributesTest.java | 3 +- .../lib/analysis/MacroVisibilityTest.java | 6 ---- .../build/lib/analysis/SymbolicMacroTest.java | 8 ----- .../lib/analysis/VisibilityProviderTest.java | 1 - .../select/ConfiguredAttributeMapperTest.java | 15 +++++++++- .../lib/packages/NativeExistingRulesTest.java | 14 +++++++-- .../lib/packages/PackageFactoryTest.java | 7 ----- .../build/lib/packages/RuleFinalizerTest.java | 6 ---- .../starlark/StarlarkDefinedAspectsTest.java | 17 +++++++++-- .../starlark/StarlarkOptionsParsingTest.java | 11 ++++++- .../StarlarkRuleClassFunctionsTest.java | 30 ++----------------- ...arlarkRuleImplementationFunctionsTest.java | 2 +- .../ModuleInfoExtractorTest.java | 9 ++---- src/test/shell/integration/outputs_test.sh | 7 +++++ 16 files changed, 86 insertions(+), 80 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java index 65e734ff2d0710..342542a945ddba 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java +++ b/src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java @@ -235,10 +235,10 @@ public final class BuildLanguageOptions extends OptionsBase { @Option( name = "experimental_enable_first_class_macros", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS, effectTags = OptionEffectTag.BUILD_FILE_SEMANTICS, - help = "If set to true, enables the `macro()` construct for defining first-class macros.") + help = "If set to true, enables the `macro()` construct for defining symbolic macros.") public boolean experimentalEnableFirstClassMacros; @Option( @@ -787,7 +787,7 @@ public final class BuildLanguageOptions extends OptionsBase { @Option( name = "incompatible_simplify_unconditional_selects_in_rule_attrs", - defaultValue = "false", + defaultValue = "true", documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS, effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS}, metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE}, @@ -940,7 +940,7 @@ public StarlarkSemantics toStarlarkSemantics() { public static final String EXPERIMENTAL_SINGLE_PACKAGE_TOOLCHAIN_BINDING = "-experimental_single_package_toolchain_binding"; public static final String EXPERIMENTAL_ENABLE_FIRST_CLASS_MACROS = - "-experimental_enable_first_class_macros"; + "+experimental_enable_first_class_macros"; public static final String EXPERIMENTAL_ENABLE_SCL_DIALECT = "+experimental_enable_scl_dialect"; public static final String ENABLE_BZLMOD = "+enable_bzlmod"; public static final String ENABLE_WORKSPACE = "-enable_workspace"; @@ -1012,7 +1012,7 @@ public StarlarkSemantics toStarlarkSemantics() { public static final String INCOMPATIBLE_DISALLOW_CTX_RESOLVE_TOOLS = "+incompatible_disallow_ctx_resolve_tools"; public static final String INCOMPATIBLE_SIMPLIFY_UNCONDITIONAL_SELECTS_IN_RULE_ATTRS = - "-incompatible_simplify_unconditional_selects_in_rule_attrs"; + "+incompatible_simplify_unconditional_selects_in_rule_attrs"; // non-booleans public static final StarlarkSemantics.Key EXPERIMENTAL_BUILTINS_BZL_PATH = new StarlarkSemantics.Key<>("experimental_builtins_bzl_path", "%bundled%"); diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java index aa4723008843eb..424c27628d0b69 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapperTest.java @@ -46,10 +46,22 @@ public final void createMapper() throws Exception { scratchConfiguredTargetAndData( "foo", "myrule", - "cc_binary(", - " name = 'myrule',", - " srcs = [':a.cc'],", - " linkstatic = select({'//conditions:default': 1}))"); + """ + # Needed to avoid select() being eliminated as trivial. + config_setting( + name = "config", + values = {"define": "pi=3"}, + ) + + cc_binary( + name = "myrule", + srcs = [":a.cc"], + linkstatic = select({ + ":config": 1, + "//conditions:default": 1, + }), + ) + """); RuleConfiguredTarget ct = (RuleConfiguredTarget) ctad.getConfiguredTarget(); rule = (Rule) ctad.getTargetForTesting(); diff --git a/src/test/java/com/google/devtools/build/lib/analysis/ConfigurableAttributesTest.java b/src/test/java/com/google/devtools/build/lib/analysis/ConfigurableAttributesTest.java index d791045f9b07d9..82ad6e45a61e37 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/ConfigurableAttributesTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/ConfigurableAttributesTest.java @@ -2146,9 +2146,8 @@ public void stringListDictTypeConcatConfigurable() throws Exception { } @Test - public void incompatibleSimplifyUnconditionalSelectsInRuleAttrs_checksForNonconfigurableAttrs() + public void assigningSelectToNonconfigurableAttr_fails_evenIfSelectIsSimplifiableUnconditional() throws Exception { - setBuildLanguageOptions("--incompatible_simplify_unconditional_selects_in_rule_attrs=true"); writeConfigRules(); scratch.file( "foo/BUILD", diff --git a/src/test/java/com/google/devtools/build/lib/analysis/MacroVisibilityTest.java b/src/test/java/com/google/devtools/build/lib/analysis/MacroVisibilityTest.java index 240f10cf1eccbe..75410326e4744d 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/MacroVisibilityTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/MacroVisibilityTest.java @@ -20,7 +20,6 @@ import com.google.devtools.build.lib.analysis.util.BuildViewTestCase; import com.google.testing.junit.testparameterinjector.TestParameterInjector; import com.google.testing.junit.testparameterinjector.TestParameters; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -34,11 +33,6 @@ @RunWith(TestParameterInjector.class) public final class MacroVisibilityTest extends BuildViewTestCase { - @Before - public void setUp() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - } - @Override protected String getDefaultVisibility() { // We're testing visibility. Avoid having to litter our test cases with `visibility=` attribute diff --git a/src/test/java/com/google/devtools/build/lib/analysis/SymbolicMacroTest.java b/src/test/java/com/google/devtools/build/lib/analysis/SymbolicMacroTest.java index b4c7123cc83022..18dc31877aefa3 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/SymbolicMacroTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/SymbolicMacroTest.java @@ -35,7 +35,6 @@ import java.util.List; import javax.annotation.Nullable; import org.junit.Assert; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -43,13 +42,6 @@ @RunWith(TestParameterInjector.class) public final class SymbolicMacroTest extends BuildViewTestCase { - @Before - public void setUp() throws Exception { - setBuildLanguageOptions( - "--experimental_enable_first_class_macros", - "--incompatible_simplify_unconditional_selects_in_rule_attrs"); - } - /** * Returns a package by the given name (no leading "//"), or null upon {@link * NoSuchPackageException}. diff --git a/src/test/java/com/google/devtools/build/lib/analysis/VisibilityProviderTest.java b/src/test/java/com/google/devtools/build/lib/analysis/VisibilityProviderTest.java index 0dfbe9a81635d2..59f889e0a2f15a 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/VisibilityProviderTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/VisibilityProviderTest.java @@ -32,7 +32,6 @@ public final class VisibilityProviderTest extends BuildViewTestCase { @Before public void setUp() throws Exception { setBuildLanguageOptions( - "--experimental_enable_first_class_macros", // Let's test the case where input files have proper visibilities by default. "--incompatible_no_implicit_file_export"); diff --git a/src/test/java/com/google/devtools/build/lib/analysis/select/ConfiguredAttributeMapperTest.java b/src/test/java/com/google/devtools/build/lib/analysis/select/ConfiguredAttributeMapperTest.java index df59dbf716f5e4..e681ee6bc902ab 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/select/ConfiguredAttributeMapperTest.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/select/ConfiguredAttributeMapperTest.java @@ -306,7 +306,20 @@ public void testNoneValueOnDefaultConditionWithNullDefault() throws Exception { @Test public void testNoneValueOnMandatoryAttribute() throws Exception { - scratch.file("a/BUILD", "alias(name='a', actual=select({'//conditions:default': None}))"); + scratch.file( + "a/BUILD", + """ + # Needed to avoid select() being eliminated as trivial. + config_setting( + name = "config", + values = {"define": "pi=3"}, + ) + + alias( + name = "a", + actual = select({":config": None, "//conditions:default": None}), + ) + """); reporter.removeHandler(failFastHandler); getConfiguredTarget("//a:a"); assertContainsEvent("Mandatory attribute 'actual' resolved to 'None'"); diff --git a/src/test/java/com/google/devtools/build/lib/packages/NativeExistingRulesTest.java b/src/test/java/com/google/devtools/build/lib/packages/NativeExistingRulesTest.java index 7d52622ff37b3c..73e5d58c7a7e2c 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/NativeExistingRulesTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/NativeExistingRulesTest.java @@ -123,9 +123,18 @@ def _impl(ctx): """ load("//test/starlark:rulestr.bzl", "my_rule", "save_dep") + # Needed to avoid select() being eliminated as trivial. + config_setting( + name = "config", + values = {"define": "pi=3"}, + ) + my_rule( name = "x", - dep = select({"//conditions:default": None}), + dep = select({ + ":config": None, + "//conditions:default": None, + }), ) save_dep("x") @@ -135,7 +144,8 @@ def _impl(ctx): assertThat(getConfiguredTarget("//test/getrule:x")).isNotNull(); // We have to compare by stringification because SelectorValue has reference equality semantics. - assertThat(getSaved("dep").toString()).isEqualTo("select({\"//conditions:default\": None})"); + assertThat(getSaved("dep").toString()) + .isEqualTo("select({\":config\": None, \"//conditions:default\": None})"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java index 6612b1f2970044..8dd5525a368256 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/PackageFactoryTest.java @@ -1181,7 +1181,6 @@ public void testPackageDefaultRestrictionDuplicates() throws Exception { *

The macro does not define any targets. */ private void defineEmptyMacroBzl() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); scratch.file( "pkg/my_macro.bzl", """ @@ -1372,7 +1371,6 @@ public void testSymbolicMacro_macroPreventsImplicitCreationOfInputFilesUnderItsN @Test public void testSymbolicMacro_implicitCreationOfInputFilesIsNotTriggeredByMacros() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); scratch.file( "pkg/my_macro.bzl", """ @@ -1401,7 +1399,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_deferredEvaluationExpandsTransitively() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); scratch.file( "pkg/my_macro.bzl", """ @@ -1456,7 +1453,6 @@ def _impl(name, visibility, height): @Test public void testSymbolicMacro_recursionProhibitedWithEagerEvaluation() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); defineRecursiveMacro(/* deferredEvaluation= */ false); expectEvalError( """ @@ -1475,7 +1471,6 @@ public void testSymbolicMacro_recursionProhibitedWithEagerEvaluation() throws Ex @Test public void testSymbolicMacro_recursionProhibitedWithDeferredEvaluation() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); defineRecursiveMacro(/* deferredEvaluation= */ true); expectEvalError( """ @@ -1494,7 +1489,6 @@ public void testSymbolicMacro_recursionProhibitedWithDeferredEvaluation() throws @Test public void testSymbolicMacro_indirectRecursionAlsoProhibited() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); // Define a pair of macros where A calls B calls A (and then would stop, if allowed to get that // far). Wrap it in a different entry point to test that the non-cyclic part is included in the // traceback. @@ -1561,7 +1555,6 @@ private void assertVisibilityIs(Target target, String... visibilityLabels) { } private void enableMacrosAndUsePrivateVisibility() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); // BuildViewTestCase makes everything public by default. setPackageOptions("--default_visibility=private"); } diff --git a/src/test/java/com/google/devtools/build/lib/packages/RuleFinalizerTest.java b/src/test/java/com/google/devtools/build/lib/packages/RuleFinalizerTest.java index 39b8aea1760b59..ec25016eb5f453 100644 --- a/src/test/java/com/google/devtools/build/lib/packages/RuleFinalizerTest.java +++ b/src/test/java/com/google/devtools/build/lib/packages/RuleFinalizerTest.java @@ -20,7 +20,6 @@ import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.errorprone.annotations.CanIgnoreReturnValue; import javax.annotation.Nullable; -import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -29,11 +28,6 @@ @RunWith(JUnit4.class) public final class RuleFinalizerTest extends BuildViewTestCase { - @Before - public void setUp() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - } - /** * Returns a package by the given name (no leading "//"), or null upon {@link * NoSuchPackageException}. diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java index d07a71ca16c64a..093c8162d7be97 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkDefinedAspectsTest.java @@ -1678,8 +1678,21 @@ def _rule_impl(ctx): scratch.file( "test/BUILD", """ - load('//test:aspect.bzl', 'my_rule') - my_rule(name = 'xxx', my_attr = select({'//conditions:default': 'foo'})) + load("//test:aspect.bzl", "my_rule") + + # Needed to avoid the select() being eliminated as trivial. + config_setting( + name = "config", + values = {"defines": "something"}, + ) + + my_rule( + name = "xxx", + my_attr = select({ + ":config": "foo", + "//conditions:default": "bar", + }), + ) """); reporter.removeHandler(failFastHandler); diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkOptionsParsingTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkOptionsParsingTest.java index ab12ccdd6f062b..774452d74acc51 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkOptionsParsingTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkOptionsParsingTest.java @@ -660,9 +660,18 @@ public void flagIsAlias_usesSelect() throws Exception { scratch.file( "test/pkg/BUILD", """ + # Needed to avoid select() being eliminated as trivial. + config_setting( + name = "config", + values = {"define": "pi=3"}, + ) + alias( name = "two", - actual = select({"//conditions:default": "//test:three"}), + actual = select({ + ":config": "//test:three", + "//conditions:default": "//test:three", + }), ) """); diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleClassFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleClassFunctionsTest.java index 4b0a86a3c2b686..eeee50fa5d638e 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleClassFunctionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleClassFunctionsTest.java @@ -291,8 +291,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_instantiationRegistersOnPackage() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -316,8 +314,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_instantiationRequiresExport() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -341,8 +337,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_cannotInstantiateInBzlThread() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -371,8 +365,6 @@ def some_func(): @Test public void testSymbolicMacro_requiresNameAttribute() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -396,8 +388,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_prohibitsPositionalArgs() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -421,8 +411,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacroCanAcceptAttributes() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -452,8 +440,6 @@ def _impl(name, visibility, target_suffix): @Test public void testSymbolicMacro_rejectsUnknownAttribute() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -485,8 +471,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_rejectsReservedAttributeName() throws Exception { - ev.setSemantics("--experimental_enable_first_class_macros"); - ev.setFailFast(false); evalAndExport( ev, @@ -506,8 +490,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_requiresMandatoryAttribute() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -536,8 +518,6 @@ def _impl(name, visibility): @Test public void testSymbolicMacro_cannotOverrideImplicitAttribute() throws Exception { - setBuildLanguageOptions("--experimental_enable_first_class_macros"); - scratch.file( "pkg/foo.bzl", """ @@ -568,8 +548,6 @@ def _impl(name, visibility, _xyz): @Test public void testSymbolicMacro_doesNotSupportComputedDefaults() throws Exception { - ev.setSemantics("--experimental_enable_first_class_macros"); - ev.checkEvalErrorContains( "In macro attribute 'xyz': Macros do not support computed defaults or late-bound defaults", """ @@ -595,8 +573,6 @@ public void testSymbolicMacro_doesNotSupportLateBoundDefaults() throws Exception // getPackage() returns null and no events are emitted.) ev.setFragmentNameToClass(ImmutableMap.of("cpp", CppConfiguration.class)); - ev.setSemantics("--experimental_enable_first_class_macros"); - ev.checkEvalErrorContains( "In macro attribute 'xyz': Macros do not support computed defaults or late-bound defaults", """ @@ -613,8 +589,6 @@ def _impl(name, visibility, xyz): pass @Test public void testSymbolicMacro_macroFunctionApi() throws Exception { - ev.setSemantics("--experimental_enable_first_class_macros"); - evalAndExport( ev, """ @@ -4411,8 +4385,8 @@ def impl(ctx): getConfiguredTarget("//initializer_testing:my_target"); ev.assertContainsError( - "existing_rules() can only be used while evaluating a BUILD file (or macro) or a WORKSPACE" - + " file"); + "existing_rules() can only be used while evaluating a BUILD file (or legacy macro), a rule" + + " finalizer, or a WORKSPACE file"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleImplementationFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleImplementationFunctionsTest.java index d9084b4e4227ee..e76596583b7b34 100644 --- a/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleImplementationFunctionsTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleImplementationFunctionsTest.java @@ -2105,7 +2105,7 @@ def _foo(): """); reporter.removeHandler(failFastHandler); getConfiguredTarget("//test:my_glob"); - assertContainsEvent("glob() can only be used while evaluating a BUILD file (or macro)"); + assertContainsEvent("glob() can only be used while evaluating a BUILD file (or legacy macro)"); } @Test diff --git a/src/test/java/com/google/devtools/build/lib/starlarkdocextract/ModuleInfoExtractorTest.java b/src/test/java/com/google/devtools/build/lib/starlarkdocextract/ModuleInfoExtractorTest.java index d0d4415852f599..cb89faf564580b 100644 --- a/src/test/java/com/google/devtools/build/lib/starlarkdocextract/ModuleInfoExtractorTest.java +++ b/src/test/java/com/google/devtools/build/lib/starlarkdocextract/ModuleInfoExtractorTest.java @@ -905,8 +905,7 @@ def _my_impl(ctx): @Test public void macroDocstring() throws Exception { Module module = - execWithOptions( - ImmutableList.of("--experimental_enable_first_class_macros"), + exec( """ def _my_impl(name, visibility): pass @@ -940,8 +939,7 @@ def _my_impl(name, visibility): @Test public void macroAttributes() throws Exception { Module module = - execWithOptions( - ImmutableList.of("--experimental_enable_first_class_macros"), + exec( """ def _my_impl(name): pass @@ -977,8 +975,7 @@ def _my_impl(name): @Test public void unexportedMacro_notDocumented() throws Exception { Module module = - execWithOptions( - ImmutableList.of("--experimental_enable_first_class_macros"), + exec( """ def _my_impl(name): pass diff --git a/src/test/shell/integration/outputs_test.sh b/src/test/shell/integration/outputs_test.sh index d35cb6c2b39441..24c4e3dc013624 100755 --- a/src/test/shell/integration/outputs_test.sh +++ b/src/test/shell/integration/outputs_test.sh @@ -190,9 +190,16 @@ EOF cat >$pkg/BUILD <