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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BitBake (Yocto) as supported package manager #722

Open
tsteenbe opened this issue Aug 1, 2018 · 12 comments
Open

Add BitBake (Yocto) as supported package manager #722

tsteenbe opened this issue Aug 1, 2018 · 12 comments
Assignees
Labels
analyzer About the analyzer tool enhancement Issues that are considered to be enhancements

Comments

@tsteenbe
Copy link
Member

tsteenbe commented Aug 1, 2018

Add support for the BitBake (Yocto) dependency manager to the analyzer module.

Links:

BitBake manual: https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html
Useful Bitbake commands: https://community.nxp.com/docs/DOC-94953

  • bitbake-layers show-layers
  • bitbake-layers show-recipes

Bitbake repos: https://git.yoctoproject.org/
Projects starting with poky-* and meta-* likely contain bitbake files

@tsteenbe tsteenbe assigned tsteenbe and haikoschol and unassigned tsteenbe Aug 1, 2018
@tsteenbe tsteenbe added enhancement Issues that are considered to be enhancements analyzer About the analyzer tool labels Aug 1, 2018
@tsteenbe tsteenbe changed the title analyzer: Add BitBake (Yocto) support Add BitBake (Yocto) as supported package manager Aug 1, 2018
@pattivacek
Copy link

I recommend using the latest version of the bitbake manual: https://www.yoctoproject.org/docs/current/bitbake-user-manual/bitbake-user-manual.html. 1.6 is pretty old at this point.

haikoschol pushed a commit that referenced this issue Aug 17, 2018
This is done in preparation of implementing BitBake support (#722),
which requires a mechanism to pass a list of recipes to analyze.

Since this list is specific to the repository being analyzed, it
makes sense to add this information to .ort.yml and give package
manager instances access to it, analogous to the command line
parameters via AnalyzerConfiguration.
haikoschol pushed a commit that referenced this issue Aug 20, 2018
This is done in preparation of implementing BitBake support (#722),
which requires a mechanism to pass a list of recipes to analyze.

Since this list is specific to the repository being analyzed, it
makes sense to add this information to .ort.yml and give package
manager instances access to it, analogous to the command line
parameters via AnalyzerConfiguration.
@sschuberth
Copy link
Member

Maybe also have a look at https://github.com/Waldleufer/archproj-bmwteam of which our contributor @andreas-bauer has a fork.

@sschuberth
Copy link
Member

FYI, there's been work started in the bitbake branch.

@tsteenbe tsteenbe added the help wanted An issue where third-party help is wanted on label Apr 8, 2019
@tsteenbe
Copy link
Member Author

tsteenbe commented Feb 2, 2020

The questions below outline the prerequisites of things we need to figure out prior to be able to add Yocto support to ORT

  1. How can you detect a project uses this specific package manager?
  2. How can you get the declared license for a package?
  3. How to can one get dependency tree including package names, versions?
  4. How can one obtain the source code for a dependency? (e.g. the source code repository + revision or the sources artifact URL)
  5. How can one separate code dependencies from build/test ones?
  6. Can you provide example projects that can be used to test the implementation?

@pattivacek
Copy link

I think it's still an open question if it's really appropriate the use ORT on Yocto in the first place. In our case, we provide meta-updater and some additional supporting layers as open-source projects to help our users integrate aktualizr into their projects. However, meta-updater (and essentially all of Yocto) is just metadata. We don't normally deploy or deliver the software built with Yocto, just the metadata that explains how to build it.

The metadata itself that we use is released under friendly open-source terms. The software built with the metadata is more complex, and Yocto has some internal tooling for detecting it. I wrote a script that can collect the licenses for a given package and its dependencies and another script that uses the first to specifically find the dependencies of aktualizr. However, I'm not sure anymore if that is actually useful.

So before those six questions can be answered, we need to clarify: are we trying to search for licenses of the metadata that is Yocto or the underlying software that is built with Yocto?

@sschuberth
Copy link
Member

are we trying to search for licenses of the metadata that is Yocto or the underlying software that is built with Yocto?

The latter, IMO. Or more generically: We need to determine the licenses of what is being distributed in the end.

@pattivacek

This comment was marked as off-topic.

@sschuberth

This comment was marked as off-topic.

@mmurto
Copy link
Contributor

mmurto commented Feb 11, 2020

5. How can one separate code dependencies from build/test ones?

We're currently trying to approach this with file level, rather than package level license granularity, so it might not be completely relevant for ORT, but here's where we're at:

Yocto has some built in tooling to scan the built image for source files used to build it. We're using this to get the hash values to find licenses of individual files, but it the tooling might be useful for separating the code in the build from build/test ones for you aswell. We've described the process in a little more detail here (heavily WIP).

@pattivacek

This comment was marked as off-topic.

@sschuberth sschuberth moved this to Q4 2023 – Oct-Dez in Roadmap Nov 6, 2023
@sschuberth sschuberth removed the help wanted An issue where third-party help is wanted on label Nov 6, 2023
@sschuberth sschuberth self-assigned this Nov 6, 2023
@sschuberth sschuberth moved this from Q4 2023 – Oct-Dez to Q2 2024 – Apr-Jun in Roadmap Apr 29, 2024
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 13, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 15, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
sschuberth added a commit to doubleopen-project/ort that referenced this issue May 16, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth
Copy link
Member

For reference, I just learned that besides Double Open's original https://github.com/doubleopen-project/meta-doubleopen, there's also https://github.com/fossas/meta-fossa that might be worth looking at.

@tsteenbe
Copy link
Member Author

Also https://github.com/fosslight/fosslight_yocto_scanner may be worth looking into..

sschuberth added a commit to doubleopen-project/ort that referenced this issue Sep 25, 2024
Add the beginnings of an analyzer for BitBake [1], see [2] for context. It
basically works by making the build inherit from the "create-spdx" class
[3] to create SPDX 2.2 files and post-processing them via ORT's SPDX
document file analyzer.

This initial implementations has several known limitations still. First
of all, as the "create-spdx" class cannot be used without building, and
builds are not cached, so the analyzer is very slow. Secondly, SPDX
external documents refs cannot be resolved yet. This requires some
post-processing of the SPDX document files before passing them on,
notably by adjusting the `SPDX_NAMESPACE_PREFIX` variable [4].

[1]: https://docs.yoctoproject.org/bitbake/
[2]: oss-review-toolkit#722
[3]: https://docs.yoctoproject.org/dev/dev-manual/sbom.html
[4]: https://docs.yoctoproject.org/ref-manual/variables.html#term-SPDX_NAMESPACE_PREFIX

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth sschuberth moved this from Q2 2024 – Apr-Jun to Q4 2024 – Oct-Dez in Roadmap Dec 1, 2024
@sschuberth sschuberth moved this from Q4 2024 – Oct-Dez to Q1 2025 - Jan-Mar in Roadmap Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool enhancement Issues that are considered to be enhancements
Projects
Status: Q1 2025 - Jan-Mar
Development

No branches or pull requests

5 participants