fedora-copr / copr

RPM build system - upstream for https://copr.fedorainfracloud.org/
113 stars 61 forks source link

Add rpm macro definitions to chroots #3508

Closed tstellar closed 1 week ago

tstellar commented 1 week ago

It would be useful if we could add rpm macro definitions to the chroot. This is similar to the "With Options" and "Without Options" that are already supported, but provides more flexibility. This would involve adding a new UI option on the chroot edit page for defining the macros and then backend changes to pass the macros to mock via the -D option.

koji supports configuring buildroots with rpm macro definitions, so it seem would be useful if COPR could support this too.

praiskup commented 1 week ago

Is this a request for documentation? You can certainly create a package shipping a macro file in /usr/lib/rpm/macros.d/, and build into your chroots. Maybe we could help with some script making this task trivial.

koji supports configuring buildroots with rpm macro definitions

Isn't this considered an ugly work-around, available to admins? Anyway, for Copr this would be basically a duplicate (or a sub-problem of) #1336.

tstellar commented 1 week ago

Is this a request for documentation? You can certainly create a package shipping a macro file in /usr/lib/rpm/macros.d/, and build into your chroots. Maybe we could help with some script making this task trivial.

Yes, this is currently what I'm doing. It just makes scripting new COPR projects a little more difficult.

koji supports configuring buildroots with rpm macro definitions

Isn't this considered an ugly work-around, available to admins? Anyway, for Copr this would be basically a duplicate (or a sub-problem of) #1336.

I'm not sure what the general consensus of this feature is, but I always thought it was useful to have in koji. I had thought about requesting something like #1336 instead, but it seems risky to allow users to specify arbitrary config files. Personally, though, I'm fine with either this proposal or the solution proposed in #1336.

nikromen commented 1 week ago

This will be implemented as part of #1336 - we raised the priority of that task