better-boots-10807
08/31/2022, 3:01 AMsudo
. rpm-ostree
does a bunch of mucking about that needs privileges so, in its current form, it basically refuses to run except as root.flat-zoo-31952
08/31/2022, 12:13 PMflat-zoo-31952
08/31/2022, 12:14 PMrpm
stuff in my project and my current idea about this is to find a way to run build steps in containers. I haven't gotten there yet, so I don't know what challenges will await, but I'd be willing to collaborate if containerized build steps would work for rpm-ostree
cool-yacht-37128
08/31/2022, 10:27 PMrpmbuild
and some other prep commands, and that shell script is registered to a experimental_shell_command target. The RPMS directory is set as an output on that target. To make this target run during a packaging
goal I have it as the input to a archive targetcool-yacht-37128
08/31/2022, 10:29 PMflat-zoo-31952
09/01/2022, 12:54 PMflat-zoo-31952
09/01/2022, 1:00 PMrpmbuild
with the shell command target makes sense, but you'd have to manage the depedency chain outside of Pants, and there's no guarantees of determinism, especially since your build deps could be changed every time you run dnf/yum upgrades. Pants tries hard to make build steps completely dependent on the inputs it can know about, in essence transforming a build step into a pure function. But there's nothing really stopping code from reaching out to OS-level things; Pants calls the directory it builds things in a "chroot" but it's not really. Code links against system libs, and you could hard-code paths to files outside the execution dir if you wanted.
For me using containers is the solution for things like this, but there's a lot of details to get right.cool-yacht-37128
09/02/2022, 12:15 AMrpmbuild
and some core utils like xargs which is simple enough to manage. If you are doing compilation and more complex operations in your .spec I can see why dependency management is so important for you. Builds inside containers would solve this quite well. I imagine other people benefiting from this too as a generic wrapper for other types of builds that Pants doesn't have direct support.
Not sure if it will help you but @fresh-cat-90827 has been chipping away at debian packaging support. https://github.com/pantsbuild/pants/issues/12421flat-zoo-31952
09/02/2022, 12:50 AMcool-yacht-37128
09/02/2022, 2:22 AMfresh-cat-90827
09/02/2022, 6:18 AMflat-zoo-31952
09/02/2022, 1:43 PM