Move --distdir out of experimental status

The option --experimental_distdir has been introduced 4 months
ago and was completely unproblematic ever since. Moreover, it
is now used productively, both in our own bootstrapping process[1],
as well as in external packaging of projects using bazel[2]. So
make this option non-experimental. We still keep the old name as
an alternative to not break existing uses.

Related: #5175.

RELNOTES: The --distdir option is no longer experimental. This
  option allows to specify additional directories to look for
  files before trying to fetch them from the network. Files from
  any of the distdirs are only used if a checksum for the file
  is specified and both, the filename and the checksum, match.

[1] Commit 3c9cd82b847f3ece8ec04b2029bd5e8ad0eb7502
[2] https://github.com/gentoo/gentoo/blob/7379cdb578b0c070c846c3fa9f71470e2c5d1320/sci-libs/tensorflow/tensorflow-1.8.0-r1.ebuild#L168

Change-Id: I536238f9bdbad6b4f7222b4f6a1464d70d9f3be3
PiperOrigin-RevId: 199637265
diff --git a/scripts/bootstrap/bootstrap.sh b/scripts/bootstrap/bootstrap.sh
index 260e6dd..4a86dae 100755
--- a/scripts/bootstrap/bootstrap.sh
+++ b/scripts/bootstrap/bootstrap.sh
@@ -37,7 +37,7 @@
       --nojava_header_compilation \
       --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \
       --compilation_mode=opt \
-      --experimental_distdir=derived/distdir \
+      --distdir=derived/distdir \
       ${EXTRA_BAZEL_ARGS:-}"
 
 if [ -z "${BAZEL-}" ]; then
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
index 6e9954d..d3ced96 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
@@ -47,17 +47,17 @@
   public PathFragment experimentalRepositoryCache;
 
   @Option(
-    name = "experimental_distdir",
-    defaultValue = "null",
-    allowMultiple = true,
-    documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS,
-    effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
-    metadataTags = {OptionMetadataTag.EXPERIMENTAL},
-    converter = OptionsUtils.PathFragmentConverter.class,
-    help =
-        "Additional places to search for archives before accessing the network "
-            + "to download them."
-  )
+      name = "distdir",
+      oldName = "experimental_distdir",
+      defaultValue = "null",
+      allowMultiple = true,
+      documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS,
+      effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
+      metadataTags = {OptionMetadataTag.EXPERIMENTAL},
+      converter = OptionsUtils.PathFragmentConverter.class,
+      help =
+          "Additional places to search for archives before accessing the network "
+              + "to download them.")
   public List<PathFragment> experimentalDistdir;
 
   @Option(
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index 6557f85..5c93100 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -1355,7 +1355,7 @@
 EOF
 
   bazel clean --expunge
-  bazel build --experimental_distdir="${WRKDIR}/distfiles" //:local \
+  bazel build --distdir="${WRKDIR}/distfiles" //:local \
     || fail "expected success"
 }
 
@@ -1399,7 +1399,7 @@
 EOF
 
   bazel clean --expunge
-  bazel build --experimental_distdir="../distfiles" //:local \
+  bazel build --distdir="../distfiles" //:local \
     || fail "expected success"
 }