mirror of
https://git.yoctoproject.org/poky
synced 2026-03-06 15:29:40 +01:00
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>
40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
|
|
inherit python3native
|
|
|
|
DEPENDS += "python3-scons-native"
|
|
|
|
EXTRA_OESCONS ?= ""
|
|
# This value below is derived from $(getconf ARG_MAX)
|
|
SCONS_MAXLINELENGTH ?= "2097152"
|
|
do_configure() {
|
|
if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then
|
|
if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then
|
|
${STAGING_BINDIR_NATIVE}/scons --directory=${S} --clean PREFIX=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} prefix=${prefix} ${EXTRA_OESCONS}
|
|
fi
|
|
|
|
mkdir -p `dirname ${CONFIGURESTAMPFILE}`
|
|
echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
|
|
fi
|
|
}
|
|
|
|
scons_do_compile() {
|
|
${STAGING_BINDIR_NATIVE}/scons --directory=${S} ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} || \
|
|
die "scons build execution failed."
|
|
}
|
|
|
|
scons_do_install() {
|
|
${STAGING_BINDIR_NATIVE}/scons --directory=${S} install_root=${D}${prefix} PREFIX=${prefix} prefix=${prefix} MAXLINELENGTH=${SCONS_MAXLINELENGTH} ${EXTRA_OESCONS} install || \
|
|
die "scons install execution failed."
|
|
}
|
|
|
|
do_configure[vardepsexclude] = "SCONS_MAXLINELENGTH"
|
|
do_compile[vardepsexclude] = "SCONS_MAXLINELENGTH"
|
|
do_install[vardepsexclude] = "SCONS_MAXLINELENGTH"
|
|
|
|
EXPORT_FUNCTIONS do_compile do_install
|