From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7120559452426600448 X-Received: by 2002:a17:90b:3ec2:b0:1f0:3e9e:4f1d with SMTP id rm2-20020a17090b3ec200b001f03e9e4f1dmr15504418pjb.172.1657884440869; Fri, 15 Jul 2022 04:27:20 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:f68a:b0:16c:358e:2e9e with SMTP id l10-20020a170902f68a00b0016c358e2e9els7003987plg.7.gmail; Fri, 15 Jul 2022 04:27:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tivmg9RHHK5be0nB1IJ3ZHydYdUEzdJ6gr9lpTC86jACpfpLQmbo4fsXbdHwsA28a+/LAQ X-Received: by 2002:a17:90b:1b4f:b0:1f0:e99:ecb0 with SMTP id nv15-20020a17090b1b4f00b001f00e99ecb0mr15518488pjb.204.1657884439874; Fri, 15 Jul 2022 04:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657884439; cv=none; d=google.com; s=arc-20160816; b=z7n00kKkyuuzLL1zmMMmqzVsSATf5APpKb+z2ufueuP9rvlwMtLVSEAP0XJ1Agq0IN c6lyNZ9sAXQAIlIkkRk+zIBEHdq8xoG1zucufdnvaGI8YavISevgGwV5JJoJmIICWQxp emiqEI0ggmKA69z59TCBzhziJvY04Q9Nm1NokRfEErnLYbXTe0LVTpuFrNsajLx006tX WIVetHzBf8vWjvocsP7nCCssdCJiDiXRZNh+qvnYK5TNSL0rtyVYT1xa+64Uqv/ZNNdm N3wuTa2t0TVo+lx1AVkQaLlA7B8UaYHyswmzRnyfEFAGStk9FhxkmOdAC/K+VQLTATNO X8qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from; bh=Lm1p/TmjufFVJSQQgU6buOIxijBQ7vyXdyhdWRE60gk=; b=lrFnv1oKI9QD39O0Mcmr1gLH1f3QOV7U6Mz+fA2GpTu+grElgxGmDN/FB5R7FfBOGj A4CWKKj8KRHyVGGaEbCW9bPzi9494jTSLxXq76bN0yE6FEWZe1UToVmSI8A80qX7USC2 5cWSkPKpm93tuKWXw/Dym8bIP1q4WcOxgGaxeNvGh63X11N1UBrlzOPwx0wFA49bGlZV Vz6vkO35IUa0HFFbNQ4+339TUEWfxtX7yq0ajxpF1xiN5/vNWzbDsHOAGeIW76B6ghxz ed/irUkNVH1V4CvxO57XqCiunWAkYdc5wTzjcaGnPVrU4Q6pIE90Z3WjpOqSsAMGbfBH vX3A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id z2-20020a63ac42000000b00412b2ea1f91si188831pgn.1.2022.07.15.04.27.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jul 2022 04:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 26FBRGo5028484 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 15 Jul 2022 13:27:17 +0200 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH] sbuild: Fix low hit ratio for ccache on linux kernel rebuild Date: Fri, 15 Jul 2022 13:27:16 +0200 Message-Id: <20220715112716.2460-1-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: dvvuGZGr6uLG For some targets defconfig for linux recipe includes option CONFIG_DEBUG_INFO that embeds absolute path to the source files into compiled binaries. While sbuild uses unique directory to place sources for each build by default, it happens that ccache hits ration is to small on rebuild. This patch makes sbuild use the same build directory for sequential builds. While several packages can be built in parallel (e.g. same package for different architectures), WORKDIR is used to generate hash part for the build directory of sbuild. Signed-off-by: Uladzimir Bely --- meta/classes/dpkg.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index b726ea9d..016e46c4 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -82,6 +82,8 @@ dpkg_runbuild() { sh -c "cd ${WORKDIR}; dpkg-source -q -b ${PPS}" DSC_FILE=$(find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -print) + build_path_hash=$(echo "${WORKDIR}" | md5sum | cut -b1-6) + sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \ --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \ --no-run-lintian --no-run-piuparts --no-run-autopkgtest --resolve-alternatives \ @@ -91,6 +93,7 @@ dpkg_runbuild() { --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \ --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \ --debbuildopts="--source-option=-I" \ + --build-path="/build/${PN}-${build_path_hash}" \ --build-dir=${WORKDIR} --dist="isar" ${DSC_FILE} sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log" -- 2.20.1