On 31. 01. 21 15:35, Pavel Raiskup wrote:
I don't know, perhaps we could have some configurable coefficient for
timeout_in Copr_ for emulated architectures? If that was say "3", and
the --timeout was 3600s, emulated arches would get 10800s instead?
There can be a macro that you would use like this:
--timeout %{adjust_timeout 3600}
And the macro would:
Check if %__timeout_coefficient is set. If not, evaluate to the first argument
as is. If set, multiply the two numbers and evaluate to that.
The emulated copr chroots would define the %__timeout_coefficient macro to a
value provided by the admins (via an educated guess).
-----
A proof of concept macro definition (requires RPM 4.16+ == Fedora 33+):
%adjust_timeout() %[%{?__timeout_coefficient}%{?!__timeout_coefficient:1} * %1]
(It would require a rewrite to Lua / Shell if we want to support float values as
well, as RPM expressions AFAIK only know integers.)
-----
Obviously, there is a downside. If we go this way and define %adjust_timeout in
Fedora and/or upstream RPM, spec files with --timeout %{adjust_timeout 3600}
will only work on new enough Fedoras. There is an ugly way to actually make the
spec file compatible with past versions:
--timeout %{?adjust_timeout:%{adjust_timeout 3600}}%{?!adjust_timeout:3600}
Since this is hideous, I would prefer to backport the macro wherever possible :/
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx