Liliana Marie Prikler schreef op zo 05-09-2021 om 18:50 [+0200]: > [...] > > (Feel free to suggest a more concise name.) > Since "propagated" is already given by propagated-inputs, what about > simply having #:by? > E.g. something like: [...] > (define glib > (package > (name "glib") > (outputs '("out" ; everything > "bin")) ; glib-mkenums ... depends on Python > (propagated-inputs > `(("pcre" ,pcre #:by ("out")) ; future-proof #:by > ("libffi" ,libffi #:by ("out")) ; have it be a list > [...])) That looks nice, thanks. > I'm not sure whether we need to necessarily add a new "build" output > for pkg-config, that'd lead to a lot of doubly-propagated includes. > (Imagine both libffi and libffi:build etc.) I think the more > meaningful division here would be to add "bin" or "lib" outputs to > those packages, where we don't want propagation to continue > indefinitely. Putting pkg-config files into the "lib" or "out" output (together with shared libraries) seems reasonable to me ("lib" if the package is usually used as a binary, but also has libaries with pkg-config files, and "out" if it is usually used as a library). > This does cause problems with language bindings though, > e.g. pygobject, as those also propagate the package in question and > can't be neatly separated. python-pygobject can just keep everything in the output "out", and let glib and libffi be propagated by "out", no? I don't see how this would cause trouble for language bindings. > > Now, imagine the "build" output of "zile" had glib:build in > > propagated-inputs, using the scheme described above. Then, if the > > "out" output of zile is installed in a profile, that doesn't cause > > glib to appear in the profile as well, because glib > > is only propagated for the "build" output of zile, and not for "out" > > output of zile. > > > > However, if "build" is installed in the profile (e.g. because someone > > runs "guix environment --ad-hoc zile:build various compilation tools" > > to create an application using the zile library), then the .pc > > becomes available in the profile. > I must admit that this solution appears to have some surface elegance, > but what exactly would go in the "build" output of a package? You > mentioned pkg-config files (obviously), but those don't suffice to > actually build a package, do they? Sometimes they do suffice. The .pc files contain the "-L/.../LIB", "-I/.../include" and "-lstuff" flags needed for compilation. If the build system of the package uses pkg-config, it will use those flags, so the compiler will find the library in that case. Not sure if they always do suffice. > Would we need an extra syntax to > e.g. propagate the "out" output by "build" (and in some cases the "lib" > output instead)? Not if .pc files are put in "out" (or "lib" in some cases) instead of the originally proposed "build", but otherwise, possibly? Greetings, Maxime.