Bug 32569 - urpmi --buildrequires does not support setting macros for correct spec evaluation
Summary: urpmi --buildrequires does not support setting macros for correct spec evalua...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-25 14:13 CET by Oleg Bosis
Modified: 2023-11-26 14:01 CET (History)
2 users (show)

See Also:
Source RPM: urpmi-8.131-1.mga9.src.rpm
CVE:
Status comment:


Attachments

Description Oleg Bosis 2023-11-25 14:13:57 CET
Description of problem:

While waiting for a fix for bug 32516 I've decided to build proper sqlite3 version locally using chroot environment.
The spec file for sqlite3 contains directive '%bcond_with icu' and it is used to build sqlite3 with ICU support. But when I try to install build dependencies I get the following result:

$ LC_ALL=C sudo urpmi --buildrequires --no-recommends --no-verify-rpm --with icu sqlite3.spec
Unknown option: with
No package named icu

Version-Release number of selected component (if applicable):
urpmi-8.131-1.mga9.src.rpm

How reproducible:
Always

Steps to Reproduce:
1. Try to install build dependencies for any conditional-building spec-file using urpmi --buildrequires command and '--with' option.
2.
3.
Comment 1 Lewis Smith 2023-11-25 21:22:22 CET
Thank you for the report, and apologies for the inconvenience it is causing.

--buildrequires
           Select all the "BuildRequires" of the wanted source packages.  (You
           can also install the build dependencies read directly from an rpm
           spec file.)

But there is no sign of '--with' in the urpmi man page. Where did you get that from?

CC: (none) => lewyssmith
Assignee: bugsquad => mageiatools

Comment 2 Oleg Bosis 2023-11-25 23:40:52 CET
(In reply to Lewis Smith from comment #1)

> But there is no sign of '--with' in the urpmi man page. Where did you get
> that from?

The '--with' option is an rpm's option to conditionally build packages with selected features ( https://rpm-software-management.github.io/rpm/manual/conditionalbuilds.html ). The same option is used to conditionally require or not require BRs.

For example, sqlite3 uses it to add BR on ICU:

%bcond_with icu
...
%if %{with icu}
BuildRequires:  icu-devel
%endif


Ignoring (not understanding) this option by urpmi means this dependency is missing and proper build with required feature is impossible without removing this condition from spec file.
Comment 3 katnatek 2023-11-26 02:45:55 CET
Just change

%bcond_with icu

For

%bcond_without icu

Save the spec and install the buildrequires
Comment 4 Oleg Bosis 2023-11-26 09:15:39 CET
Changing conditions, removing them or any other ways of editing spec file are not a solution but just workaround.

I think there has to be a proper solution: support --with and --without options in urpmi for installing BRs.
Comment 5 Neal Gompa 2023-11-26 13:58:44 CET
You could also try "dnf builddep --define='_with_sqlite 1' sqlite3.spec" and see if that works for you?

CC: (none) => ngompa13

Comment 6 Neal Gompa 2023-11-26 13:59:21 CET
(In reply to Neal Gompa from comment #5)
> You could also try "dnf builddep --define='_with_sqlite 1' sqlite3.spec" and
> see if that works for you?

Erk, I mean "dnf builddep --define='_with_icu 1' sqlite3.spec"
Comment 7 Neal Gompa 2023-11-26 14:01:09 CET
((In reply to Oleg Bosis from comment #4)
> Changing conditions, removing them or any other ways of editing spec file
> are not a solution but just workaround.
> 
> I think there has to be a proper solution: support --with and --without
> options in urpmi for installing BRs.

The correct solution for urpmi --buildrequires would be to support setting macros for triggering specific logic here.
Neal Gompa 2023-11-26 14:01:33 CET

Summary: urpmi --builrequires complains on unknown option 'with' => urpmi --buildrequires does not support setting macros for correct spec evaluation


Note You need to log in before you can comment on or make changes to this bug.