Skip to content

Commit

Permalink
bazel: flip --incompatible_restrict_string_escapes default to true
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adonovan authored and copybara-github committed Nov 9, 2020
1 parent 6666357 commit 73402fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public class BuildLanguageOptions extends OptionsBase implements Serializable {

@Option(
name = "incompatible_restrict_string_escapes",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
metadataTags = {
Expand Down Expand Up @@ -718,7 +718,7 @@ public StarlarkSemantics toStarlarkSemantics() {
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 =
Expand Down
2 changes: 1 addition & 1 deletion src/test/py/bazel/windows_remote_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def testJavaTestWithRuntimeRunsRemotely(self):
'java_runtime(',
' name = "jdk8",',
' srcs = [],',
' java_home = "' + java_home + '",',
' java_home = ' + repr(java_home) + ',',
')',
])
self.ScratchFile(
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/integration/modify_execution_info_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ action_listener(
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"],)
Expand Down

0 comments on commit 73402fa

Please sign in to comment.