Second attempt: Use upb textformat library to dump out raw xDS proto messages#23533
Second attempt: Use upb textformat library to dump out raw xDS proto messages#23533markdroth merged 23 commits intogrpc:masterfrom
Conversation
|
@markdroth Got your message over at #23307. I recently merged #23540, which updated the PHP Artifact test (to be run per pull request), which should catch these types of build issues for PHP. Do you mind rebasing this PR on top of the latest As it stands, the Artifact test should fail because the pair of filenames like these: The PHP build process will turn them into the same @nicolasnoble I guess you are still working on a different strategy for exporting these symbols? Let me know how I can help. Thanks! |
|
@stanley-cheung I've merged master. I'm not sure that the problem that Nico is working on is directly related to the filename problem. I think the filename problem will have to be fixed independently, since there will definitely be cases where we'll need both the *.upb.c and *.upbdefs.c files in future. That will be needed as part of #23122, which we'll want to do towards the end of this quarter. |
|
Actually, I guess the filename problem doesn't really have anything to do with #23122. It will be needed for this PR. But I think that what Nico is working on will not address that. He was working on having upb export an API for descriptor.proto specifically, but that does not solve the filename problem for any of the other files. |
jtattermusch
left a comment
There was a problem hiding this comment.
Just posting this as a heads up:
Before this gets merged, we need a green run of the full artifact - packages - distribtest flow and confirm that all the distribtests are passing as they should.
The full build is started manually here: https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Agrpc%2Fcore%2Fexperimental%2Fgrpc_build_artifacts_multiplatform
Marking this PR as "request changes" for now to make sure this doesn't get skipped accidentally.
|
Distribtest on master should now be green (just merged two fixes), so I think the only remaining distribtest failure would be the PHP distribtests failure: Of course we'll still want to have an adhoc https://fusion.corp.google.com/projectanalysis/summary/KOKORO/prod%3Agrpc%2Fcore%2Fexperimental%2Fgrpc_build_artifacts_multiplatform run after we think we fixed the PHP distribtest. |
|
Ad php artifact/distribtest breakage: |
This is just the first layer - after adding that file to So what we need to solve is that 2nd problem with the filenames. I'd like to get Nico's input on this. |
Thanks for the clarification. |
|
I've added the missing dependency for def.hpp. |
|
Yep, after adding |
|
Triggered adhoc artifact/packages/distribtest flow: sponge/8aec0801-1e1d-42f3-be35-b7950dd9d5ac (I'll check the results later). |
I checked the results of that build flow and all the distribtests (including the python distribtests that were previously broken) are passing except of the PHP distribtest (tracked by #23307). |
|
@jtattermusch Does that include the cfstream tests that were previously failing? |
Nope, just the artifact / packages /distribtest flow. Everything else that was broken needs to be tested separately. |
|
I am thinking about a possible approach like this:
The last time I brought this up, Nico seems to think that this approach may not work and that he is working on a different approach. So I did not proceed with experimenting with this. Do you think I should experiment with this? Do the file names play into how the symbols are named within the file? |
|
I suspect that the filenames are not so important for the .c file, but they are for the .h file, because they get included from other files using the original name. |
@markdroth This is looking promising. I added a script, for the purpose of the PHP build only, to temporarily rename all the I created PR #23614, which is basically this PR, plus this PHP fix 4f6d6d8. However, I am unable to resolve the conflicts with Mark, can you resolve the conflicts of this PR one more time please? There are some conflicts in |
|
After #23904 is merged, you can recreate a slimmer version of this PR on top of upstream/master. Please try to keep generated and handwritten changes in separate commits so that the resulting PR is easier to review. |
|
The distribtests seem to be working now: I'll start looking into what internal changes are needed to cherry-pick this. |
I've run the requested distribtest build, and it seems to be happy now.
|
Not sure what went wrong with the bad_ssl_cert_test in MSAN, but it looks like it failed to find the server binary. I suspect it's some kind of infrastructure flake. I think this is ready to merge. I'll do that as soon as the current import goes in. |
jtattermusch
left a comment
There was a problem hiding this comment.
I skimmed through the changes and it's looking good to me. I'm liking that the diff is only 22 files this time, not >150 as previously, which makes it much easier to review. +1 to smaller PRs.
|
Unfortunately, this also breaks rust build maintained at https://github.com/tikv/grpc-rs. The errors are also something like "multiple definitions" I can see from the comments that you get around the problem by renaming files at build time, which seems hacky to me. Do you have any other suggestions? Or can we just disable upb completely? |
|
I'm not sure how you're building grpc-rs or how it's integrated with our existing build system, but @veblush may be able to help you figure out how to make this work. As a work-around, you can't support xDS without upb, but if you're using bazel, there is a way to build without xDS support at all. See #23658. |
|
The build error output can be found at github action log. Basically, it compiles grpc using cmake and then link every necessary static library including libgrpc.a and libupb.a to a binary. Not supporting xDS can be a workaround indeed, thanks for your advice. Just out of curious, if changing file names can fix build issues, then why not just renaming every thing the time it's generated so it works for all? |
|
If you're using cmake, there probably isn't an easy way to build without xDS support; that works for bazel only. Also, I suspect that gRPC rust users will actually want to use xDS; we had at least one person asking about this at the last community meeting. I haven't looked at the full build log, but based on the error message you pasted above, I suspect this has nothing to do with renaming files. The file-renaming thing was a PHP-specific issue, not likely to affect other languages. In any case, while this PR may have triggered the problem, it was merged 3 months ago, and we're not going to roll it back at this point, so I think your build problem is a separate issue. Please file an issue about it and tag @veblush on it, since he may be able to help you figure this out. |
This is a second attempt at #21941, which was reverted in #23524.