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

PHP autosynth failing with error: cannot apply binary patch to 'Dlp/metadata/V2/Dlp.php' without full index line #918

Closed
SurferJeffAtGoogle opened this issue Jan 25, 2021 · 4 comments · Fixed by #928
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.

Comments

@SurferJeffAtGoogle SurferJeffAtGoogle added the priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. label Jan 25, 2021
@SurferJeffAtGoogle SurferJeffAtGoogle self-assigned this Jan 25, 2021
@SurferJeffAtGoogle
Copy link
Contributor Author

Git thinks that some generated PHP files are binary.

@vam-google, the timing of this issue exactly matches the timing of googleapis/gapic-generator#3334. Do you think they're related?

SurferJeffAtGoogle added a commit to SurferJeffAtGoogle/google-cloud-php that referenced this issue Jan 26, 2021
SurferJeffAtGoogle added a commit to SurferJeffAtGoogle/synthtool that referenced this issue Jan 27, 2021
Pass the --binary flag to git diff so it can diff files no matter if they're binary or text.

Fixes googleapis#918
@SurferJeffAtGoogle
Copy link
Contributor Author

#928 will fix autosynth so it can handle the new binary output, but it leaves a question for @dwsupplee and @bshaffer: Do we actually want to generate binary php files? The results are pull requests like this that are impossible to visually diff.

@vam-google, I see that the generator used to hex-encode the binary payload like this but now injects raw binary into the php files like this. Was that a recent protobuf compiler change? Was it intentional?

@dwsupplee
Copy link
Contributor

@SurferJeffAtGoogle, it does look intentional based on: protocolbuffers/protobuf#8006

I just tested the changes out and they do work, so I think we're okay to move forward with this for now. To your point, I don't love not being able to read the diff anymore and am interested in alternatives to this approach at some point in the future.

Thanks for resolving this for us!

@SurferJeffAtGoogle
Copy link
Contributor Author

SurferJeffAtGoogle commented Jan 28, 2021 via email

SurferJeffAtGoogle added a commit that referenced this issue Feb 1, 2021
* fix: git thought some php files were binary and refused to diff

Pass the --binary flag to git diff so it can diff files no matter if they're binary or text.

Fixes #918

* fix: add the --binary flag to one more 'git diff' statement

About 1/3 of the APIs are still failing due to binary files.

* fix: don't attempt to parse the result of git diff as text

* fix: update regex code to work with binary

* fix: yet another binary-utf8 issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants