Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for bitbake recipes #1243 #3092

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

pombredanne
Copy link
Member

This PR adds basic support bitbake recipes treated as package data.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 馃搼 and links the original issue above 馃敆
  • Tests pass -- look for a green checkbox 鉁旓笍 a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 馃搧

chinyeungli and others added 3 commits September 4, 2022 10:00
Signed-off-by: Chin Yeung Li <tli@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne
Copy link
Member Author

@chinyeungli @priv-kweihmann you review is welcomed!
@priv-kweihmann I would like to know in particular if I am using oelint-parser correctly in https://github.com/nexB/scancode-toolkit/pull/3092/files#diff-af7c94424fa6a057497534cd0f8f26d906dfb225318819c29c919c8905493dc2R37

@@ -39,6 +39,7 @@ lxml==4.9.1
MarkupSafe==2.1.1
more-itertools==8.13.0
normality==2.3.3
oelint_parser==2.6.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think current version is 2.8.0 - so this might need an update


# add any bitbake like-file
# TODO: may be we should handle the bbclass and bbappend here?
oestash.AddFile(location)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bbclass files are handled automatically (if being within the same layer) - but yeah, bbappends have to be added manually

version = data.get('PV')
description = data.get('DESCRIPTION')
homepage_url = data.get('HOMEPAGE')
download_url = data.get('PREMIRRORS')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why premirrors? Normally one would take this kind of information from SRC_URI

# Therefore, I cannot differentiate md5, sha1, or src file location reference
# See: https://github.com/priv-kweihmann/oelint-parser/issues/3
sha1 = data.get('SRC_URI[sha1sum]')
md5 = data.get('SRC_URI[md5sum]')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

md5sum is pretty outdated a while now - people have been encouraged to drop the support for md5 for years now - sha256 on the other hand is mandatory for most of the file based downloads, so this one should be used


# Build deps: this is a list of plain BB recipes names
# https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-DEPENDS
build_deps = data.get('DEPENDS', '').split()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEPENDS just refers to buildtime dependencies - I think what you really want is a mix of RDEPENDS:* and DEPENDS - while RDEPENDS (the packages needed at runtime are more of importance) - sometimes DEPENDS contains elements that will be only used at buildtime and leave no trace within the shipped binaries, so from a license point of view they can be safely ignored

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would say that license wise DEPENDS doesn't play any role and should not be considered

SRC_URI = "file://init-install-testfs.sh"
DEPENDS = "do_this and that"

RDEPENDS_${PN} = "grub (== 12.23) parted e2fsprogs-mke2fs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test should use a recipe that is a bit more complex than this one here - for me https://git.yoctoproject.org/poky/plain/meta/recipes-graphics/cairo/cairo_1.16.0.bb was always a good example

description = data.get('DESCRIPTION')
homepage_url = data.get('HOMEPAGE')
download_url = data.get('PREMIRRORS')
declared_license = data.get('LICENSE')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep in mind that LICENSE settings can also be package specific (fine example can be found here https://git.yoctoproject.org/poky/plain/meta/recipes-graphics/cairo/cairo_1.16.0.bb) - so it would be better to iterate over all variable items of LICENSE and then pick the best matching, where plain LICENSE should always be the fall back

@pombredanne pombredanne added this to the v32.1 milestone Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants