diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-01-29 21:03:42 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-31 17:11:07 +0000 |
| commit | da95831d91b1265ecaee5bbfaeb1caaa2c290838 (patch) | |
| tree | cfeb82187971d64c84e88b889bfd517dddc2e35a | |
| parent | e45fb1ff018b269388fcebc1676110bb75f5dfe8 (diff) | |
| download | poky-da95831d91b1265ecaee5bbfaeb1caaa2c290838.tar.gz | |
scons: Pass MAXLINELENGTH to scons invocation
This helps in overcoming a problem when using scons with ccache enabled.
When commands get longer, then it resorts to using response files to do
the operations e.g. @/tmp/tmp96j6icra.lnk when this response file is
inboked by compiler it works ok, however, this does not when ccache is
used to invoke the complilation. We see errors e.g.
ccache @/tmp/tmppsyij_0v.lnk
ccache: error: execute_noreturn of @/tmp/tmppsyij_0v.lnk failed: No such file or directory
Using MAXLINELENGTH setting ensures that we can use ARG_MAX to extend
the length of commandline and hence avoid using response files. This
issue is also reported in mongodb [1]
[1] https://jira.mongodb.org/browse/SERVER-38389
(From OE-Core rev: 29558f6218f4676b459f2c78f82d245339d51c8c)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes-recipe/scons.bbclass | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes-recipe/scons.bbclass b/meta/classes-recipe/scons.bbclass index 5f0d4a910b..d510c12b9b 100644 --- a/meta/classes-recipe/scons.bbclass +++ b/meta/classes-recipe/scons.bbclass | |||
| @@ -9,11 +9,12 @@ inherit python3native | |||
| 9 | DEPENDS += "python3-scons-native" | 9 | DEPENDS += "python3-scons-native" |
| 10 | 10 | ||
| 11 | EXTRA_OESCONS ?= "" | 11 | EXTRA_OESCONS ?= "" |
| 12 | 12 | # This value below is derived from $(getconf ARG_MAX) | |
| 13 | SCONS_MAXLINELENGTH ?= "2097152" | ||
| 13 | do_configure() { | 14 | do_configure() { |
| 14 | if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then | 15 | if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then |
| 15 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then | 16 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then |
| 16 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} | 17 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} prefix=${prefix} ${EXTRA_OESCONS} |
| 17 | fi | 18 | fi |
| 18 | 19 | ||
| 19 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` | 20 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` |
| @@ -22,13 +23,17 @@ do_configure() { | |||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | scons_do_compile() { | 25 | scons_do_compile() { |
| 25 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \ | 26 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} || \ |
| 26 | die "scons build execution failed." | 27 | die "scons build execution failed." |
| 27 | } | 28 | } |
| 28 | 29 | ||
| 29 | scons_do_install() { | 30 | scons_do_install() { |
| 30 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \ | 31 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} install || \ |
| 31 | die "scons install execution failed." | 32 | die "scons install execution failed." |
| 32 | } | 33 | } |
| 33 | 34 | ||
| 35 | do_configure[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 36 | do_compile[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 37 | do_install[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 38 | |||
| 34 | EXPORT_FUNCTIONS do_compile do_install | 39 | EXPORT_FUNCTIONS do_compile do_install |
