Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape tilde more gracefully #16583

Merged
merged 2 commits into from
Oct 27, 2022

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Oct 27, 2022

Tilde needs to be escaped only when it's the first character after the white space. Otherwise, we can keep the string unescaped.

This supports bzlmod better, because tilde is used in the directory names.

Users often already escape location function, for example SJ="$(location @bazel_tools//tools/jdk:singlejar)"; $SJ. Without the change this becomes 'external/repo~name/singlejar' and the script fails (no file found).

Location function shouldn't be escaped. But without this change we risk a lot of users will need to fix their scripts.

Closes #16560.

PiperOrigin-RevId: 484226256
Change-Id: I6b71f89a649f8494b76a4446b8f6384421eb89d1

Tilde needs to be escaped only when it's the first character after the white space. Otherwise, we can keep the string unescaped.

This supports bzlmod better, because tilde is used in the directory names.

Users often already escape location function, for example `SJ="$(location @bazel_tools//tools/jdk:singlejar)"; $SJ`. Without the change this becomes `'external/repo~name/singlejar'` and the script fails (no file found).

Location function shouldn't be escaped. But without this change we risk a lot of users will need to fix their scripts.

Closes bazelbuild#16560.

PiperOrigin-RevId: 484226256
Change-Id: I6b71f89a649f8494b76a4446b8f6384421eb89d1
@fmeum fmeum requested a review from ShreeM01 as a code owner October 27, 2022 12:27
@ShreeM01 ShreeM01 added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. and removed team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Oct 27, 2022
@ShreeM01 ShreeM01 merged commit 4b697e9 into bazelbuild:release-6.0.0 Oct 27, 2022
@fmeum fmeum deleted the release-6.0.0-16560 branch October 27, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants