Am Mittwoch, den 24.02.2021, 16:41 +0100 schrieb Nicolas Goaziou:
Toggle quote (9 lines)
> Leo Prikler <leo.prikler@student.tugraz.at> writes:> > > I was afraid this would cause rebuilds for the existing package.> > Was> > that fear unfounded?> > I don't think it would change anything. It is what we usually do in> "crates-io.scm".
Fair enough, I'll do so when I get to it.
Toggle quote (9 lines)
> > I personally disagree. The only reason a crate failing to build is> > a> > "valid input" to another is because that other crate can decide to> > completely disregard it, which sounds neither "reliable" nor> > "efficient" for a programming language, that prides itself as both.> > Probably, but the problem at hand is not to fix how Rust builds its> crates, but rather optimize Rust packaging.
I think those two issues are related, but that's a discussion for guix-devel. So is the rest of this, but I might as well make my case here.
Toggle quote (15 lines)
> > I will only skip builds for dead crates, i.e. crates I can> > reasonably> > assume to only contain dead code due to their build failures. This> > does not seem to cost much when building dependant packages, as> > I've> > found that in order to actually build the crates I have to> > explicitly> > invoke `guix build <crate>`.> > There's much more work involved. You have to take care of development> inputs which increases drastically the number of crates to package.> Moreover, you need to try building each of them, which takes time.> Not> skipping builds makes de facto some packages impossible to package.
We could work developer inputs into the recursive importer, that shouldnot be an issue.
Honestly, it is a greater waste of time to recompile every dependency,have the build fail, change some minor thing in the package andrecompile everything again. Yes, `guix build -K` helps to an extent,but it doesn't help if I made a typo in my build phase and got a guilebacktrace.
If cargo inputs worked like normal inputs, they'd be built reliablyonce and no time would be wasted rebuilding them over and over in anypackages using them.
Toggle quote (16 lines)
> > Of course, there's still the problem of CI. Long-term, I think we> > should find a way for this efficient programming language to> > reliably> > produce reusable build artifacts. Short term, hitting non-leaf> > packages, that have cargo-build-system anywhere with a priority of> > negative infinity sounds like a better workaround. I want to be> > able> > (as a developer) to explicitly build crates and determine where> > they> > fail.> > As a packager, you don't need to build the crate to fix any issue> arising at a higher level, as I pointed out already. If you're> developing the crate, that's another story. But then, you can quickly> write your own package definition.
Maybe there'd be an argument if we had --no-skip-build, but I thinkwe're working our way backwards here; trying work around a workaround.
Toggle quote (8 lines)
> I think the real questions about building intermediate crates, from> a packager point of view, are:> - does that make the packages reproducible?> - does that make the packages more secure?> - does that make the packages easier to define?> > From my experience, the answer is "no" to any of these. This is a net> loss.I don't think there is any influence on the ease of definition, sinceeither one would be handled by the recursive importer. The difficultyfor packagers currently would be to manually undo the automatic buildskipping done through the importer.
As for reproducibility/security, there is yet little to gain, becausethe leaf crate can simply ignore its inputs and do whatever, but if webuilt the crates ahead of time, and disallowed the automatic buildingof dependencies, we would get efficient *and* reproducible Rustpackages.
Another thing that bugs me as a packager is that cargo inputs don'twork for `guix refresh`, so I can't even be sure whether to put mypatch to master or core-updates.
Toggle quote (12 lines)
> > I believe we should not cowtow to Rust and Cargo, but instead force> > them to adhere to our principles; principles of building> > applications> > *and* libraries reproducibly without encoding hashes in a huge ass-> > lock > > file.> > I don't think it is worth focusing of this. We currently do a good> job> in Rust packaging, really. But it doesn't make much sense to have> some> packages skipping builds and not some others.If skipping only some builds is not an option, you are either left withskipping all builds or skipping none, one of which is certainly silly.
Toggle quote (6 lines)
> What saddens me a bit is that individuals (including me, of course)> are> currently doing as they see fit, but we haven't so far decided, as> a group, how to deal with the question uniformly. I hope we can> converge> quickly.I personally hope that some of the issues resulting from this "wildwest" approach to packaging will be alleviated by #46399. Havingcrates as regular inputs also increases the value of #:skip-build? #f.
Regards,Leo