You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Escape backslashes and newlines in response files (#4297)
<!-- Thanks for sending a PR! Before submitting:
1. If this is your first PR, please read CONTRIBUTING.md and sign the
CLA
first. We cannot review code without a signed CLA.
2. Please file an issue *first*. All features and most bug fixes should
have
an associated issue with a design discussed and decided upon. Small bug
fixes and documentation improvements don't need issues.
3. New features and bug fixes must have tests. Documentation may need to
be updated. If you're unsure what to update, send the PR, and we'll
discuss
in review.
4. Note that PRs updating dependencies and new Go versions are not
accepted.
Please file an issue instead.
-->
**What type of PR is this?**
> Uncomment one line below and remove others.
>
Bug fix
**What does this PR do? Why is it needed?**
It escapes backlashes by doubling them when using response files.
Without this, builds that trigger the usage of response files fail with:
```
<unknown line number>: internal compiler error: panic: badly formatted input
```
This comes from [this line of
code](https://cs.opensource.google/go/go/+/master:src/cmd/internal/objabi/flag.go;l=193;drc=c7ea87132f4e6f3c81e525c396a64471c9af0091;bpv=0?q=badly%20formatted%20input&ss=go%2Fgo)
in the Go compiler, which complains if a backlash is not followed either
by another `\` or by `n`.
**Which issues(s) does this PR fix?**
Fixes#4112 (I'd expect).
**Other notes for review**
I'd be happy to add a test but that function is not written in a very
testable way (and I'm not sure the response files feature as a whole has
any tests). As it is and without more significant changes I don't think
it would be possible to write a test for it.
0 commit comments