-
Notifications
You must be signed in to change notification settings - Fork 912
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
Makefile: use grouped targets for recipes with multiple fixed outputs #6307
Makefile: use grouped targets for recipes with multiple fixed outputs #6307
Conversation
This makes perfect sense, yet completely broke CI. It seems that contrib/pyln-testing/pyln/testing/node_pb2_grpc.py etc are grossly outdated(?) and yet don't have proper Makefile rules to regenerate them. If you rm it and make, you see it changes a great deal. Leaving to @cdecker |
@rustyrussell: It may be because you recently switched to protobuf-python 4 (from 3) but didn't regenerate any of your generated sources. (Why do you keep generated sources under revision control anyway?) The newer protobuf compiler generates quite different code. |
@rustyrussell: I think you have rules for all of your protobuf-generated source files. |
ab36563
to
41c1430
Compare
I am trying to update the generated sources in such a way that they will not be changed by the CI check, but the current state of this repository imposes an impossible set of constraints:
Thus, the CI build is installing a version of The update to the generated sources in 41c1430 was generated using protobuf-python 4.22.3 and grpcio-tools-1.54.0, which are the same versions as are installed in CI, yet the check apparently still fails, though GitHub says the check failed 3 days ago, so I'm not sure whether a new CI run was actually triggered when I force-pushed. |
41c1430
to
e56828b
Compare
Rebased on master, now things should be regenerated... |
And two more commits so things at least vaguely work as expected! |
ee26591
to
31777e1
Compare
🥴 |
Yeah, I have no idea either? I've removed that flag, YOLO!!! |
Nope. Looks like this crutch has been removed, and the proto files need fixing? @cdecker? |
Attempting to pose this question with the least amount of snark I can muster: do the CLN devs have a local development environment that mimics the CI environment? This iterative process is looking worryingly like "programming by accident", where you're taking more-or-less haphazard stabs at fixing a problem without having a comprehensive understanding of the problem space. Iterating configuration permutations until your CI tests pass isn't a good development methodology because it leads to extreme fragility. |
This is an excellent, and thought-provoking point! But this is a little unfair in this case. It's important to note that CI was failing because it checks the status of a bunch of files we don't even use. So my care factor here is v. v. low. Moreover, I knew I would (and did!) toss this to Christian once he woke, whose code it was for a more serious diagnosis once it got roughly in shape. I don't have a local CI instance, but I have a build machine which runs the entire test suite, because most of our CI problems are classically:
Mimicking the GH env is something of a moving target, and inadvisable unless we're actually having trouble replicating something and the latency matters: pushing crap to GH to test it is guaranteed to work. I've seen project where developers start replicating the CI locally rather than testing locally, and adds fragility: I far prefer developers test on their local platforms with idiosyncrasies (my laptop and build box are different Ubuntu versions for a reason, and the CI is YA version). Getting CI working isn't the aim of the project, and it's important not to lose sight of that, or spend too much time on it. |
Thank you for the very fair reply.
And yet you have previously tagged a release (v0.12.1) that didn't even pass your unit test suite, let alone your integration test suite. 🤔 Maybe your process has tightened up since then.
And yet you claimed that my proposed improvement to your build process "makes perfect sense yet completely broke CI" and declined to merge it for the v23.05.1 tag, ostensibly for that reason. It seems to me that your CI was already broken when you switched to protobuf-python 4 but neglected to regenerate your generated sources. Again, why are your generated sources under revision control? They take about a second to generate, so nothing is gained by checking them in. You say you want testing on platforms with different configurations. Well, Gentoo rarely has the same versions of the protobuf components in its official ebuild repository as you're requiring. I've had to backport older versions (and write ebuilds for newer versions!) just so I could regenerate your generated sources without introducing irrelevant changes attributable solely to different protobuf versions. It would be less fragile if the generated sources weren't checked in at all. |
Thoughtful feedback deserves thought!
I don't remember that? We should definitely run proper CI on test releases (rather than having GH test it as if it's going to merge it into master).
Sorry, no, I didn't merge it because it didn't fix any known problem! My threshold for point releases is pretty high: must fix observed or nasty issues.
No, the build process was broken (not regenerating those files when needed, even after distclean). CI caught it because it explicitly checks checked in generated files haven't changed after a build, so when something else triggered it, boom...
Pain for devs, sure. But less pain for those building the source: they are screwed if they have too old (and surely maybe one day, too new!) protobuf compiler. Like people running the latest Ubuntu LTS release. Our general trend has been to check in fewer generated files over time: we used to check in man pages and things so you didn't need python, but that indeed was such a PITA we eliminated it. I hope we can indeed remove this. But I don't think we can do it today :( |
OK, so, turns out these numbers are not comparable. protobuf v>=4 in Python is still using protobuf v3, which is fine? I was completely confused, too, but this seems to be the case. The compiler version is in fact now date-based, there is no PROTOC v 4...
This may be true, but if so it's hard to tell. I can not find any mention of what protoc might be required for a given Python protobuf lib :(
|
3ab321a
to
7dd0239
Compare
Not on Gentoo, it isn't.
The Python implementation is in the same GitHub repo as the C++ library. Versioning of the C++ library has dropped the leading "4.", while versioning of the Python module has not, but otherwise protobuf x.y corresponds to protobuf-python 4.x.y. It may in fact be possible to install non-corresponding versions of protobuf and protobuf-python, but then I'm not sure if the Python module's C++ runtime backend will necessarily work correctly. 😕 |
FWIW, it was a case where |
Ok, then Gentoo seems like the tightest restriction, so let's follow that. We will match the two versions precisely: we can probably do it by parsing the Python protobuf version and converting it? Let me see what that looks like tomorrow... |
428a26a
to
04d4b25
Compare
... then rebased on master which also played with Python deps.... |
... and rebased again on master, now it has some CI fixes... |
04d4b25
to
84b41a7
Compare
More flakes, see #6356 |
84b41a7
to
2c648b1
Compare
See the section headed "Rules with Grouped Targets" on the Texinfo page `(make)Multiple Targets`. Without this fix, Make does not know that these recipes unconditionally make *all* of their named targets regardless of which target triggers their execution, and Make will blissfully execute multiple instances of any such recipe in parallel, not only wasting CPU cycles but potentially producing incorrect results if the recipe is not atomic in its effects on the file system. With this fix, Make understands that it need only execute such a recipe once to make all of its targets. In pursuit of the above, move and combine two redundant msggen recipes into the top-level Makefile, and populate its grouped targets from the subordinate Makefiles. Changelog-None
…/ in distclean, and rebuild by default. And add contrib/pyln-testing/pyln/testing/grpc2py.py since we didn't previously know how to build it! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
And re-ran poetry update which updated the lock file ofc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2c648b1
to
17f886e
Compare
See the section headed "Rules with Grouped Targets" on the Texinfo page
(make)Multiple Targets
.Without this fix, Make does not know that these recipes unconditionally make all of their named targets regardless of which target triggers their execution, and Make will blissfully execute multiple instances of any such recipe in parallel, not only wasting CPU cycles but potentially producing incorrect results if the recipe is not atomic in its effects on the file system. With this fix, Make understands that it need only execute such a recipe once to make all of its targets.
In pursuit of the above, move and combine two redundant msggen recipes into the top-level Makefile, and populate its grouped targets from the subordinate Makefiles.
Changelog-None