Skip to content

Commit

Permalink
declare_symlink: remove experimental warning
Browse files Browse the repository at this point in the history
Users have started using this feature since Bazel 6.0.0 without much
complains. Let's graduate the experimental flag and doc to stable

Leave the flag around for user to disable the behavior if desired.

Closes #18313.

PiperOrigin-RevId: 536994696
Change-Id: I2dbc09e591bd83f9c35bf2553a0994a685195a27
  • Loading branch information
sluongng authored and copybara-github committed Jun 1, 2023
1 parent c997543 commit 215f698
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,8 @@ public OutputDirectoryNamingSchemeConverter() {
public Label autoCpuEnvironmentGroup;

@Option(
name = "experimental_allow_unresolved_symlinks",
name = "allow_unresolved_symlinks",
oldName = "experimental_allow_unresolved_symlinks",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public Artifact declareSymlink(String filename, Object sibling) throws EvalExcep
if (!ruleContext.getConfiguration().allowUnresolvedSymlinks()) {
throw Starlark.errorf(
"actions.declare_symlink() is not allowed; "
+ "use the --experimental_allow_unresolved_symlinks command line option");
+ "use the --allow_unresolved_symlinks command line option");
}

Artifact result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,10 @@ public interface StarlarkActionFactoryApi extends StarlarkValue {
@StarlarkMethod(
name = "declare_symlink",
doc =
"<p>This parameter is experimental and may change at any "
+ "time. It may be disabled by "
+ "setting <code>--noexperimental_allow_unresolved_symlinks</code></p> <p>Declares "
+ "that the rule or aspect creates a symlink with the given name in the current "
+ "package. You must create an action that generates this symlink. Bazel will never "
+ "dereference this symlink and will transfer it verbatim to sandboxes or remote "
+ "executors. Symlinks inside tree artifacts are not currently supported.",
"Declares that the rule or aspect creates a symlink with the given name in the current"
+ " package. You must create an action that generates this symlink. Bazel will never"
+ " dereference this symlink and will transfer it verbatim to sandboxes or remote"
+ " executors. Symlinks inside tree artifacts are not currently supported.",
parameters = {
@Param(
name = "filename",
Expand Down
4 changes: 2 additions & 2 deletions src/test/shell/bazel/bazel_symlink_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ load("//symlink:symlink.bzl", "dangling_symlink")
dangling_symlink(name="a", link_target="non/existent")
EOF

bazel build --noexperimental_allow_unresolved_symlinks //a:a >& $TEST_log \
bazel build --noallow_unresolved_symlinks //a:a >& $TEST_log \
&& fail "build succeeded, but should have failed"
expect_log 'declare_symlink() is not allowed; use the --experimental_allow_unresolved_symlinks'
expect_log 'declare_symlink() is not allowed; use the --allow_unresolved_symlinks'
}

function test_inmemory_cache_symlinks() {
Expand Down

2 comments on commit 215f698

@meteorcloudy
Copy link
Member

@meteorcloudy meteorcloudy commented on 215f698 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexeagle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the notification. I think we can make two config_setting and then put an OR over here https://github.com/aspect-build/rules_js/blob/2f64180ba84693d0bfb975b44b520e95ecb80adb/js/defs.bzl#L36

Please sign in to comment.