summaryrefslogtreecommitdiffstats
path: root/meta/classes
AgeCommit message (Collapse)Author
2021-11-25rootfs_rpm.bbclass: distutils -> sysconfig moduletimo/core-deprecate-distutils_14610Tim Orling
Change a comment to reference our custom changes to the sysconfig module, as dnf no longer uses distutils. [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25python3native.bbclass: distutils -> sysconfigTim Orling
In the comment it says we patch distutils modules, but we now are patching sysconfig and not using disutils. [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25waf.bbclass: drop usage of distutilsTim Orling
Refactor to use newly imported bb.version.LooseVersion [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25sanity.bbclass: drop usage of distutilsTim Orling
Refactor to use newly imported bb.version.LooseVersion and replace `import distutils.sysconfig` with 'import sysconfig`. https://www.python.org/dev/peps/pep-0632/#id23 [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25setuptools: refactor for no distutils bbclassesTim Orling
Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25classes/distutils-*: add warning of deprecationTim Orling
distutils has been deprecated in Python 3.10 and will be removed in Python 3.12 (predicted release date October 2023). Add a warning now that recommends using the roughly equivalent setuptools-* classes. [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com>
2021-11-25sstate: explicitly name the checkhashes thread poolRoss Burton
Give this thread pool a name for clarity. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-24image: Include psplash only when screen machine feature is enabledKhem Raj
base-image boots in degraded mode when using systems without display system since there is no fb device detected and pslash service would fail to start. Removing this image feature means that core-image-base is complete for headless devices [RP: tweak the false case so it builds] Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-24buildhistory: Fix do_package race issuesRichard Purdie
The buildhistory_list_pkg_files function uses data from do_package, not do_packagedata. Usally the two are restored together but it may see a half complete directory or other races issues depending on timing. Rework the function so that it uses the correct task dependencies. This should avoid races but means the data is only restored to buildhistory if the do_package or do_package_setscene tasks are restored. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23buildhistory: Fix srcrevs outputRichard Purdie
The code was assuming that the a recipe with only one srcrev wouldn't "name" it. This isn't the case as the glibc or bzip2 recipes show, you can have a single srcrev which is named. We can pull the data from the fetcher and in fact we already have it, we just need to handle the "default" case and make that code the default for all srcrev regardless of length. [YOCTO #14017] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23buildhistory: Drop support for older bitbakesRichard Purdie
We've bumped the minimum bitbake version past the point this fallback code was needed, drop it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23classes/crate-fetch: Ensure crate fetcher is availableJoshua Watt
Reworks the crate fetcher class to have it install the fetcher at recipe finalization so that it is always available before SRC_URI is expanded. In addition, override the value of SRCPV to also install the fetcher when SRCPV is expanded so that AUTOREV works. [YOCTO #10867] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23rootfs-postcommands: update systemd_create_usersVyacheslav Yurkov
Process all systemd-sysusers configuration files in order to create users/groups at build time. systemd-sysusers would try to create them at run-time, but for read-only rootfs that's not possible and results in warnings from different services: systemd-udevd[166]: /lib/udev/rules.d/50-udev-default.rules:39 Unknown group 'render', ignoring systemd-udevd[166]: /lib/udev/rules.d/50-udev-default.rules:40 Unknown group 'render', ignoring systemd-udevd[166]: /lib/udev/rules.d/50-udev-default.rules:42 Unknown group 'sgx', ignoring Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-23classes/meson: Add optional rust definitionsJoshua Watt
Adds the rust tools to the cross and native files if present so that projects that use both rust and meson can build Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-21create-spdx: Fix key errors in do_create_runtime_spdxAndres Beltran
Currently, the do_create_runtime_spdx task fails with a Key Error if a dependency is not contained in the package providers dictionary. Add a check before using "dep" as a key in "providers". Signed-off-by: Andres Beltran <abeltran@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-21create-spdx: Protect against None from LICENSE_PATHSaul Wold
If LICENSE_PATH is not set, then the split() will fail on a NoneType. Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-21create_spdx: ensure is_work_shared() is uniqueSaul Wold
There is a function with the same name is_work_shared() in the archiver class this causes a conflict when both classes are included. Use work-shared as the check in WORKDIR to allow for other packages beyond the kernel and gcc that use a common shared-work source directory. Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-16sstate: add a function to get the sstate file name in sstate_checkhashesJose Quaresma
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-16sstate: only search on the mirrors for the missing filesJose Quaresma
The existence of missed files on the local sstate cache is the condition to search for it on the sstate mirror. The missed collection are populated when we search the files on the local sstate cache. - When we have sstate mirrors we don't need to iterate all files again because we already know what's missing. - When we found a file on the sstate mirror is because of they are missing on the local sstate mirror. So avoid checking if the hash exists on the missed collection. - When we can't find the file on the sstate mirror we don't need to add the hash again to the missed collection as it already exists. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-16sstate: cleanup the sstate mirror progress checkJose Quaresma
We only have the progress bar when there are more than 100 objects. So we can check for this and store the result to show the progress bar. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-15package: Add sanity check for allarch packagegroupsRichard Purdie
We exclude allarch packagegroups from rebuilding when their dependencies change. The reasoning is that we are just depending on a name so having these rebuild lots is just pointless and inefficient. We also don't want them duplicated for multiple machines for efficiency. In general this works fine, as long as the package names don't change. That is also rare but there is one corner case which does catch users out - debian package renaming. When this does break, users question sstate and so on and lose faith in the system even if this is a known choice we made. This commit adds an error message if an allarch packagegroup depends on any package which shows package renaming in action (through the PKG variable being set). If you run into this issue you either need to remove the dependency from the packagegroup or mark the packagegroup as tune specific, i.e. set: PACKAGE_ARCH = "${TUNE_PKGARCH}" before the packagegroup inherit. [YOCTO #7298] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13runqemu: support rootfs mounted roAdrian Freihofer
Optionally allow to set QB_KERNEL_ROOT to e.g. "/dev/vda ro" to mount the rootfs reay-only in Qemu. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13mirrors: Add kernel.org sources mirror for downloads.yoctoproject.orgRichard Purdie
kernel.org now has a mirror of the downloads.yoctoproject.org sources archive so include this in our mirrors list. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13gobject-introspection: Add -Dintrospection only when GIR_MESON_OPTION is not ↵Khem Raj
empty meson now does not allow unknown options which means we have to be mindful of adding -Dintrospection unconditionally and provide an option to recipes to set GIR_MESON_OPTION = "" and when recipe does that then do not add -D<Dintrospection> option to meson. This will help recipes to use meson 60.x+ just by adding GIR_MESON_OPTION = "" Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13insane: remove unrecognised option check for MesonRoss Burton
Meson 0.60 onwards no longer simply warns when an unrecognised option is passed, it errors out instead. This means we can remove the logic in insane.bbclass to check for the warnings. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13uninative: Add version to uninative tarball nameRichard Purdie
uninative works via hashes and doesn't need the version in the tarball name but it does make things easier to inspect in DL_DIR. There were reasons such as ease of publication of the build tarballs but we can handle those differently now and the signature issues from the early code aren't an issue now. From 3.4 onwards we can use a version'd name. [YOCTO #12970] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11own-mirrors.bbclass: Clean up the additions to PREMIRRORSPeter Kjellerstedt
* Since commit ce0579dc in bitbake (fetch2: Revert the regexp removal for the type field and instead anchor regexp) the type regexp has been automatically anchored at the end. * Since commit 044fb04d in bitbake (fetch2: Allow whitespace only mirror entries) there is no need to separate the entries in PREMIRRORS with "\n". Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11mirrors.bbclass: Clean up the additions to MIRRORSPeter Kjellerstedt
* Since commit ce0579dc in bitbake (fetch2: Revert the regexp removal for the type field and instead anchor regexp) the type regexp has been automatically anchored at the end. * Since commit 044fb04d in bitbake (fetch2: Allow whitespace only mirror entries) there is no need to separate the entries in MIRRORS with "\n". Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-10kernel: provide virtual/kernel for all kernelsBruce Ashfield
Since we allow the kernel package name to be varied, we should allow those packages to provide virtua/kernel, which allows them to be used as primary kernels. This change drops the use of regex, since any regex would enforce naming (and limit what can be a provider) and add complexity./ There are currently no recipes that I found, that inherit kernel that are not kernel recipes (kernel-base, etc, provide other facilities), so making this provides simpler shouldn't cause problems. Multiple kernel providers can be dealt with in the same way as any multiple provider. [YOCTO: #13172] Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> squash with provider Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-10meta: use ln -rs instead of lnrRoss Burton
lnr is a script in oe-core that creates relative symlinks, with the same behaviour as `ln --relative --symlink`. It was added back in 2014[1] as not all of the supported host distributions at the time shipped coreutils 8.16, the first release with --relative. However the oldest coreutils release in the supported distributions is now 8.22 in CentOS 7, so lnr can be deprecated and users switched to ln. [1] 6ae3b85eaffd1b0b6914422e8de7c1230723157d Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-10mirrors: Add uninative mirror on kernel.orgRichard Purdie
At the last nas outage, we realised that we don't have good mirrors of the uninative tarball if our main system can't be accessed. kernel.org mirrors some Yocto Project data so we've ensured uninative is there. Add the appropriate mirror url to make use of that. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-07scons: support out-of-tree buildsRoss Burton
SCons has a slightly unusual implementation of out-of-tree builds where there is no standard way of doing it. However, if a recipe sets B to the idiomatic ${WORKDIR}/build and passes the right arguments so that this is used then scons will fail as it is trying to find the SConstruct file in ${B} not ${S}. Always pass --directory=${S} to scons so that the SConstruct file can be found, and don't call --clean if out-of-tree builds are being used as we would have just deleted the entire build tree already. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-05meson: set objcopy in the cross and native toolchain filesRoss Burton
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-05sstate: another fix for touching files inside pseudoJose Quaresma
This patch is a fixup for 676757f "sstate: fix touching files inside pseudo" running the 'id' command inside the sstate_unpack_package function shows that this funcion run inside the pseudo: uid=0(root) gid=0(root) groups=0(root) The check for [ -w ${SSTATE_PKG} ] and [ -O ${SSTATE_PKG}.siginfo ] will always return true and the touch can fail when the real user don't have permission or in readonly filesystem. As the documentation refers: - the file test operator "-w" check if the file has write permission (for the user running the test). - the file test operator "-O" check if you are owner of file We can avoid this test running the touch and mask any return errors that we have. Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-05create-spdx: Set the Organization field via a variableAndres Beltran
Currently, the "Organization" field for SBOMs is hard-coded in create-spdx. Create a new variable SPDX_ORG to make this field more generic. Signed-off-by: Andres Beltran <abeltran@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03insane.bbclass: Add a check for directories that are expected to be emptyPeter Kjellerstedt
The empty-dirs QA check verifies that all directories specified in QA_EMPTY_DIRS are empty. It is possible to specify why a directory is expected to be empty by defining QA_EMPTY_DIRS_RECOMMENDATION:<path>, which will then be included in the error message if the directory is not empty. If it is not specified for a directory, then "but it is expected to be empty" will be used. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03sstate: Account for reserved characters when shortening sstate filenamesManuel Leonhardt
Previously, when shortening sstate filenames, the reserved characters for .siginfo were not considered, when siginfo=False, resulting in differently shortend filenames for the sstate and siginfo files. With this change, the filenames of the truncated sstate and siginfo files have the same basename, just as is already the case for untruncated filenames. Making sure that the .siginfo files always have the filename of the corresponding sstate file plus its .siginfo suffix, also when being truncated, makes it easier to manage the sstate cache and an sstate mirror outside of Bitbake/Yocto. Signed-off-by: Manuel Leonhardt <mleonhardt@arri.de> Cc: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03sanity.bbclass: Update required gcc version to v7.5Robert Yang
qemu-native 6.1.0 requires at least gcc v7.5: ERROR: You need at least GCC v7.5 or Clang v6.0 (or XCode Clang v10.0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30overlayfs: add debug informationVyacheslav Yurkov
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30overlayfs: all overlays unitVyacheslav Yurkov
Application can depend on several overlayfs mount points. Provide a systemd unit application can depend on to make sure all overlays are mounted before it is started to avoid any race conditions Signed-off-by: Bruno Knittel <Bruno.Knittel@bruker.com> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30archiver: Default to xz compresison instead of gzRichard Purdie
We should default to xz or zstd instead of gz, pick xz for now as it is more tested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30meta: Add explict branch to git SRC_URIsRichard Purdie
There is uncertainty about the default branch name in git going forward. To try and cover the different possible outcomes, add branch names to all git:// and gitsm:// SRC_URI entries. This update was made with the script added to contrib in this patch which aims to help others convert other layers. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-28create-spdx: cross recipes are native alsoSaul Wold
Recipes that inherit cross should also be categorized as isNative Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-28create-spdx: add create_annotation functionSaul Wold
This allows code reuse and future usage with relationship annotations Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-28go.bbclass: Allow adding parameters to go ldflagsAhmed Hossam
Currently, there is no clean way to pass extra parameters to the go tool link, which is passed by the go build ldflags flag, the append needs to happen inside the quotes of the ldflags parameter See [YOCTO #14554]. Add a variable to allow adding extra parameters to -ldflags in the GO_LDFLAGS variable, one of the main usecases is setting the application version. For example, adding to the recipe something like GO_EXTRA_LDFLAGS="-X main.Version=v1.0.0" or GO_EXTRA_LDFLAGS="-X main.Version=${PV}" Signed-off-by: Ahmed Hossam <Ahmed.Hossam@opensynergy.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-28archiver: Configurable tarball compressionIan Ray
In order to be more efficient, we use xz as compression method to create GPL sources archives. Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com> [V1 was https://patchwork.openembedded.org/patch/155985/] [Rebased] Signed-off-by: Ian Ray <ian.ray@ge.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-27meson.bblcass: Remove empty egg-info directories before running mesonPeter Kjellerstedt
sstate.bbclass no longer removes empty directories to avoid a race (see commit 4f94d929 "sstate/staging: Handle directory creation race issue"). Unfortunately Python apparently treats an empty egg-info directory as if the version it previously contained still exists and fails if a newer version is required, which Meson does. To avoid this, make sure there are no empty egg-info directories from previous versions left behind. 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>
2021-10-26patch: Fix exception reporting with repr()Richard Purdie
The exceptions generated with repre are more detailed but escaped the newlines making them unreadable. Fix this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-26staging: Fix autoconf-native rebuild failureRichard Purdie
When rebuilds are triggered, autoconf-native can fail with: | DEBUG: Executing shell function update_gnu_config | install: cannot stat '[BUILDPATH]tmp/work/x86_64-linux/autoconf-native/2.71-r0/recipe-sysroot-native/usr/share/gnu-config/config.guess': No such file or directory which is due to update_gnu_config running before extend_recipe_sysroot. This only happens rarely since usually the prepare_recipe_sysroot function would already have set things up and only in the invalidated task hash cases does this rebuild in this way from configure only. Fix the code to prepend this function instead of appending which resolves the ordering issue. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-23classes/populate_sdk_base: Add setscene tasksJoshua Watt
do_populate_sdk was added to SSTATETASKS, but had no _setscene task created to allow it to actually run from sstate. Add it so that SDKs can be restored from sstate. Note that like do_image_complete, do_populate_sdk is marked with SSTATE_SKIP_CREATION by default so sstate is not used for them; adding this task will allow it to work if the user overrides this default though. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>