bazel: flip --incompatible_restrict_string_escapes default to true
RELNOTES:
--incompatible_restrict_string_escapes=true is now the default.
Unnecessary backslashes such as "\." in string literals are now
an error, instead of being silently treated as "\\.".
To fix the error while preserving behavior, double the backlash.
However, the error is often a sign that the original code was wrong.
PiperOrigin-RevId: 341440132
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 b9000a8..621b3e3 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
@@ -526,7 +526,7 @@
@Option(
name = "incompatible_restrict_string_escapes",
- defaultValue = "false",
+ defaultValue = "true",
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
metadataTags = {
@@ -718,7 +718,7 @@
public static final String INCOMPATIBLE_REQUIRE_LINKER_INPUT_CC_API =
"+incompatible_require_linker_input_cc_api";
public static final String INCOMPATIBLE_RESTRICT_STRING_ESCAPES =
- "-incompatible_restrict_string_escapes";
+ "+incompatible_restrict_string_escapes";
public static final String INCOMPATIBLE_RUN_SHELL_COMMAND_STRING =
"+incompatible_run_shell_command_string";
public static final String INCOMPATIBLE_STRUCT_HAS_NO_METHODS =
diff --git a/src/test/py/bazel/windows_remote_test.py b/src/test/py/bazel/windows_remote_test.py
index a067c66..bc1262a 100644
--- a/src/test/py/bazel/windows_remote_test.py
+++ b/src/test/py/bazel/windows_remote_test.py
@@ -187,7 +187,7 @@
'java_runtime(',
' name = "jdk8",',
' srcs = [],',
- ' java_home = "' + java_home + '",',
+ ' java_home = ' + repr(java_home) + ',',
')',
])
self.ScratchFile(
diff --git a/src/test/shell/integration/modify_execution_info_test.sh b/src/test/shell/integration/modify_execution_info_test.sh
index 6d31b21..3b2ef9d 100755
--- a/src/test/shell/integration/modify_execution_info_test.sh
+++ b/src/test/shell/integration/modify_execution_info_test.sh
@@ -207,7 +207,7 @@
visibility = ["//visibility:public"],
)
-extra_action(name = "echo-filename", cmd = "echo Hi \$(EXTRA_ACTION_FILE)")
+extra_action(name = "echo-filename", cmd = "echo Hi \\$(EXTRA_ACTION_FILE)")
py_binary(name = "pybar", srcs=["pybar.py"],)