diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-01-29 21:03:42 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-15 21:46:56 +0000 |
| commit | 9eec094d2ef243c6145b29a1eb4f07c11b5b5970 (patch) | |
| tree | 19628d00311029841cbaa53a3312e9b54090b57d | |
| parent | 69ef8ccae59af4691ed7e1270c68890956c90cb3 (diff) | |
| download | poky-9eec094d2ef243c6145b29a1eb4f07c11b5b5970.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: b0e7777a911e236bda76e90258098057ed355953)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 29558f6218f4676b459f2c78f82d245339d51c8c)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/scons.bbclass | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes/scons.bbclass b/meta/classes/scons.bbclass index 80f8382107..72422d8884 100644 --- a/meta/classes/scons.bbclass +++ b/meta/classes/scons.bbclass | |||
| @@ -3,11 +3,12 @@ inherit python3native | |||
| 3 | DEPENDS += "python3-scons-native" | 3 | DEPENDS += "python3-scons-native" |
| 4 | 4 | ||
| 5 | EXTRA_OESCONS ?= "" | 5 | EXTRA_OESCONS ?= "" |
| 6 | 6 | # This value below is derived from $(getconf ARG_MAX) | |
| 7 | SCONS_MAXLINELENGTH ?= "2097152" | ||
| 7 | do_configure() { | 8 | do_configure() { |
| 8 | if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then | 9 | if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then |
| 9 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then | 10 | if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then |
| 10 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} | 11 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} prefix=${prefix} ${EXTRA_OESCONS} |
| 11 | fi | 12 | fi |
| 12 | 13 | ||
| 13 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` | 14 | mkdir -p `dirname ${CONFIGURESTAMPFILE}` |
| @@ -16,13 +17,17 @@ do_configure() { | |||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | scons_do_compile() { | 19 | scons_do_compile() { |
| 19 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \ | 20 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} || \ |
| 20 | die "scons build execution failed." | 21 | die "scons build execution failed." |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | scons_do_install() { | 24 | scons_do_install() { |
| 24 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} install || \ | 25 | ${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} install || \ |
| 25 | die "scons install execution failed." | 26 | die "scons install execution failed." |
| 26 | } | 27 | } |
| 27 | 28 | ||
| 29 | do_configure[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 30 | do_compile[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 31 | do_install[vardepsexclude] = "SCONS_MAXLINELENGTH" | ||
| 32 | |||
| 28 | EXPORT_FUNCTIONS do_compile do_install | 33 | EXPORT_FUNCTIONS do_compile do_install |
