public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/ccache/, dev-util/ccache/files/
Date: Mon, 10 Mar 2025 05:06:39 +0000 (UTC)	[thread overview]
Message-ID: <1741583143.3c0cece41a7ee3234ac108fcf81ccb744a344c89.sam@gentoo> (raw)

commit:     3c0cece41a7ee3234ac108fcf81ccb744a344c89
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 10 05:05:43 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 10 05:05:43 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c0cece4

dev-util/ccache: add 4.11

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/ccache/Manifest                           |   3 +
 dev-util/ccache/ccache-4.11.ebuild                 | 147 +++++++++++++++++++++
 .../ccache/files/ccache-4.11-avoid-run-user.patch  |  34 +++++
 3 files changed, 184 insertions(+)

diff --git a/dev-util/ccache/Manifest b/dev-util/ccache/Manifest
index 3153d47e08fb..d643803db343 100644
--- a/dev-util/ccache/Manifest
+++ b/dev-util/ccache/Manifest
@@ -1,3 +1,6 @@
 DIST ccache-4.10-docs.tar.xz 82900 BLAKE2B 0d0ef988bb21bc05642c2d5ea42bdf9c87c190464d3bddc08a8bf281b003670a50a07a88bf31731a781d5454be09b87168bc8df3b239b93f4e3d3e3f667e9094 SHA512 c1030e76dea6eaeed5548dda80a766bb9c944f8e1223157eb7a227f08f80f48a8fece4e1a99beced4c6075b40ec7de3df662111c95f9390624f6e9a3b04c1083
 DIST ccache-4.10.2.tar.xz 485460 BLAKE2B 7352b8b48ed889e1f251ae59cb7cd9d01d7d3226b58a7823be176907dc074ff22ca5d6a271e2caede7d97a65457b9067b48e9d39ab833bf45fb055eb3bfe7607 SHA512 3815c71d7266c32839acb306763268018acc58b3bbbd9ec79fc101e4217c1720d2ad2f01645bf69168c1c61d27700b6f3bb755cfa82689cca69824f015653f3c
 DIST ccache-4.10.2.tar.xz.asc 833 BLAKE2B 4a975aa1e8c9c12cf4df60b31cea10023e8e8efb561608dd652ecef2a0e575b41c5f6cfc551b0f3bd860e3b4a59061fcf870a67f5625f6a82cab104045ac2e57 SHA512 4afcc08563f0dfc8ccfd0797ea2cc26227b253415b9b9fe8ed90ef47e5b8d1dbcb8cbdd17ebf95acd6a367260f6a405764d0d0c5432cfbe2dce4d098b2a7a1b9
+DIST ccache-4.11-docs.tar.xz 86044 BLAKE2B c357dc3aa328a8201e62dfd92dc9380b2d5bbaf613a390305021a67f84199688e6fd6fb20489ad4ad81c45bbde44c8133fd12dc5f33cd7925fbde795fe5927e0 SHA512 58ffb519f24e33ac4394ce8dd5667ed1be67cab60ebcab7aa3c82adb31f14110992d0e56f8ebf2ef87e43bcfa202e1c05a4a187b5bcfc39a9bf0525d7039a0ce
+DIST ccache-4.11.tar.xz 500508 BLAKE2B 40a8316e3db0a8a1cc4599d407e6f0bea91dacf21d50675e6f740542ae85deb0137ead368d13d5d5cc3e8f83b2a5f6e8acf0cdae72d1f40661ef145a386ce98c SHA512 38f48663a44750e6340214375445564957f185a4f272426cfd9d26077be5788c6f4e2901773703cc4b660c629c5d31c9c66b901603cb531d3f9787f559872c8e
+DIST ccache-4.11.tar.xz.asc 833 BLAKE2B 7bdee25a277a624f624bc20627c12c923e58b03a124ae0d66cb05657135b92d9b32d93658bf558bfdd138d4d8151c1bcab6c9657940d6becb60d00a18dfa353b SHA512 0f1f17fb1464d74654fbfccb686574927d2463fa687044d278a5728f01776f90c52fb3b4cec383bbfccc085fbf9c0ac6a6c58629c15e9969f703fa79ca3f79ba

