Bug 7984 - RPM backend does not honor package overrides for PACKAGE_ARCH
Summary: RPM backend does not honor package overrides for PACKAGE_ARCH
Status: ACCEPTED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Yi Zhao
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-07-09 21:04 UTC by Randy Witt
Modified: 2026-04-30 15:03 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
Recipe that will demonstrate the bug (285 bytes, application/octet-stream)
2015-07-09 21:04 UTC, Randy Witt
no flags Details
Attempt to fix this issue (1.63 KB, patch)
2015-07-10 07:57 UTC, Richard Purdie
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Randy Witt 2015-07-09 21:04:21 UTC
Created attachment 2582 [details]
Recipe that will demonstrate the bug

Using master as of 48b5ea6782ec7e9ab8f9a28438ef0ededa5fe224, if you use a package overrides as part of PACKAGE_ARCH when using the rpm backend. The override is not honored.

I've attached a recipe that will produce the problem. Using the attached recipe one would expect that package-b would be have architecture of "all" in the rpm metadata, however it ends up being equal to the default. i.e. TUNE_PKGARCH

This problem does not occur when using ipk. The ipk backend overrides the PACKAGE_ARCH for package-b as expected.
Comment 1 Richard Purdie 2015-07-10 07:57:13 UTC
Created attachment 2583 [details]
Attempt to fix this issue
Comment 2 Richard Purdie 2015-07-10 07:58:03 UTC
Trouble is when you run this, you see:
| DEBUG: Executing shell function BUILDSPEC
| error: line 11: Only "noarch" sub-packages are supported: BuildArch: all
| error: Package has no %description: test2-1.0-r0.0.all
| Building target platforms: core2_32-poky-linux


i.e. rpm only supports noarch subpackages.
Comment 3 Richard Purdie 2015-07-16 14:39:52 UTC
At the very least we should put a sanity check into package_rpm so that if this scenario comes about, it will error rather than silently "work" and do the wrong thing.

Once that is done, the bug can be pushed out into Future.
Comment 4 Mark Hatle 2015-07-20 18:19:01 UTC
In the past RPM did not support generating "noarch" (equivalent to all) packages from within a spec file that had arch specific items.

We should check if this is now supported and modify the spec file generated to match.  If it is not supported, we'll need to generate an error or warning that something unsupported is being attempted.  (The alternative implementation is to break up the packaging into multiple steps.  Once for each specified arch.)
Comment 5 Mark Hatle 2016-02-16 15:06:03 UTC
At a minimum a warning or something similar should be implemented in the RPM backend to make it clear what will happen.
Comment 6 Chen Qi 2017-01-09 08:53:58 UTC
I think a warning is sufficient. Two reasons below.

1) When such a rare case is encountered, just warn the user and ask him to split the recipe into multiple ones. I think it's cleaner than generating multiple rpm spec files for one recipe.
2) I searched OE and meta-openembedded repo, no such case. If we change the rpm backend logic for a case which could not be found in all our repos, isn't it a little weird?
Comment 7 Randy MacLeod 2019-11-21 16:10:40 UTC
Yi can you work on this for 3.1.
Comment 8 Mathieu Dubois-Briand 2026-04-30 15:03:50 UTC
Did we ever had the warning?