Skip to content

Escape backslashes and newlines in response files #4297

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

Merged

Conversation

alopezz
Copy link
Contributor

@alopezz alopezz commented Mar 24, 2025

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 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.

@alopezz alopezz changed the title Escape backslashes in response files Escape backslashes and newlines in response files Mar 24, 2025
@fmeum fmeum enabled auto-merge (squash) March 24, 2025 16:46
@fmeum fmeum merged commit 8a6bce8 into bazel-contrib:master Mar 24, 2025
1 check passed
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.

ElasticSearch v7 in Windows Error
2 participants