Commit Graph

235 Commits

Author SHA1 Message Date
Peter Kjellerstedt
c0f3bc79b3 devtool: reset: Escape command line input used in regular expression
Running, e.g., `devtool reset sdbus-c++` would result in the following
error:

  re.error: multiple repeat at position 35

This was due to the ++ in the recipe name, which would be treated as an
incorrect regular expression in _reset().

Use re.escape() to make sure all characters in the recipe name are
treated literally.

(From OE-Core rev: 6e73bd9b3e6d529752db93879f2c0ed53873dd1a)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-03-20 11:29:04 +00:00
Richard Purdie
c2da016918 meta/meta-selftest: Fix variable assignment whitespace
Recipes are much more readable with whitespace around the assignment operators.
Fix various assignments in OE-Core to show this is definitely the preferred
formatting.

(From OE-Core rev: 30ea609d3357fb3de911f2f6a5e6856c151b976a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-02-01 13:42:34 +00:00
Ross Burton
1c5a2c8bcc oeqa/poisoning: fix gcc include poisoning test
The test code in poison was flawed: as long as one CPP/CC/CXX has fatal
poisoning enabled then the test passes.  However, at the moment due to
a bad rebase only CPP has fatal poisoning and CC/CXX do not.

Rewrite the do_compile() task to more carefully check the output so the
test harness itself just has to bitbake the recipe.

Note that this results in the test failing:

  ERROR: poison-1.0-r0 do_compile: C Compiler is not poisoned.
  Exit status 0, output:  cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]
  ERROR: poison-1.0-r0 do_compile: C++ Compiler is not poisoned.
  Exit status 0, output:  cc1plus: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories]

(From OE-Core rev: 5b413d1fdb4bdbaec86d630bb52c3ccf68aae789)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-22 13:20:29 +00:00
Alexander Kanavin
70a650c26a bbconfigbuild/configfragments.py: set BBPATH in standalone datastore
Otherwise fragments with 'require' statements will not parse,
as the parser will not be able to find files referred to by
those statements.

Add such a statement to the test fragment so that the scenario
is tested.

