> I am thinking about actually shipping the dependency generator but also using 
> it in the package itself.

This ^^ actually is my use case and here is how it looks in practice:

https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/ruby.spec#_187-190
https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/ruby.spec#_203-206
https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/ruby.spec#_795-800
https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/ruby.spec#_1330-1335

Saying all these, it makes me realize that in theory, if the `rubygems-devel` 
package was installed during Ruby build, the generators could actually run 
twice. But they are executed for specific path based on specific macro:

https://src.fedoraproject.org/rpms/ruby/blob/308b2c0ab2c6268847ed3bf2008e74bce334e810/f/rubygems.attr#_6

Not sure. In reality, having Ruby installed during build of Ruby is problematic 
for different reasons, so I don't have to be worried in this case.

> For that you need to make sure that it is only run once during the build - 
> even if the package is actually installed in the system building the package.

Do I? I don't think there is currently anything, which would prevent one 
generator running twice. E.g. if there are multiple `.attr` files pointing to 
the same script. Also the macros can be changed any time to point to the same 
script. And the generators can also be disabled by changing the macro.

Actually, from this POV, my original PR making the `local_generator` special 
kind of helps to mitigate the concerns. The more flexibility will provide more 
opportunities for clashes.

Nevertheless, let me be clear that I am not really arguing for or against of 
any of those variant. Both versions are acceptable. But it is good to 
understand all the corner cases 👍

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2734#issuecomment-1898123753
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2734/c1898123...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to