Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have 32bit choice when build with pkgconfig #724

Open
zyppe opened this issue Oct 4, 2021 · 7 comments · May be fixed by #1002
Open

Have 32bit choice when build with pkgconfig #724

zyppe opened this issue Oct 4, 2021 · 7 comments · May be fixed by #1002

Comments

@zyppe
Copy link

zyppe commented Oct 4, 2021

When I build rpm with build script, if my spec has pkgconfig something, build will say have choice for pkgconfig (): ... ...-32bit
An example is:
When I build grub2
My command is
sudo build --debug --repo https://mirror.sjtu.edu.cn/opensuse/update/leap/15.3/sle/ --repo https://mirror.sjtu.edu.cn/opensuse/update/leap/15.3/backports/ --repo https://mirror.sjtu.edu.cn/opensuse/update/leap/15.3/leap/ --repo https://mirror.sjtu.edu.cn/opensuse/update/leap/15.3/oss/ --repo https://mirrors.huaweicloud.com/opensuse/distribution/leap/15.3/repo/oss/ --dist sle15.3 grub2-2.04-20.4.src.rpm
It will tell me
expansion error
have choice for pkgconfig (libudev) needed by device-mapper-devel: libudev-devel libudev-devel-32bit
have choice for pkgconfig (bzip2) needed by freetype2-devel: libbz2-devel libbz2-devel-32bit
I know maybe it is not a bug, but could you tell my how to resolve it?

@zyppe
Copy link
Author

zyppe commented Oct 4, 2021

PS: Could you tell me how to generate lib with -32bit suffix?

@mlschroe
Copy link
Member

mlschroe commented Oct 4, 2021

Usually the 32bit packages are de-preferred in the project config, so this may be called a bug.

For now you should be able to tell the build program which package to use by calling it with -X libudev-devel -X libbz2-devel.

@mlschroe
Copy link
Member

mlschroe commented Oct 4, 2021

The -32bit packages are created by adding the --baselibs option and doing a build for the i586 arch, i.e. by prepending a linux32 call to the command line:

sudo linux32 build --baselibs...

@zyppe
Copy link
Author

zyppe commented Oct 4, 2021

I found this bug in openSUSE 15.3, in openSUSE 15.2, it doesn't have this bug.
You can just ust --dist sle15.3 and this will trigger this fault.
Could you leave me a command example for generate 32bit package such as zlib?

@zyppe
Copy link
Author

zyppe commented Jan 9, 2022

[ 4s] expansion error
[ 4s] have choice for pkgconfig(libudev) needed by device-mapper-devel: libudev-devel libudev-devel-32bit
[ 4s] have choice for pkgconfig(bzip2) needed by freetype2-devel: libbz2-devel libbz2-devel-32bit
[ 4s] have choice for libffi.so.7()(64bit) needed by python3-base: ghc-bootstrap libffi7
[ 4s] have choice for libffi.so.7(LIBFFI_BASE_7.0)(64bit) needed by python3-base: ghc-bootstrap libffi7
[ 4s] have choice for libffi.so.7(LIBFFI_CLOSURE_7.0)(64bit) needed by python3-base: ghc-bootstrap libffi7
This bug still has not been fixed

@zyppe
Copy link
Author

zyppe commented Jan 9, 2022

It seems that this bug is not from obs-build, because I used Leap 15.2 version of build, but is there anyone could tell me what cause it, is there any method to fix it?

@badshah400
Copy link

This is in my opinion a baselibs issue. Having developers manually specify a preference order for pkgconfig deps in every project is asking too much.

A workaround, at the package level is to manually drop the pkgconfig file from the baselibs generated packages as done here:
https://build.opensuse.org/request/show/1172098
but that is also very unwieldy.

I suggest that baselibs should not automatically package anything except the libs. That is, please drop the .pc from

+.*/lib(64|ilp32)?/.*\.(so\..*|so|o|a|la|pc)$

Of course if a developer specifically want, say their -32bit-devel package to carry the pkgconf file, they can add it manually to their baselibs.conf, but I doubt this is needed in most cases.

badshah400 added a commit to badshah400/obs-build that referenced this issue May 9, 2024
Fixes openSUSE#724.

Avoid default inclusion of pkgconfig files in automatically generated
baselibs configured biarch packages. This avoids the "have choice" issue
seen with `BuildRequires: pkgconfig(FOO)` type dependencies on OBS for
any dependents of a biarch FOO-devel package. It is wrong to ask every
project supporting biarch devel packages to configure project macros to
disfavour one pkgconfig based dependency in favour of another.

Packager may at their wish explicitly include the pkgconfig file in the
biarch package explicitly by appropriately configure the associated
baselibs.conf file, but as a default, this should be hardly ever
required.
@badshah400 badshah400 linked a pull request May 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants