Commit Graph

19 Commits

Author SHA1 Message Date
Jonathan GUILLOT
c2a7c008e1 lib/oe/package: add LOCALE_PATHS to add define all locations for locales
Some packages may contain localized files not located in default path
${datadir}/locale. Add the new variable LOCALE_PATHS to allow a recipe
to define extra paths or even fully override the scanned directories.
LOCALE_PATHS is set at ${datadir}/locale by default to keep the exact
same behavior for the recipes which did not need modification.

(From OE-Core rev: 0ffc7cf01225743789ac30dd325fca05b9203be1)

Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-14 13:53:36 +00:00
Etienne Cordonnier
959b1f7de4 gdb/systemd: enable minidebuginfo support conditionally
Enabling minidebuginfo is not useful if gdb and systemd-coredump
are unable to parse it.

In order to parse it, gdb needs xz support. Systemd needs coredump enabled, as
well as elfutil enabled as well (systemd-coredump loads libdw which is part of elfutils using dlopen).

(From OE-Core rev: 0d2df803bebfd7e832ab7da54c4dacaaeeb424a9)

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-06 22:55:50 +00:00
Richard Purdie
b177f37728 package/package_write: Improve packagedata code location
Move the do_packagedata dependencies into the package_write codeblocks
themselves. Also drop the dependency for the tar package backend which
was dropped.

