dl9pf / meta-spdxscanner

SPDX scanner support
MIT License
9 stars 10 forks source link

When add meta-spdxscanner, error openssl in oe-core #14

Closed tungpd0484 closed 5 years ago

tungpd0484 commented 5 years ago

Dear all,

When I add meta-spdxscanner in my Yocto: In file conf/local.conf add:

Use spdxscanner

-- INHERIT += "fossdriver-host" SPDX_DEPLOY_DIR = "/share/FVL/SPDX"

In file oe-core/meta/classes/nopackages.bbclass add following line in the lastest:

deltask do_spdx

And in file conf/bblayers.conf add:

meta-spdxscanner \

When build have error conflict openssl version of oe-core: ERROR: Multiple versions of openssl-native are due to be built (virtual:native:{path1-of-meta1}/core/recipes-connectivity/openssl/openssl_1.1.1a.bb virtual:native:{path2}/oe-core/meta/recipes-connectivity/openssl/openssl_1.0.2p.bb). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_openssl-native to select the correct version or don't depend on multiple versions.

It would be highly appreciated if you could give me any suggestion for this problem. Thank you very much in advance!

leimaohui commented 5 years ago

From your log, I think the reason is there are two versions of openssl(1.1.1a and 1.0.2p) in your yocto project. It seems that this error has nothing to do with do_spdx. Are you sure there is no error if you disable "INHERIT += "fossdriver-host" in local.conf?

tungpd0484 commented 5 years ago

Thank you very much for your advice. You are correct, I have two versions of openssl(1.1.1a and 1.0.2p) in our project.

$ ls -la {path1-of-meta1}/core/recipes-connectivity/openssl/ total 8 drwxrwsr-x 1 xxx yyy 58 Jul 25 17:56 . drwxrwsr-x 1 xxx yyy 42 Jul 25 17:56 .. drwxrwsr-x 1 xxx yyy 48 Jul 25 17:56 files drwxrwsr-x 1 xxx yyy 276 Jul 25 17:56 openssl -rw-rw-r-- 1 xxx yyy 7282 Jul 25 17:56 openssl_1.1.1a.bb

$ ls -la {path2}/oe-core/meta/recipes-connectivity/openssl/ total 20 drwxrwsr-x 1 xxx yyy 110 Jul 27 10:54 . drwxrwsr-x 1 xxx yyy 366 Jul 27 10:41 .. drwxrwsr-x 1 xxx yyy 204 Jul 26 13:37 openssl drwxrwsr-x 1 xxx yyy 1080 Jul 25 17:56 openssl-1.0.2p -rw-rw-r-- 1 xxx yyy 10845 Jul 26 16:31 openssl_1.0.2p.bb -rw-rw-r-- 1 xxx yyy 4541 Jul 25 17:56 openssl_1.1.0i.bb $ cat {path2}/oe-core/meta/conf/distro/include/default-versions.inc PREFERRED_VERSION_openssl = "1.0.%" PREFERRED_VERSION_openssl-native = "1.0.%" PREFERRED_VERSION_nativesdk-openssl = "1.0.%"

I also agree with you that this error has nothing to do with do_spdx because I delete do_spdx from oe-core/meta/classes/nopackages.bbclass then have same error.

Following your comment, I comment out "INHERIT += "fossdriver-host" in local.conf, there is no error when I bitbake. Do you mean that I can't connect to fossdriver?

leimaohui commented 5 years ago

I'm sorry, if you want to use meta-spdxscanner, the following steps is necessary.

  1. Added "deltask do_spdx" into meta/classes/nopackages.bbclass. To disable creating spdx files for *-native.
  2. Add "INHERIT += "fossdriver-host" to enable do_spdx defined in meta-spdxscanner/classes/fossdriver-host.bbclass

But the curious thing about it is that you commented "INHERIT += "fossdriver-host", your bitbake becomes OK. It seems that do_spdx affected your bitbake.

Is your bitbake begins from an empty build directory? If not, can you try again in an empty build directory with "deltask do_spdx" in nopackages.bbclass and "INHERIT += "fossdriver-host" in local.conf?

tungpd0484 commented 5 years ago

Thank you very much for your supporting. When I checkout back to following commit, I can bitbake my project:

commit 255a2585d99099745d7c361effd31409e5b9b8ef Merge: 9fd7a38 521d248 Author: Lei Maohui leimaohui@cn.fujitsu.com Date: Thu Nov 8 12:08:20 2018 +0900

Merge branch 'sumo' of https://github.com/dl9pf/meta-spdxscanner into sumo

Once again, thank you so much. > Ms.Leimaohui