[YOCTO #15707]

(From OE-Core rev: d88e63d1a7867b3a4ebfc57d472900136b5361d8)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-09 16:59:23 +00:00
Alexander Kanavin
22f046d67c bitbake-config-build: add a plugin for config fragments
This allows fine-tuning local configurations with pre-frabricated
configuration snippets in a structured, controlled way. It's also
an important building block for bitbake-setup.

The tool requires that each fragment contains a one-line summary, and one or more
lines of description, as BB_CONF_FRAGMENT_SUMMARY style metadata.

There are three (and a half) operations (list/enable/disable/disable all), and here's the 'list' output:

alex@Zen2:/srv/storage/alex/yocto/build-64$ bitbake-config-build list-fragments
NOTE: Starting bitbake server...
Available fragments in selftest layer located in /srv/work/alex/poky/meta-selftest:

Enabled fragments:
selftest/test-fragment	This is a configuration fragment intended for testing in oe-selftest context

Unused fragments:
selftest/more-fragments-here/test-another-fragment	This is a second configuration fragment intended for testing in oe-selftest context

(From OE-Core rev: fdb611e13bd7aa00360d3a68e4818ef5f05c8944)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-12-13 11:11:18 +00:00
Richard Purdie
7434b54289 selftest/static-group: Add seat
With a group added to the seatd recipe, we need an entry in our
static group file for selftest.

(From OE-Core rev: 655d334584769a9b9d86cf8fab2c06bc0878d0b3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-28 12:37:12 +00:00
Yoann Congal
131872001a oeqa/selftest: add a test for bitbake "-e" and "-getvar" difference
This is a non-regression test for [YOCTO #15638]

(From OE-Core rev: 22b508da24e0f7e5ad8ce4e090832bd0829963f0)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-18 22:09:03 +00:00
Ross Burton
0ddaa2913f oe-selftest-image: use explicit IMAGE_FEATURES instead of debug-tweaks
debug-tweaks is vague and doesn't give any indication that the root user
can login over SSH without a password.  This behaviour is incredibly
dangerous if used unwittingly, so discourage it by using the underlying
features explicitly to spell out exactly what is being done.

(From OE-Core rev: 83cd8b5ca4544e9b19c110035276e5de2ebe7404)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-06 12:18:05 +00:00
Ross Burton
109fe2eade selftest/container: fix IMAGE_FEATURES assignment
Assigning IMAGE_FEATURES="" in local.conf doesn't actually do anything
useful, as bitbake.conf has IMAGE_FEATURES += EXTRA_IMAGE_FEATURES after
the include of local.conf.

In this test case, this results in IMAGE_FEATURES still using
EXTRA_IMAGE_FEATURES, so the image contains the files installed by the
post-install-logging feature.

As the intention here is that container-test-image is as minimal as
possible, move the IMAGE_FEATURES assignment into the image itself so
it actually works, and update the expected file list to remove the
post-install-logging files.

(From OE-Core rev: c65349e1238ddc6634dfa4759c57e6168a355200)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-11-06 12:18:05 +00:00
Mikko Rapeli
18c123d8da oeqa selftest wic.py: support UKIs via uki.bbclass
Use label to detect rootfs since UKI with kernel command
line is generated before rootfs is generated by wic.

Adapt wic tests to build and boot uki.bbclass generated
UKIs.

Keeping one UKI test in wic.py and rest of the UKI features
are tested with dedicated uki.py test. Add plain non-UKI
systemd-boot tests to wic suite for aarch64 and x86.

(From OE-Core rev: 3f94256b977637d4276f82db7c20b8b5e57b9d86)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-25 15:12:22 +01:00
Richard Purdie
f4cd284ad7 layer.conf: Update to new layer/release series post-release
Switch from styhead to walnascar (aka walna).

(From OE-Core rev: 86999b5da960cbaa75eda1a75e3c42de22786677)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-10-01 12:40:48 +01:00
Peter Kjellerstedt
b971a3a77c oeqa/selftest/bbclasses: Add tests for systemd and update-rc.d interaction
These tests verify that the correct files are left behind when systemd
is inherited and depending on whether the systemd and/or sysvinit distro
features are enabled.

(From OE-Core rev: 4ef25caa00ad08046567d0e7f4523486c3a256d0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-09-01 11:05:20 +01:00
Mark Hatle
4462724cab selftest-hardlink: Add additional test cases
Additional test cases for debug symlink generation both binaries
and static libraries.

This also has the side effect of testing for race conditions in the
hardlink debug generation and stripping.

(From OE-Core rev: 7171f41c07a39a7543bb64f075d38b8e74563089)

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-22 16:53:06 +01:00
Richard Purdie
480dc1c0df selftest/fortran-helloworld: Fix buildpaths error
There is a buildpaths QA error in the test recipe that somehow didn't show up
in earlier testing. Use a source directory and tweak the build command to
avoid embedding build paths in the generated binary.

(From OE-Core rev: 8f1cfaf2be834217cd1cf5be98f44270c36cc31a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-15 13:12:51 +01:00
Adrian Freihofer
2c27b231f9 oe-selftest: fitimage drop test-mkimage-wrapper
Rather than writing hints into log files and verify the hints can be
found, the tests should verify that the artifacts in the deploy folder
are correctly signed. This is a much better test.
u-boot-tools provide a utility fit_check_sign which can verify the
signatures in fit images. Lets use it.

grepping in temp/run. or temp/log. files also does not work if the tasks
runs from sstate and the corresponding run file is not even generated.

(From OE-Core rev: 86e504b4f792eeadd67ea57dd71a62bcb4f16f02)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-07-13 23:28:30 +01:00
Tim Orling
c16d3b930f oe-selftest: add RECIPE_UPDATE_EXTRA_TASKS test
Add test_devtool_upgrade_recipe_update_extra_tasks test case
to test upgrade of python3-guessing-game from v0.1.0 to v0.2.0
which will exercise the update_crates task during the upgrade.

Add python3-guessing-game_git.bb.upgraded and
python3-guessing-game-crates.inc.upgraded  which are the 0.2.0
variants.

Check that the new recipe file has the expected differences.

Check that the new -crates.inc file has the expected differences,
which should be reproducible because of Cargo.lock.

(From OE-Core rev: d14368bc775cbf5142c1312dfc2076e328381aef)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-13 09:11:17 +01:00
Tim Orling
1ba3586bbe meta-selftest: add python3-guessing-game
Add v0.1.0 of python3-guessing-game which is used as the baseline
for an upgrade to v0.2.0 in test_devtool_upgrade_recipe_update_extra_tasks
test case.

(From OE-Core rev: f62e74a00de892bf4c10f641f734b57c0017a871)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-13 09:11:17 +01:00
Martin Jansa
582b2627a8 selftest: add Upstream-Status to .patch files
(From OE-Core rev: e5e5561c178a565b3aa7cb540fe1c8f71917c882)

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-06-10 14:27:24 +01:00
Richard Purdie
a5cea4c0b4 recipes: Ensure S is set to a valid directory
Several recipes have S pointing at a directory that does not exist.
Set S in these cases to somethig valid making the metadata and
recipe behaviour more consistent.

Tweak one of the QA test diff offsets to match the changed recipe.

(From OE-Core rev: 22f1f5849a9a3bf287dbe8933546e52e39ddc86e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Richard Purdie
6d77296d83 devtool: Drop oe-local-files and simplify
The only real reason for oe-local-files was to support S = WORKDIR. With changes to
drop support for that, it makes sense to simplify devtool and to try and make both
the code and the processes/workflows simpler.

This patch drops support for S = WORKDIR, removes oe-local-files and then updates
the test cases to match this new situation.

At the code level, we assume we can always now track code changes using git and
that things committed into git are handled as patches (as before) but delta against
HEAD is saved as specific file level changes to the recipe.

One test is disabled as it is no longer approproate. It is being keped until we can
make WORKDIR != UNPACKDIR at which point it should be revisited.

(From OE-Core rev: ce8190c519052fed10b5233697b69a75868db45a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Richard Purdie
d6ae8d2004 recipes: Switch away from S = WORKDIR
Where recipes use S = ${WORKDIR}, change them to set UNPACKDIR to
a subdir of WORKDIR and make S point at this instead.

I've chosen not to force S into any standard UNPACKDIR we may pick in
future just so the S = UNPACKDIR case is clearly visible by the
directory naming under WORKDIR as that should aid usability.

(From OE-Core rev: d9328e3b0b062f0621de3d114584b44f384a1c02)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Richard Purdie
71c6db8e65 recipes: Start WORKDIR -> UNPACKDIR transition
Replace references of WORKDIR with UNPACKDIR where it makes sense to do
so in preparation for changing the default value of UNPACKDIR.

(From OE-Core rev: 1f18b9a512800860d5153d89eb82b56388efad6f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-21 12:08:04 +01:00
Ross Burton
41e59c53c5 selftest/classes: add localpkgfeed class
This class can be used to construct a subset of a deployed package feed
for use in tests which iterate the deploy directory, and as such a huge
feed of 30K+ packages can result in very slow tests.

(From OE-Core rev: c5486d6ad32457f09c104d5dd31314bd570912d3)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-15 16:39:19 +01:00
Richard Purdie
0ea63b6a43 recipes: Update WORKDIR references to UNPACKDIR
Since we want to be able to stop unpacking to WORKDIR, correct the WORKDIR
references in recipe do_compile/do_install tasks to use UNPACKDIR in the
appropraite places instead.

(From OE-Core rev: d73595df69667fe9d12ecd407b77a0b8dae2109c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-02 15:15:51 +01:00
Richard Purdie
3288587aeb recipes: Update S = WORKDIR recipes to use ${S} correctly
Where recipes use S = ${WORKDIR}, ensure they are referencing ${S} correctly
to access files as soon we want to stop doing this in WORKDIR at which point
they would break unless corrected.

(From OE-Core rev: f25dd633fffe6560f191526d1869e657e129bad9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-05-02 15:15:51 +01:00
Richard Purdie
281c2e716f layer.conf: Post release addition/switch to styhead corename
(From OE-Core rev: cef91ebeb3f2b1d41336fff60555064430a80397)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-16 08:12:27 +01:00
Baruch Siach
0c9d83138e oeqa/selftest/overlayfs: test read-only rootfs
Use the read-only squashfs filesystem to test the read-only case.

(From OE-Core rev: 1a61da196f014dc34a998d3e46f03abc79ebc84d)

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-04-04 14:05:03 +01:00
Eilís 'pidge' Ní Fhlannagáin
396bc832b7 selftest-users: Convoluted selftest for USERADD_DEPENDS
This adds a test for 13904's fix by creating a convoluted set of recipes
with USERADD_DEPENDS in non-alpha order.

(From OE-Core rev: bfff81195cb9ba2493e366022470b2e0051d8071)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-24 16:10:22 +00:00
Eilís 'pidge' Ní Fhlannagáin
6913454ffa creategroup*: Remove coreutils-native as a DEPENDS
There isn't any reason for coreutils-native as a DEPENDS, so
remove it to speed up tests.

(From OE-Core rev: 1aa91868094e8d4e3991cd3faebc17fdf6931907)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-23 14:29:03 +00:00
Richard Purdie
0b33104a97 python: Drop ${PYTHON_PN}
python 2 is gone and we don't need the abstraction now, drop the remaining usage
of this variable.

The definition in python3-dir.bbclass is left for now for other layers.

(From OE-Core rev: b566b1e32c7993d1ab7795562f648e52ce186a70)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-20 11:39:45 +00:00
Peter Kjellerstedt
24433ce8f9 lib/oe/patch: Make extractPatches() not extract ignored commits
If a commit is marked with "%% ignore" it means it is used by devtool to
keep track of changes to the source code that are not the result of
running do_patch(). These changes need to actually be ignored when
extracting the patches as they typically make no sense as actual patches
in a recipe.

This also adds a new test for oe-selftest that verifies that there are
no patches generated from ignored commits.

(From OE-Core rev: c3d43de7e54189bf09fbe8e87ddb976e42ebf531)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-19 16:03:22 +00:00
Richard Purdie
95cebcae00 layer.conf: Update for the scarthgap release series
Prepare for the scarthgap release.

(From OE-Core rev: b1835e657575c29da43a15a37c673dc37044fd85)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-09 13:58:18 +00:00
baruch@tkos.co.il
7c230aa0e9 overlayfs: add missing closing parenthesis in selftest
Cc: Vyacheslav Yurkov <uvv.mail@gmail.com>
(From OE-Core rev: aebd526cdfea738745e57183b1015fd327bd94df)

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-06 10:32:19 +00:00
Richard Purdie
c917323a39 classes/recipes: Switch to use inherit_defer
Now that bitbake supports the use of inherit_defer, switch all conditional
(variable based) inherits to use this instead. This leads to more a more
deterministic user experience since there is no longer an immediate expansion
and later changes to the variables in question (e.g. a bbappend) are
accounted for.

This patch tries to ensure the behaviour before/after remains as unchanged
as it reasonably can, e.g. by always inherting populate_sdk_base. native
and nativesdk continue to need to be inherited last, hence being used
with inherit_defer in a handful of very specific cases.

(From OE-Core rev: 451363438d38bd4552d5bcec4a92332f5819a5d4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-18 10:15:58 +00:00
Alexander Kanavin
67be7cf82b selftest/sstatetests: fix up printdiff test to match rework of printdiff logic
Other than the formatting changes, there are two functional ones:

- use perlcross instead of quilt, as quilt is special in the sense
of being excluded from task hash calculcations. perlcross is a full
participant.

- run the full test (local + sstate) for gcc do_preconfiure change
as the necessary fix has been implemented
(sstatesig/find_siginfo: special-case gcc-source when looking in sstate caches)

Note that when several tasks are found to have changed (as is the case
when base do_configure is adjusted), find_siginfo() runs
glob.glob("*/*/*taskname*") against autobuilder sstate cache for each
of those tasks (six or seven times). This is an expensive operation
taking several minutes. I left it in for now, but if it's proven too slow
the test would have to be reduced to checking a specific base recipe
(e.g. zstd-native) rather than a distant image target.

[YOCTO #15289]

(From OE-Core rev: 0ef7cf324718412c5b6c376acfbc4079ecd7d465)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-10 16:32:13 +00:00
Wang Mingyu
4b7e548463 aspell: upgrade 0.60.8 -> 0.60.8.1
CVE-2019-25051.patch
removed since it's included in 0.60.8.1

Changelog:
============
-Fix memory leak in suggestion code introduced in 0.60.8.
-Various documentation fixes.
-Fix various warnings when compiling with -Wall.
-Fix two buffer overflows found by Google's OSS-Fuzz.
-Other minor updates.

(From OE-Core rev: ec3c8642f71b470936b6dd29331afa467ab865c7)

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-01-01 23:11:42 +00:00
Alex Kiernan
b40a8e0208 zvariant: Drop recipe
This fails to build with newer rust

(From OE-Core rev: 8a286e686e5764f4def0644586dd19e2197ef6c2)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Alex Kiernan
781bd05a4b meta-selftest: hello-rs: Simple rust test recipe
(From OE-Core rev: 885e8e1fbfce79170ff7544dec5406d724da2560)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-30 11:03:08 +00:00
Adrian Freihofer
2df986746b oe-selftest: add a cpp-example recipe
This simple C++ project supports compilation with CMake and Meson.
(Autotool support could be added later on.)
It's supposed to be used with oe-selftest.

An artificial project has several advantages over compiling a normal
CMake or Meson based project for testing purposes:
- It is much faster because it can be kept minimalistic
- It can cover multiple odd corner cases
- No one will change it in an unpredictable way
- It can support multiple build tools with only one C++ codebase

(From OE-Core rev: 4904e772470b0d6e5d98ef0344b3f2bf54214661)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-13 11:58:15 +00:00
Eilís 'pidge' Ní Fhlannagáin
e3ce7ce215 useradd: Add testcase for bugzilla issue (currently disabled)
Add a disabled a test for 14961 - addtask between do_populate_sysroot and do_package breaks useradd class.
A fix is still needed for this.

(From OE-Core rev: b6af5788f7f8fb1e9d8ad14bd12168ff9d6baa21)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:51:10 +00:00
Eilís 'pidge' Ní Fhlannagáin
ecef665062 useradd: Fix issues with useradd dependencies
If recipe A requires the useradd actions of recipe B we need to
ensure that recipe B is part of the recipe A dependancy chain. In
order to do that, we introduce USERADD_DEPENDS. This makes sure
that the do_populate_sysroot_setscene of recipe B exists for
recipe A in case of a missing TMPDIR. This requires changes made in
runqueue.py by RP.

This commit along with the runqueue fixes effects:
Bug 13419 - recipes that add users to groups cannot rely on other recipes creating those groups (when population from sstate happens)
Bug 13904 - do_prepare_recipe_sysroot: postinst-useradd-* does not run in order of dependency and sometimes fails
Bug 13279 - Make sure users/groups exist for package_write_* tasks
Bug 15084 - For some reason using of same user in two recipes does not work properly

I've included the start of self-testing for useradd by adding tests for
13419 (which ends up testing 13904, 13279, 15084 by virtue of them all
      having the same root cause)

(From OE-Core rev: b47f2352376bd16b7e7087b4dab143403e67e094)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-08 17:51:10 +00:00
Peter Kjellerstedt
dd2fb8f00a devtool: upgrade: Update all existing checksums for the SRC_URI
In addition to updating the sha256sum and removing the md5sum, update
all other existing checksums. If the only existing checksum is md5sum,
then replace it with the default expected checksums (currently only
sha256sum).

(From OE-Core rev: 8ea8827ee49b7f0443b1c4bd47d1344a689d73a3)

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-12-08 16:58:34 +00:00
Yoann Congal
93a9621df3 meta-selftest/files: add xuser to static-passwd/-group
As xuser-account creates a new user, we need to add it to the testing
static passwd file.

(From OE-Core rev: 6c0637a2ba7621a6398dc62b4d019cd525ee8908)

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-20 15:30:52 +00:00
Richard Purdie
c6276d8e57 oeqa/selftest/sstatetests: Fix intermitttent errors and improve performance
You could reproduce an error in this test with:

bitbake core-image-minimal
bitbake tzcode-native -c cleansstate
oe-selftest -r sstatetests.SStatePrintdiff.test_image_minimal_vs_base_do_configure

since tzcode-native isn't needed once tzdata is available and isn't rebuilt
by "bitbake core-image-minimal" if it is missig. tzdata is allarch so if tzdata is
built on an x86 host, a aarch64 build machine would never build tzcode-native with
this set of calls.

Add a --runall option to the initial bitbake invocation to force these things to be
created if they're missing.

This explains why some failures were occurring on the infrastructure. With that issue
fixed, drop the hash mode change since I believe this fixes that issue. That
restriction was hurting performance, this should allow sstate reuse for the test
and improve the speed of it.

(From OE-Core rev: 8f03ac39e7fe21f3d6eca35b12b203a73a15285d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-11-09 11:45:37 +00:00
Alexander Kanavin
2187e823ad selftest/sstatetests: add tests for 'bitbake -S printdiff'
'bitbake -S printdiff' is a useful diagnostic facility for finding out
why sstate is not being reused, but until now it had no tests that would
ensure it works. This commit adds three basic scenarios:

1. make a change in a really basic, common recipe that is at the very root
of dependency trees (quilt-native), and ensure that change is correctly discovered when
building an image.

2. make a change in gcc-source recipe, which is somewhat special
(operates in work-shared), and ensure that gcc-runtime builds track
that down as well.

3. make a change in base_do_configure() definition from base.bbclass,
which is not recipe-specific, but affects many basic recipes, and ensure that
is correctly reported as well.

The test itself actually runs twice:
- first against a fully populated build directory, where
the printdiff code is guaranteed to find the correct previous
stamp that can be compared with in a predictable manner.

- then in an empty build directory where the printdiff code
goes to look in the sstate cache, and so the existence of the
previous signature can be tested, but not the difference with it
(what the exact difference would be is unpredictable as the
sstate cache is indeed shared between many builds).

(From OE-Core rev: 7a7d76aa8a8d590ebc99156f9f4b9535cdf868c7)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-27 10:53:43 +01:00
Richard Purdie
1b94ea8b25 recipes: Drop remaining PR values from recipes
We've been removing PR values from recipes at upgrade time for a while. In general
anyone maintaining a binary distro would end up having to curate these themselves
so the values in OE-Core aren't really that useful anymore. In many ways it makes
sense to clear out the remaining ones (which are mostly for 'config' recipes that
are unlikely to increase in PV) and leave a clean slate for anyone implementing
a binary distro config.

References are left in meta-selftest since the tests there do involve them and
their removal upon upgrade.

(From OE-Core rev: d4c346e8ab8f3cae25d1b01c7331ed9f6d4f96ef)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-22 07:45:17 +01:00
Mikko Rapeli
33d28b7265 oeqa dnf_runtime.py: fix HTTP server IP address and port
Use correct HTTPService parameters like apt.py when setting up the repo
server. These work with qemu tun and slirp networking. Fixes test
failure with slirp networking when executing testimage.bbclass
selftests "oe-selftest -r runtime_test.TestImage".

(From OE-Core rev: 764424df2f4b6bf0e89fb20b4253a7601468f70d)

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-12 12:37:56 +01:00
Richard Purdie
eb7b8476ee layer.conf: Update to nanbield release series
(From OE-Core rev: f212cb12a0db9c9de5afd3cc89b1331d386e55f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-10 08:58:53 +01:00
Richard Purdie
65318019cd recipes/classes/scripts: Drop SRCPV usage in OE-Core
Now that SRCPV isn't needed we can simplify things in a few places...

(From OE-Core rev: 843f82a246a535c353e08072f252d1dc78217872)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24 16:50:24 +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