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

scancode.bbclass: [Request for review]: OI-2 Adding bbclass for scancode #1031

Closed

Conversation

hmsadiq
Copy link

@hmsadiq hmsadiq commented Oct 26, 2017

This is adding the functionality to run scancode utility on code.
You need to set the following variables to use it. You can override
these from local.conf or auto.conf.

  1. SCANCODE_GIT_LOCATION: Git Path for scancode-toolkit cloning, default is set.
  2. SCANCODE_TAG: Select tag, if you want.
  3. SCANCODE_FORMAT: Output file format json or html-app.
  4. SCANCODE_SRC_LOCATION: Location to store scancode-toolkit.

This belongs to OI-2.

Signed-off-by: H M Irfan Sadiq [email protected]
Signed-off-by: Noor Ahsan [email protected]

 for scancode

This is adding the functionality to run scancode utility on code.
You need to set the following variables to use it. You can override
 these from local.conf or auto.conf.
1) SCANCODE_GIT_LOCATION: Git Path for scancode-toolkit cloning, default is set.
2) SCANCODE_TAG: Select tag, if you want.
3) SCANCODE_FORMAT: Output file format json or html-app.
4) SCANCODE_SRC_LOCATION: Location to store scancode-toolkit.

This belongs to OI-2.

Signed-off-by: H M Irfan Sadiq <[email protected]>
Signed-off-by: Noor Ahsan <[email protected]>
@hmsadiq hmsadiq requested review from kergoth and Noor-Ahsan October 26, 2017 13:45
addtask scancode after do_patch

do_scancode_oss() {
echo "We are done running scancode"
Copy link
Member

Choose a reason for hiding this comment

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

Isn't BBNOTE is better than echo and also print the package name

Copy link
Member

@kergoth kergoth left a comment

Choose a reason for hiding this comment

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

We do not fetch sources from remote locations at anything other than do_fetch-time. Either let it be fetched by each recipe inheriting this by adding to SRC_URI, or better, create a scancode recipe and add the native version of it to DEPENDS in the bbclass.

@hmsadiq
Copy link
Author

hmsadiq commented Feb 16, 2018

  • I have tried using recipe to for source fetching which presents following challenges
  1. Adding its DEPENDS in bbclass causes circular dependency which tried to limit it so that it is added only for the target recipes as follows.
deps = ""
if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
    if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
        deps += " scancode-native "
return deps
  1. scancode is not very simple package, it itself has a lot of dependencies if we need to install it on native sysroot, initially it is failing for some python-native-mail module.
  2. Even if we are able to satisfy these dependencies, it has some thirdparty packages as well for successful launch.

Also, similar tools are not installed natively like fossology/spdx http://www.pelagicore.com/using-yocto-and-fossology-to-get-spdx-licence-output/

Do you have any suggestions how should we proceed with it ?
May be, we have these options

  • Add class as it is.
  • remove download part altogether from the class and leave installation of the tool on user and assume they will set location variable.
  • Add class as it is to some QA layer and keep it internal.

@kergoth
Copy link
Member

kergoth commented Feb 16, 2018

I'd suggest adding it to HOSTTOOLS and rely on the user having it installed on the host. Keeping the download portion is not going to work, so either we need a functioning native recipe, or rely on it as a host tool.

@hmsadiq
Copy link
Author

hmsadiq commented Feb 20, 2018

HOSTTOOLS variable is not available in dogwood hence replacing this PR with #1057

@hmsadiq hmsadiq closed this Feb 20, 2018
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.

3 participants