Bug 12060 - It is possible to specify a PACKAGE and a PKG_ rename that conflict
Summary: It is possible to specify a PACKAGE and a PKG_ rename that conflict
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ minor
Target Milestone: 4.2 M4
Assignee: Fawzi KHABER
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-09-06 16:41 UTC by Mark Hatle
Modified: 2023-03-31 10:42 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
log (5.63 KB, application/octet-stream)
2023-03-07 14:11 UTC, Fawzi KHABER
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hatle 2017-09-06 16:41:12 UTC
It is possible to specify both a PACKAGE and PKG_ that conflict, the libmtp within meta-openembedded is doing this.

The key code is:

PACKAGES =+ "libmtp-common libmtp-runtime mtp-tools"

RDEPENDS_${PN} += "libmtp-common"
RRECOMMENDS_${PN} += "libmtp-runtime mtp-tools"
FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*"
PKG_${PN}-bin = "mtp-tools"
SUMMARY_${PN}-bin = "Tools for communicating with MTP devices"


The package '${PN}-bin' is being renmaed by the PKG_${PN}-bin to be 'mtp-tools', but mtp-tools already exists in the PACKAGES variable.

This same type of problem could occur via an automatic rename (such as the debian.bbclass).

A package qa of some sort is needed to look for this and error before it produces a packaging error (this fails with RPM) or an indeterminate behavior.
Comment 1 Fawzi KHABER 2023-03-07 14:11:55 UTC
Created attachment 4934 [details]
log

While trying to reproduce the bug, it seems like in recent version, it is not possible to use PACKAGES and PKG_ to set a name conflict, As it throws :

line 61: %package -n <name>: package <name> already exists

This should be resolved ?
Comment 2 Fawzi KHABER 2023-03-07 14:14:03 UTC
ping
Comment 3 Fawzi KHABER 2023-03-08 14:06:49 UTC
a simple recipe to test package rename

LICENSE = "closed"

PACKAGES += "bot"
PKG:${PN}-dev = "bot"
Comment 4 Yoann Congal 2023-03-08 21:44:31 UTC
@Fawzi, reading the commit that removed the conflict in libmtp [1], we can see that we still have the same error. As suggested by Mark Hatle, I think we should at least warn (if not error) when this case arises.

1: https://github.com/openembedded/meta-openembedded/commit/51c3205dc838e9365b2b16a20e133f2c9b32a002