Make the rpm-macros implementation add new BuildRequires, but not removing some.
This makes the individual rounds of %generate_buildrequires behave more predictably.
Nothing says the previous approach is wrong, but is might blow up unexpectedly.
The new cmake-srpm-macros package definition is required for supporting
Koji and COPR's two-stage build process where the SRPM isn't made
in the full build environment.
See https://github.com/rpm-software-management/rpm/issues/3147
for the background. RPM 4.19.90 changed RPM's build directory
behavior; the tl;dr is that everything's one level deeper now.
This code was expecting something like:
/tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10
but now we actually get something like:
/tmp/tmp.dheZFHDA0M/BUILD/cmake-3.31.10-build/cmake-3.31.10
this uses the trick from
https://github.com/rpm-software-management/rpm/issues/3147#issuecomment-2154192419
to figure out the base build directory and then go from there,
which *should* make this work on both older and newer RPM.
Without this fix, the tests are failing like this:
:: [ 21:03:33 ] :: [ BEGIN ] :: Running 'CMakeDir='
:: [ 21:03:33 ] :: [ PASS ] :: Command 'CMakeDir=' (Expected 0, got 0)
:: [ 21:03:33 ] :: [ BEGIN ] :: Running 'cd /tmp/tmp.dheZFHDA0M/BUILD/'
:: [ 21:03:33 ] :: [ PASS ] :: Command 'cd /tmp/tmp.dheZFHDA0M/BUILD/' (Expected 0, got 0)
:: [ 21:03:33 ] :: [ BEGIN ] :: Running 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld'
:: [ 21:03:33 ] :: [ FAIL ] :: Command 'su -c './bootstrap &>/tmp/tmp.dheZFHDA0M/bootstrap.log' cmkbld' (Expected 0, got 127)
you can see it doesn't get the directory right - it's trying
to run `./bootstrap` in `/tmp/tmp.dheZFHDA0M/BUILD/`, because
the attempt to discover `CMakeDir` failed and returned an
empty string. That's never going to work. See:
https://artifacts.dev.testing-farm.io/974c2a93-5d4c-4896-a48a-b2a54d2dd01d/
Signed-off-by: Adam Williamson <awilliam@redhat.com>
While passing this as a cmake argument works for top-level projects, it
does not carry over automatically to subprojects. Setting this in the
environment works for both.
Since our riscv64 builders are slow at the moment some tests fail with
timeouts, eg:
https://src.fedoraproject.org/rpms/kokkos/pull-request/11
Adding the --timeout flag on riscv64 only increases the timeout and
makes the tests pass. Adding this centrally makes it easier to remove
it later once faster hardware becomes widely available.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>