(From OE-Core rev: 372a7f2e3c5c03da044e576e1501e86f8938f5e6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-08 10:56:35 +00:00
Sergei Zhmylev
251a5c88f6 classes: Move package RDEPENDS processing out of debian.bbclass
INHERIT_DIRSTO by default includes debian.bbclass which in turn properly
establishes dependencies between package management tasks and build
process. Debian class also unconditionally renames several packages in a
Debian way. In order to allow disabling of such renaming rules, the logic
of RDEPENDS handling is moved to a package.bbclass.
This commit also solves the SDK building issue without debian.bbclass.

(From OE-Core rev: 8313a4201cde39c444aa6fbe82e46a767fc31f6b)

Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-06 16:49:21 +00:00
Peter Kjellerstedt
ef66352fcc packages.bbclass: Correct the check for conflicts with renamed packages
The original solution replaced all overrides with the package name that
was being checked. This can have unforseen consequences where some
variable involved in defining the value for the PKG:<package> variable
may rely on some override which is not set as expected. It also meant
that any PKG variable set using an override would not be caught, e.g.,
PKG:${PN}:${MACHINE} = "${PN}-dev" (made up example that would always
fail with the old code).

(From OE-Core rev: de62d538dbfe6caf123ff366643f893077175583)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-06 11:51:11 +01:00
Richard Purdie
62afa02d01 base/package: Move source revision information from PV to PKGV
Source control information being present in PV used to be a hard requirement
for bitbake to operate correctly. Now that hashes are a required part of task
stamps, this requirement no longer exists.

This means we can defer the hash pieces to PKGV and simplify PV.

Use new bitbake fetcher API to inject the source revisions directly into the hash
allowing removal of some horrible code from base.bbclass and avoiding any hardcoding
about how SRCREV may or may not be used.

Use that API to object the string to append to PKGV and append that directly.

The user visible effect of this change is that PV will no longer have revision
information in it and this will now be appended to PV through PKGV when the
packages are written. Since PV is used in STAMP and WORKDIR, users will see
small directory naming and stamp naming changes.

This will mean that sstate reuse through hash equivalence where the source
revision changes but the output does not will become possible as the sstate
naming will become less specific and no longer contain the revision.

The SRCPV variable will no longer be needed in PV and is effectively now just
a null operation. Usage can be removed over time.

(From OE-Core rev: a8e7b0f932b9ea69b3a218fca18041676c65aba0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24 16:50:24 +01:00
Fawzi KHABER
b8486ffe80 package.bbclass: check packages name conflict in do_package
It is possible to rename packages with the macro PKG:${PN} and result in
a package name conflict if the target name exists already.

Add a fatal check to prevent this issue to go unnoticed.

Fix [Yocto #12060]

Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr>
(From OE-Core rev: f6cb63d3a871c4eef52d981131a56bf41aa1dcdf)

Signed-off-by: Fawzi KHABER <fawzi.khaber@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-30 12:32:30 +01:00
Richard Purdie
c8dd8c99ef abi_version/sstate: Handle pkgconfig output changes and bump output versions
A recent package.py change has highlighted some corruption issues with -dev
pkgconfig package dependencies. Bump the output versions to trigger a rebuild
and ensure everything is consistent.

Take the opportunity to also drop all HASHEQUIV_HASH_VERSION entries since the
main version is changing.

(From OE-Core rev: f45ddfbf007de858327eef0ffefd5840ef4c69b8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-26 18:50:17 +01:00
Richard Purdie
47ddb0f26d package: Drop support for PACKAGEBUILDPKGD function customisation
We don't really need the customisation capability of PACKAGEBUILDPKGD
since we also have PACKAGE_PREPROCESS_FUNCS which is generally used
by recipes. Drop PACKAGEBUILDPKGD to have some simpler/clearer code.
This allows some function wrappers to be removed too.

(From OE-Core rev: 6a4f24724cea3ddf55cacccb80fa54aa898dfa86)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
99de12f152 package: Move mapping_rename_hook to packagedata function library
This function is used by the packaging tasks/classes and makes much
more sense in the packagedata function library.

(From OE-Core rev: 7a512a8803101310772d83836e6b78ebaf8121de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
ab8c9d503e package: Drop unused function and obsolete comment
The function appears unused and the comment obsolete, drop them.

(From OE-Core rev: f3745718f8ec3bbed9816bf3d891e9885f8518b5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
e4f17fd72d package: Move package functions to function library
Move the bulk of the remaining package "processing" functions over
to the package function library for parsing efficiency.

(From OE-Core rev: f8785117074908330faca0b99afa7f60ed6ad952)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
b3573d38ef package: Move emit_pkgdata to packagedata.py
Move one of the PACKAGEFUNCS from the package bbclass to packagedata
library code for parsing efficiency.

(From OE-Core rev: ceba33bf2897f7dd5b1ffe6b742c47bf616243c8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
a099ed2125 package: Move pkgdata handling functions to oe.packagedata
To avoid reparsing the bbclass code all the time, move the functions
to the packagedata python function library code which is more efficient.

(From OE-Core rev: f520a3039540b1183b1b2bdaaf8b9195995c0187)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
93be2cdf49 package: Move get_conffiles/files_from_filevars functions to lib
To avoid reparsing the bbclass code all the time, move the functions
to the python function library code which is more efficient.

(From OE-Core rev: 424e65627c018b3119050f515b0c7cfb43be5573)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Richard Purdie
ed07d52b47 package: Move fixup_perms function to bb function library
To avoid reparsing the bbclass code all the time, move the function
to the python function library code which is more efficient.

(From OE-Core rev: 7c8c4cfd9355a9cee1144e0444e1b54402f1951c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-01-05 11:52:50 +00:00
Nathan Rossi
0f21df06a7 package: Fix handling of minidebuginfo with newer binutils
Newer versions of binutils (2.38+) have changed how the
"--only-keep-debug" of objcopy behaves when stripping non-debug sections
from an ELF.

  https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=68f543154e92ab0f5d6c569e0fa143f5e8bd2d80

This change causes associated sections to be correctly marked as NOBITS
with the section contents removed from the output. The side effect is
that this causes issues with objcopy's ability to perform symbol and
relocation stripping (-S/--strip-all) on the debug split ELF, such that
with some object files (e.g. kernel modules) objcopy fails to strip
symbols/relocations with an error like the following:

  .../.debug/nls_cp950.ko[.rodata]: file truncated

Because of this it is now problematic to generate minidebuginfo for
these types of ELF objects. However it is not typically useful to inject
minidebuginfo into these types of ELFs, and other distributions (e.g.
Fedora, referring to find-debuginfo.sh of debugedit) only insert
minidebuginfo into executables and shared libraries.

This change causes the minidebuginfo injection to only apply to EXEC/DYN
type ELFs, which limits the injection to executables and shared
libraires.

Additionally this change fixes the parsing of the sections from the
"readelf -W -S" output which was not accounting for the section index
column having leading spaces for single digit index values e.g. "[ 1]".

(From OE-Core rev: 2084cfcb3d15db3e02637f1cd63ab9c997f38a65)

Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-11 13:43:40 +00:00
Richard Purdie
1d6c7af0e3 package: Switch debug source handling to use prefix map
Reproducible builds are no longer a configuration option but are required.
We also rely on the prefix mapping capability of the compilers now.

As such, rewrite the source locating code to use the prefix maps instead
of taking a guess about WORKDIR which isn't correct for kernels, gcc,
externalsrc and probably more.

Instead, iterate the maps to locate any matching source code, keeping
in mind that multiple maps may map to one target location.

(From OE-Core rev: cbd6144a9769d21371ae0fe04db2adc05f6eed02)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-17 19:57:32 +01:00
Richard Purdie
fd1517e2b5 classes: Update classes to match new bitbake class scope functionality
Move classes to classes-global or classes-recipe as appropriate to take
advantage of new bitbake functionality to check class scope/usage.

(From OE-Core rev: f5c128008365e141082c129417eb72d2751e8045)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12 15:27:17 +01:00