From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9274915800D for ; Sun, 2 Jul 2023 13:24:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D96DAE083B; Sun, 2 Jul 2023 13:24:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A9FE9E083B for ; Sun, 2 Jul 2023 13:24:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B3951340DCE for ; Sun, 2 Jul 2023 13:24:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21436A9A for ; Sun, 2 Jul 2023 13:24:01 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688304219.b6e2235a3982cad4d74bb7eb49e858835344c3ba.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/cmake.eclass X-VCS-Directories: eclass/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: b6e2235a3982cad4d74bb7eb49e858835344c3ba X-VCS-Branch: master Date: Sun, 2 Jul 2023 13:24:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 518cc0cf-06c4-4531-92ee-0bb09062ea61 X-Archives-Hash: 4b83341f3873008639861465bad75974 commit: b6e2235a3982cad4d74bb7eb49e858835344c3ba Author: Sam James gentoo org> AuthorDate: Mon Jun 26 09:54:06 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Jul 2 13:23:39 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6e2235a cmake.eclass: workaround S=${WORKDIR} creating builddir above ${WORKDIR} When S=${WORKDIR}, cmake.eclass would create its build directory (if CMAKE_USE_DIR is unset) above WORKDIR(!) as ${WORKDIR}_build. Creating directories above WORKDIR is not legal. Portage has its own bug (bug #889418) in that it doesn't clean up unknown directories above WORKDIR in PORTAGE_TMPDIR, so combined, you get a problem where "ebuild ... clean" doesn't actually clean things up at all, and you get very confusing issues if e.g. changing CC between runs. The explicit S=WORKDIR check isn't truly needed but it makes explicit our intent here. Bug: https://bugs.gentoo.org/889418 Closes: https://bugs.gentoo.org/889420 Signed-off-by: Sam James gentoo.org> eclass/cmake.eclass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass index 1cdbc123a243..d70f2cbf1fac 100644 --- a/eclass/cmake.eclass +++ b/eclass/cmake.eclass @@ -293,6 +293,15 @@ _cmake_check_build_dir() { BUILD_DIR="${CMAKE_USE_DIR}" else : "${BUILD_DIR:=${CMAKE_USE_DIR}_build}" + + # Avoid creating ${WORKDIR}_build (which is above WORKDIR). + # TODO: For EAPI > 8, we should ban S=WORKDIR for CMake. + # See bug #889420. + if [[ ${S} == "${WORKDIR}" && ${BUILD_DIR} == "${WORKDIR}_build" ]] ; then + eqawarn "QA notice: S=WORKDIR is deprecated for cmake.eclass." + eqawarn "Please relocate the sources in src_unpack." + BUILD_DIR="${WORKDIR}"/${P}_build + fi fi einfo "Source directory (CMAKE_USE_DIR): \"${CMAKE_USE_DIR}\""