Bug 13065

Summary: PREFERRED_VERSION_openssl in local.conf is ignored
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: jean-christophe.gillet
Component: meta-yoctoAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: akuster, poky.bs.watcher, poky.watcher
Version: 2.4.5   
Target Milestone: 2.5.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description jean-christophe.gillet 2018-12-06 15:51:12 UTC
Hi

I use poky version tagged "rocko-18.0.3"
In this version 2 openssl recipes exist. 
poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb and
poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb

and the default preferred version is 1.0.%

However when I want to change version to a more recent version 1.1.0h instead of 1.0.2o in local.conf file using variable PREFERRED_VERSION_openssl, 
PREFERRED_VERSION_openssl = "1.1.%"
PREFERRED_VERSION_openssl-native = "1.1.%"
PREFERRED_VERSION_nativesdk-openssl = "1.1.%"

I can't and I have the error message
ERROR: Multiple versions of openssl are due to be built (xxxx/poky/meta/recipes-connectivity/openssl/openssl_1.1.0h.bb xxxx/poky/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb). Only one version of a given PN should be built in any given build. You likely need to set PREFERRED_VERSION_openssl to select the correct version or don't depend on multiple versions.

It is because in poky/meta/conf/distro/include/default-versions.inc, variables relative to openssl are not set as default value

currently in rocko, sumo and thud branches (resp xxx-next branches), you have
PREFERRED_VERSION_openssl = "1.0.%"
PREFERRED_VERSION_openssl-native = "1.0.%"
PREFERRED_VERSION_nativesdk-openssl = "1.0.%"

To fix this issue, I replaced "=" by "?=" in poky/meta/conf/distro/include/default-versions.inc as below
PREFERRED_VERSION_openssl ?= "1.0.%"
PREFERRED_VERSION_openssl-native ?= "1.0.%"
PREFERRED_VERSION_nativesdk-openssl ?= "1.0.%"

Best regards
Comment 1 Armin Kuster 2018-12-06 16:22:12 UTC
with backports
Comment 2 Ross Burton 2018-12-06 16:56:41 UTC
Doesn't apply to Thud/master as they don't set PREFERRED_VERSION_openssl.  Queued in sumo-next.
Comment 3 Ross Burton 2018-12-20 16:11:54 UTC
Merged in sumo c9786adf81434e2d58247f55cf80fdd3131121e7.