diff --git a/dev-util/ccache/ccache-4.11.ebuild b/dev-util/ccache/ccache-4.11.ebuild
new file mode 100644
index 000000000000..53a111a563e2
--- /dev/null
+++ b/dev-util/ccache/ccache-4.11.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# XXX: We don't use CCACHE_* for these vars like we do in e.g. cmake/libabigail/qemu
+# because Portage unsets them. Aaaah!
+#
+# Generate using https://github.com/thesamesam/sam-gentoo-scripts/blob/main/niche/generate-ccache-docs
+# Set to 1 if prebuilt, 0 if not
+# (the construct below is to allow overriding from env for script)
+: ${MY_DOCS_PREBUILT:=1}
+
+MY_DOCS_PREBUILT_DEV=sam
+MY_DOCS_VERSION=$(ver_cut 1-2)
+# Default to generating docs (inc. man pages) if no prebuilt; overridden later
+# See bug #784815
+MY_DOCS_USEFLAG="+doc"
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/joelrosdahl.asc
+inherit cmake toolchain-funcs flag-o-matic prefix verify-sig
+
+DESCRIPTION="Fast compiler cache"
+HOMEPAGE="https://ccache.dev/"
+SRC_URI="https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz"
+SRC_URI+=" verify-sig? ( https://github.com/ccache/ccache/releases/download/v${PV}/${P}.tar.xz.asc )"
+if [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then
+	SRC_URI+=" !doc? ( https://dev.gentoo.org/~${MY_DOCS_PREBUILT_DEV}/distfiles/${CATEGORY}/${PN}/${PN}-${MY_DOCS_VERSION}-docs.tar.xz )"
+	MY_DOCS_USEFLAG="doc"
+fi
+
+# https://ccache.dev/license.html
+# ccache, blake3, NonstdSpan, tl-expected
+LICENSE="GPL-3+ || ( CC0-1.0 Apache-2.0 ) Boost-1.0 CC0-1.0"
+LICENSE+=" elibc_mingw? ( LGPL-3 ISC PSF-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+# Enable 'static-c++' by default to make 'gcc' ebuild Just Work: bug #761220
+IUSE="${MY_DOCS_USEFLAG} redis +static-c++ test"
+RESTRICT="!test? ( test )"
+
+# TODO: package NonstdSpan, TlExpected
+DEPEND="
+	>=app-arch/zstd-1.3.4:=
+	!static-c++? (
+		>=dev-cpp/cpp-httplib-0.10.6:=
+		>=dev-libs/libfmt-8.0.0:=
+	)
+	>=dev-libs/blake3-1.4.0:=
+	>=dev-libs/xxhash-0.8.3
+	redis? ( >=dev-libs/hiredis-0.13.3:= )
+"
+RDEPEND="
+	${DEPEND}
+	dev-util/shadowman
+	sys-apps/gentoo-functions
+"
+# Needed for eselect calls in pkg_*
+IDEPEND="dev-util/shadowman"
+
+# clang-specific tests use dev-libs/elfutils to compare objects for equality.
+# Let's pull in the dependency unconditionally.
+BDEPEND="
+	doc? ( dev-ruby/asciidoctor )
+	test? (
+		>=dev-cpp/doctest-2.4.6
+		dev-libs/elfutils
+	)
+	verify-sig? ( sec-keys/openpgp-keys-joelrosdahl )
+"
+
+DOCS=( doc/{AUTHORS,MANUAL,NEWS}.adoc CONTRIBUTING.md README.md )
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.5-nvcc-test.patch
+	"${FILESDIR}"/${PN}-4.0-objdump.patch
+	"${FILESDIR}"/${PN}-4.11-avoid-run-user.patch
+)
+
+src_unpack() {
+	# Avoid aborting on the doc tarball
+	if use verify-sig ; then
+		verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.asc}
+	fi
+
+	default
+}
+
+src_prepare() {
+	cmake_src_prepare
+
+	cp "${FILESDIR}"/ccache-config-3 ccache-config || die
+	eprefixify ccache-config
+}
+
+src_configure() {
+	# Mainly used in tests
+	tc-export CC OBJDUMP
+
+	local mycmakeargs=(
+		-DENABLE_DOCUMENTATION=$(usex doc)
+		-DENABLE_TESTING=$(usex test)
+		-DDEPS=LOCAL
+		-DREDIS_STORAGE_BACKEND=$(usex redis)
+	)
+
+	# Avoid dependency on libstdc++.so. Useful for cases when
+	# we would like to use ccache to build older gcc which injects
+	# into ccache locally built (possibly outdated) libstdc++
+	# See bug #761220 for examples.
+	#
+	# Ideally gcc should not use LD_PRELOAD to avoid this type of failure.
+	if use static-c++ ; then
+		append-ldflags -static-libstdc++
+		mycmakeargs+=(
+			-DDEP_CPPHTTPLIB=BUNDLED
+			-DDEP_FMT=BUNDLED
+		)
+	fi
+
+	cmake_src_configure
+}
+
+src_install() {
+	cmake_src_install
+
+	dobin ccache-config
+	insinto /usr/share/shadowman/tools
+	newins - ccache <<<"${EPREFIX}/usr/lib/ccache/bin"
+
+	# If USE=doc, there'll be newly generated docs which we install instead.
+	if ! use doc && [[ ${MY_DOCS_PREBUILT} == 1 ]] ; then
+		doman "${WORKDIR}"/${PN}-${MY_DOCS_VERSION}-docs/doc/*.[0-8]
+	fi
+}
+
+pkg_prerm() {
+	if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then
+		eselect compiler-shadow remove ccache
+	fi
+}
+
+pkg_postinst() {
+	if [[ -z ${ROOT} ]] ; then
+		eselect compiler-shadow update ccache
+	fi
+}

diff --git a/dev-util/ccache/files/ccache-4.11-avoid-run-user.patch b/dev-util/ccache/files/ccache-4.11-avoid-run-user.patch
new file mode 100644
index 000000000000..0a890a7db7d9
--- /dev/null
+++ b/dev-util/ccache/files/ccache-4.11-avoid-run-user.patch
@@ -0,0 +1,34 @@
+Gentoo's sandbox does not whitelist this path by default yet.
+
+(4.1 update:
+https://github.com/ccache/ccache/issues/984
+https://github.com/ccache/ccache/issues/1044
+https://github.com/ccache/ccache/commit/a0edd4294f6a5a2d3f0c7b01273736f975f250e1
+https://github.com/ccache/ccache/commit/ef2e922f9642f943199138447b29ec53fa63ea68
+... gets us closer, but not there yet.)
+
+And see https://github.com/ccache/ccache/discussions/1086#discussioncomment-3327565.
+
+https://bugs.gentoo.org/837362 for 4.6 issue.
+https://bugs.gentoo.org/883799 and https://bugs.gentoo.org/887019 for 4.8 issue.
+--- a/src/ccache/config.cpp
++++ b/src/ccache/config.cpp
+@@ -1240,17 +1240,5 @@ Config::check_key_tables_consistency()
+ fs::path
+ Config::default_temporary_dir() const
+ {
+-  static const fs::path run_user_tmp_dir = [] {
+-#ifndef _WIN32
+-    const char* const xdg_runtime_dir = getenv("XDG_RUNTIME_DIR");
+-    if (xdg_runtime_dir && DirEntry(xdg_runtime_dir).is_directory()) {
+-      fs::path dir = FMT("{}/ccache-tmp", xdg_runtime_dir);
+-      if (fs::create_directories(dir) && access(dir.c_str(), W_OK) == 0) {
+-        return dir;
+-      }
+-    }
+-#endif
+-    return fs::path();
+-  }();
+-  return !run_user_tmp_dir.empty() ? run_user_tmp_dir : m_cache_dir / "tmp";
++  return m_cache_dir / "tmp";
+ }


             reply	other threads:[~2025-03-10  5:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10  5:06 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-20  6:29 [gentoo-commits] repo/gentoo:master commit in: dev-util/ccache/, dev-util/ccache/files/ Sam James
2024-08-10 20:02 Sam James
2024-05-31 18:46 Sam James
2024-03-24 18:02 Sam James
2024-02-07 19:20 Sam James
2023-05-20  4:39 Sam James
2023-05-17  4:01 Sam James
2022-09-23  1:56 Sam James
2022-08-22 21:08 Sam James
2022-05-20 19:26 Matt Turner
2022-04-09 11:26 Sam James
2022-04-09  4:30 Sam James
2021-06-18 10:15 Sergei Trofimovich
2020-11-18 19:07 Sergei Trofimovich
2020-10-19 18:49 Sergei Trofimovich
2019-02-02 23:40 Sergei Trofimovich
2019-01-04 21:13 Sergei Trofimovich
2018-10-15 21:13 Sergei Trofimovich
2018-08-15  8:39 Sergei Trofimovich
2016-05-27 20:40 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1741583143.3c0cece41a7ee3234ac108fcf81ccb744a344c89.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox