Discussion:
[yocto] Moving to Yocto 2.3 - recipe-specific sysroots - improving the documentation
CHMIELARZ Radoslaw
2018-10-26 12:38:52 UTC
Permalink
Hi all,

I think the documentation on migrating between Yocto 2.2 and 2.3 needs more clarification as to how did the sysroots have changed.

I wanted to migrate our build system from 2.2 to 2.5 and one package in particular has caused me a day worth of scratching my head and trying different ideas.
We have a custom recipe for openssh-server which among other things had a line:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"

This is due the fact that openssl-1.0 is being installed to /usr/local/openssl-1.0.

Now when trying to migrate I have noticed that STAGING_DIR is not populated any more and this is clearly explained by the documentation. What is not explained however is how to get the files from other recipes. The documentation simply states that each recipe has its own staging directory. Hence what I have tried to is steer this directory to the staging directory of openssl-1.0.

Of course the real solution is that openssh-server recipe installs header files of all packages in DEPENDS into openssh-server STAGING_DIR_TARGET (in my case, could be other STAGING_* directories apart from STAGING_DIR which is empty right now) and the simple solution was to change the above line to:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"

And thus to save other people time I think it would be best to add another point to the documentation (https://www.yoctoproject.org/docs/2.5.1/ref-manual/ref-manual.html#migration-2.3-recipe-specific-sysroots)
"Consider the following:
[..]

* Examine the recipes that use STAGING_DIR: STAGING_DIR is a shared directory not populated any more. Instead if You want to use files from another recipe in Your recipe include that recipe in DEPENDS variable which will copy the files from another recipe into Your recipe's staging directories. Now You can refer to those files using STAGING_DIR* pointing to Your recipe's staging directories. For example instead of:
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"
Write the following:
DEPENDS += "openssl-1.0"
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"
"

Of course this can be made more general and a precaution could be added that this is taken care of by most of the packages. Maybe in my case it could also be changed to be automatic but this I haven't yet explored.

Cheers,
Radek Chmielarz
Leica Geosystems AG
Uwe Geuder
2018-10-30 13:14:36 UTC
Permalink
Post by CHMIELARZ Radoslaw
Hi all,
I think the documentation on migrating between Yocto 2.2 and 2.3 needs
more clarification as to how did the sysroots have changed.
[...]
Post by CHMIELARZ Radoslaw
Now when trying to migrate I have noticed that STAGING_DIR is not
populated any more and this is clearly explained by the
documentation. What is not explained however is how to get the files
from other recipes. The documentation simply states that each recipe
has its own staging directory.
[...]

Have you seen this chapter?

https://www.yoctoproject.org/docs/2.5.1/mega-manual/mega-manual.html#new-sharing-files-between-recipes

(well, that's not 2.3 but the newest one, but I am not aware that
anything significant has changed once more)

The headline promises to answer the question, but at least I don't fully
follow the explanations. They are talking about *the* sysroot. As we
know sysroots are recipe-specifc now. So if we are talking about sharing
files between recipes, we have an "exporting" recipe and an "importing"
recipe, so at least in theory 2 sysroots could be involved. From the
text in the manual I do not understand which one they mean and what they
try to explain.

So yes, I agree that the documentation should be clarified. Unfortunatly
I am not in the situation to suggest the solution.

Regards,

Uwe Geuder
Neuro Event Labs Oy
Tampere, Finland
uwe.gexder at neuroeventlabs.com (Bot check: fix one obvious typo)
--
Khem Raj
2018-10-30 21:12:50 UTC
Permalink
On Tue, Oct 30, 2018 at 1:06 AM CHMIELARZ Radoslaw
Post by CHMIELARZ Radoslaw
Hi all,
I think the documentation on migrating between Yocto 2.2 and 2.3 needs more clarification as to how did the sysroots have changed.
I wanted to migrate our build system from 2.2 to 2.5 and one package in particular has caused me a day worth of scratching my head and trying different ideas.
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"
This is due the fact that openssl-1.0 is being installed to /usr/local/openssl-1.0.
Now when trying to migrate I have noticed that STAGING_DIR is not populated any more and this is clearly explained by the documentation. What is not explained however is how to get the files from other recipes. The documentation simply states that each recipe has its own staging directory. Hence what I have tried to is steer this directory to the staging directory of openssl-1.0.
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"
And thus to save other people time I think it would be best to add another point to the documentation (https://www.yoctoproject.org/docs/2.5.1/ref-manual/ref-manual.html#migration-2.3-recipe-specific-sysroots)
[..]
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"
DEPENDS += “openssl-1.0”
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR_TARGET}/usr/local/openssl-1.0"

Of course this can be made more general and a precaution could be added that this is taken care of by most of the packages. Maybe in my case it could also be changed to be automatic but this I haven’t yet explored.
Thanks for this and I think it would be good if you are willing to add
it to How do I section of wiki here
https://wiki.yoctoproject.org/wiki/How_do_I
Post by CHMIELARZ Radoslaw
Cheers,
Radek Chmielarz
Leica Geosystems AG
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
--
Burton, Ross
2018-11-05 11:14:25 UTC
Permalink
On Tue, 30 Oct 2018 at 07:05, CHMIELARZ Radoslaw
Post by CHMIELARZ Radoslaw
EXTRA_OECONF += "--with-ssl-dir=${STAGING_DIR}/${MACHINE}/usr/local/openssl-1.0"
Note that the documentation barely mentions STAGING_DIR and mainly
refers to STAGING_DIR_(TARGET/HOST_NATIVE), if you'd used one of those
the migration to recipe-specific-sysroots wouldn't have been a
problem.

Ross
--

Loading...