really strange usage of FILESPATH and FILESEXTRAPATHS
here's the next head-scratching oddity i just ran across in the
current layer (and there's more weirdness on its way).
perusing a recipe only to see:
FILESPATH =+ "${COMMON_STUFF_DIR}:"
SRC_URI += "file://file1 file://file2 file://file 3 ... etc ..."ok ... apparently, there are a number of recipes that want access to some small set of common files, so the solution(?) was to put those common files in some (out-of-layer) directory, and prepend to FILESPATH in each of those recipe files so that SRC_URI could find them.
i am not going to ask if this is some wickedly clever trick, since
it can't be. it just can't.
even stranger, one of the common files was a configuration script
that contributed the line:
. config.sh
to the top of a number of common tasks like do_configure, do_compile, do_install and so on.
a similar tactic was to find this line in a class file:
FILESEXTRAPATHS_prepend := "${COMMON_STUFF_DIR}:"my head hurts.
first, if i needed to do something in common at the beginning of
some basic tasks, i'd invent a bbclass file that "_prepend"ed to those tasks, and just inherit it when necessary.
as for a number of recipes needing access to common files for any
reason, well, thoughts? my first thought is to encapsulate those files in a separate recipe, then make that recipe a build dependency so that those files would be available from the sysroot, but i'm sure there are better ideas.
are there any OE recipes that demonstrate this sort of thing?
because extending FILESPATH to arbitrary out-of-layer directories just makes me want to strangle kittens.
rday
Quoted 9 lines · Robert P. J. Day
here's the next head-scratching oddity i just ran across in the
current layer (and there's more weirdness on its way).perusing a recipe only to see:
FILESPATH =+ "${COMMON_STUFF_DIR}:" SRC_URI += "file://file1 file://file2 file://file 3 ... etc ..."
Quoted 8 lines
ok ... apparently, there are a number of recipes that want access to some small set of common files, so the solution(?) was to put those common files in some (out-of-layer) directory, and prepend to FILESPATH in each of those recipe files so that
SRC_URIcould find them.i am not going to ask if this is some wickedly clever trick, since
it can't be. it just can't.
It's unconventional, but I guess it will work OK (i.e. it won't have any surprising or negative side effects).
It's better than (for example) one recipe fetching source from the build directory of another recipe - which obviously breaks if you don't somehow guarantee the order in which recipes are (re)built. I've seen projects which did things like that and then needed to disable sstate for CI and release builds as a workaround...
Quoted 7 lines
even stranger, one of the common files was a configuration script
that contributed the line:.
config.shto the top of a number of common tasks like
do_configure,do_compile,do_installand so on.
It's not clear how a common file in SRC_URI could affect any tasks?
Quoted 10 lines
a similar tactic was to find this line in a class file:
FILESEXTRAPATHS_prepend := "${COMMON_STUFF_DIR}:"my head hurts.
first, if i needed to do something in common at the beginning of
some basic tasks, i'd invent a bbclass file that "_prepend"ed to those tasks, and just inherit it when necessary.
Quoted 5 lines
as for a number of recipes needing access to common files for any
reason, well, thoughts? my first thought is to encapsulate those files in a separate recipe, then make that recipe a build dependency so that those files would be available from the sysroot, but i'm sure there are better ideas.
Build dependencies are heavily geared towards libraries and header files rather than common source files. See SYSROOT_DIRS and SYSROOT_DIRS_BLACKLIST in staging.bbclass, which limit which directories get staged in sysroot. You would need to navigate your way around that (e.g. ensuring that the common source files get staged in sysroot without being included in the final image, etc). Certainly doable, but I guess too far up the OE learning cliff for most typical users.
Adding the common source files to SRC_URI for each recipe which needs them (whether as individual files from a local directory, as in your example, or as a single tar file or git repo from a remote server) is probably the better approach.
Quoted 54 lines · Andre McCurdy
Quoted 9 lines · Robert P. J. Day
here's the next head-scratching oddity i just ran across in the
current layer (and there's more weirdness on its way).perusing a recipe only to see:
FILESPATH =+ "${COMMON_STUFF_DIR}:" SRC_URI += "file://file1 file://file2 file://file 3 ... etc ..."Quoted 8 lines
ok ... apparently, there are a number of recipes that want access to some small set of common files, so the solution(?) was to put those common files in some (out-of-layer) directory, and prepend to FILESPATH in each of those recipe files so that
SRC_URIcould find them.i am not going to ask if this is some wickedly clever trick, since
it can't be. it just can't.It's unconventional, but I guess it will work OK (i.e. it won't have any surprising or negative side effects).
It's better than (for example) one recipe fetching source from the build directory of another recipe - which obviously breaks if you don't somehow guarantee the order in which recipes are (re)built. I've seen projects which did things like that and then needed to disable sstate for CI and release builds as a workaround...
Quoted 7 lines
even stranger, one of the common files was a configuration script
that contributed the line:.
config.shto the top of a number of common tasks like
do_configure,do_compile,do_installand so on.It's not clear how a common file in
SRC_URIcould affect any tasks?Quoted 10 lines
a similar tactic was to find this line in a class file:
FILESEXTRAPATHS_prepend := "${COMMON_STUFF_DIR}:"my head hurts.
first, if i needed to do something in common at the beginning of
some basic tasks, i'd invent a bbclass file that "_prepend"ed to those tasks, and just inherit it when necessary.Quoted 5 lines
as for a number of recipes needing access to common files for any
reason, well, thoughts? my first thought is to encapsulate those files in a separate recipe, then make that recipe a build dependency so that those files would be available from the sysroot, but i'm sure there are better ideas.
Quoted 6 lines
Build dependencies are heavily geared towards libraries and header files rather than common source files. See
SYSROOT_DIRSandSYSROOT_DIRS_BLACKLISTin staging.bbclass, which limit which directories get staged in sysroot. You would need to navigate your way around that (e.g. ensuring that the common source files get staged in sysroot without being included in the final image, etc). Certainly
Recipes in DEPENDS are automatically added to RDEPENDS only in very specific cases (e.g. a library of the former appears in the NEEDED field of a library of the latter). It's perfectly safe to have a recipe export most of its content to the sysroot and still not have it being installed in the image.
This is to me the cleanest and most maintainable solution.
Quentin
Quoted 63 lines · Quentin Schulz
Quoted 54 lines · Andre McCurdy
Quoted 9 lines · Robert P. J. Day
here's the next head-scratching oddity i just ran across in the
current layer (and there's more weirdness on its way).perusing a recipe only to see:
FILESPATH =+ "${COMMON_STUFF_DIR}:" SRC_URI += "file://file1 file://file2 file://file 3 ... etc ..."Quoted 8 lines
ok ... apparently, there are a number of recipes that want access to some small set of common files, so the solution(?) was to put those common files in some (out-of-layer) directory, and prepend to FILESPATH in each of those recipe files so that
SRC_URIcould find them.i am not going to ask if this is some wickedly clever trick, since
it can't be. it just can't.It's unconventional, but I guess it will work OK (i.e. it won't have any surprising or negative side effects).
It's better than (for example) one recipe fetching source from the build directory of another recipe - which obviously breaks if you don't somehow guarantee the order in which recipes are (re)built. I've seen projects which did things like that and then needed to disable sstate for CI and release builds as a workaround...
Quoted 7 lines
even stranger, one of the common files was a configuration script
that contributed the line:.
config.shto the top of a number of common tasks like
do_configure,do_compile,do_installand so on.It's not clear how a common file in
SRC_URIcould affect any tasks?Quoted 10 lines
a similar tactic was to find this line in a class file:
FILESEXTRAPATHS_prepend := "${COMMON_STUFF_DIR}:"my head hurts.
first, if i needed to do something in common at the beginning of
some basic tasks, i'd invent a bbclass file that "_prepend"ed to those tasks, and just inherit it when necessary.Quoted 5 lines
as for a number of recipes needing access to common files for any
reason, well, thoughts? my first thought is to encapsulate those files in a separate recipe, then make that recipe a build dependency so that those files would be available from the sysroot, but i'm sure there are better ideas.Quoted 7 lines
Build dependencies are heavily geared towards libraries and header files rather than common source files. See
SYSROOT_DIRSandSYSROOT_DIRS_BLACKLISTin staging.bbclass, which limit which directories get staged in sysroot. You would need to navigate your way around that (e.g. ensuring that the common source files get staged in sysroot without being included in the final image, etc). Certainly
Quoted 7 lines
Recipes in DEPENDS are automatically added to RDEPENDS only in very specific cases (e.g. a library of the former appears in the NEEDED field of a library of the latter). It's perfectly safe to have a recipe export most of its content to the sysroot and still not have it being installed in the image.
This is to me the cleanest and most maintainable solution.
so, just to be clear, you seem to be agreeing with my original
proposal -- stuff all that common content in a single recipe, have it install in the sysroot, make the recipe a build-time dependency of the other recipes, and let those other recipes grab what they need from the sysroot, yes?
for now, i'm going to leave the structure as it is until i can get
clarification from someone as to why it was done that way, maybe there's something i haven't noticed.
rday
Quoted 71 lines · Robert P. J. Day
Quoted 69 lines · Quentin Schulz
Quoted 54 lines · Andre McCurdy
Quoted 9 lines · Robert P. J. Day
here's the next head-scratching oddity i just ran across in the
current layer (and there's more weirdness on its way).perusing a recipe only to see:
FILESPATH =+ "${COMMON_STUFF_DIR}:" SRC_URI += "file://file1 file://file2 file://file 3 ... etc ..."Quoted 8 lines
ok ... apparently, there are a number of recipes that want access to some small set of common files, so the solution(?) was to put those common files in some (out-of-layer) directory, and prepend to FILESPATH in each of those recipe files so that
SRC_URIcould find them.i am not going to ask if this is some wickedly clever trick, since
it can't be. it just can't.It's unconventional, but I guess it will work OK (i.e. it won't have any surprising or negative side effects).
It's better than (for example) one recipe fetching source from the build directory of another recipe - which obviously breaks if you don't somehow guarantee the order in which recipes are (re)built. I've seen projects which did things like that and then needed to disable sstate for CI and release builds as a workaround...
Quoted 7 lines
even stranger, one of the common files was a configuration script
that contributed the line:.
config.shto the top of a number of common tasks like
do_configure,do_compile,do_installand so on.It's not clear how a common file in
SRC_URIcould affect any tasks?Quoted 10 lines
a similar tactic was to find this line in a class file:
FILESEXTRAPATHS_prepend := "${COMMON_STUFF_DIR}:"my head hurts.
first, if i needed to do something in common at the beginning of
some basic tasks, i'd invent a bbclass file that "_prepend"ed to those tasks, and just inherit it when necessary.Quoted 5 lines
as for a number of recipes needing access to common files for any
reason, well, thoughts? my first thought is to encapsulate those files in a separate recipe, then make that recipe a build dependency so that those files would be available from the sysroot, but i'm sure there are better ideas.Quoted 7 lines
Build dependencies are heavily geared towards libraries and header files rather than common source files. See
SYSROOT_DIRSandSYSROOT_DIRS_BLACKLISTin staging.bbclass, which limit which directories get staged in sysroot. You would need to navigate your way around that (e.g. ensuring that the common source files get staged in sysroot without being included in the final image, etc). CertainlyRecipes in DEPENDS are automatically added to RDEPENDS only in very specific cases (e.g. a library of the former appears in the NEEDED field of a library of the latter). It's perfectly safe to have a recipe export most of its content to the sysroot and still not have it being installed in the image.
Quoted 8 lines
Quoted 1 line
This is to me the cleanest and most maintainable solution.
so, just to be clear, you seem to be agreeing with my original
proposal -- stuff all that common content in a single recipe, have it install in the sysroot, make the recipe a build-time dependency of the other recipes, and let those other recipes grab what they need from the sysroot, yes?
That's what **I** would do, yes.
Cheers,
Quentin