[Rpm-maint] [rpm-software-management/rpm] Add _without_check macro (#1256)
Florian Festi
notifications at github.com
Wed Feb 9 10:59:12 UTC 2022
OK, revisiting this...
Here's what happening right now without the patch:
--nocheck -> nobuildAmount |= RPMBUILD_CHECK
--with check -> define _with_check
--without check -> define _without_check
bcond_with(check) -> define with_check if _with_check
bcond_without(check) -> define with_check if not _without_check
| with_check? | bcond_with(check) | bcond_without(check) | nothing
|----------------------- |--------------------------|-------------------------------|--------------
| nothing | - | check | -
| --with check | check | check | -
| --without check | - | - | -
> Yeah this needs to interact with both _with_check and _without_check, and not add semantics to %_without_check value. And for that, it'd seem that we need to parse the spec before fiddling with these values as otherwise we can't know about bcond's set in the spec.
I can't really see how we can parse the whole spec file first and then decide on what to do here as having a macro within the spec file is one of the objectives. I see two options:
1. Have a macro that is for --nocheck only and leave figuring out how that relates to `%with_check` to the spec author.
2. If we meddle with the --with/--without check mechanic this should work like an implicit `%bcondwithout check` line. This has the issue that it won't work properly with spec files that do have `%bcondwith check`. One way to fix this could be extending `bcond_with` and `bcond_without` to `%undefine` the `with_` macro in the `else` case. That way the defaults could be overwritten by later lines. This sounds a bit like a bad feature to advertise to packagers but may be ok for this.
Another issue here is whether any of these macros should affect whether %check is actually run. No longer running %check on a missing `%with_check` macro will change the behaviour of existing spec files. While technically not running %check should not break anything this is kinda ugly.
At the same time the `bcond` mechanic is not great to control by system wide defined macros. Yes, one could define `%_without_check` but it won't disable check done in `%bcon_with check` specs getting passed `--with check`. Otoh that may just be the desired behaviour.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1256#issuecomment-1033633078
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/1256/c1033633078 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220209/d8e27fdc/attachment.html>
More information about the Rpm-maint
mailing list