[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-04 Thread Sam James
commit: 70a43aaf58504bb01c77faf58c96abe0b0ca856d
Author: Sam James  gentoo  org>
AuthorDate: Fri Oct  4 11:11:22 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Oct  4 11:49:01 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=70a43aaf

toolchain.eclass: add ewarns to explain USE=-debug behaviour w/ unreleased GCC

We sometimes have people surprised by the behaviour with USE=-debug for
unreleased versions of GCC.

For more detail on that & context, see:
* 564b130fd1bc8a35ac4d673d5211654c49af3fda
* 85db50a7c626a1844c8eb2d03051c8c5d320c205
* 3f9a5248fb796417d63ae1c1234b534a88f22f14

Add some ewarns to explain the situation to users so they understand
their options and also don't wrongly think GCC will be slow when released.

Bug: https://bugs.gentoo.org/904481
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a2eba0a9297e..5b978f6871db 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1148,7 +1148,15 @@ toolchain_src_configure() {
# unless USE=debug. Note that snapshots on stable branches 
don't count as "non-released"
# for these purposes.
if grep -q "experimental" gcc/DEV-PHASE ; then
-   # - USE=debug for pre-releases: yes,extra,rtl
+   # Tell users about the non-obvious behavior here so 
they don't think
+   # e.g. the next GCC release is super slow to compile 
things.
+   ewarn "Unreleased GCCs default to extra runtime checks 
even with USE=-debug,"
+   ewarn "matching upstream default behavior. We recommend 
keeping these enabled."
+   ewarn "The checks (sometimes substantially) increase 
build time but provide important protection"
+   ewarn "from potential miscompilations (wrong code) by 
turning them into build-time errors."
+   ewarn "To override (not recommended), set: 
GCC_CHECKS_LIST=\"release\"."
+
+   # - USE=debug for pre-releases: yes,extra,rtl (stornger 
than USE=debug for releases)
# - USE=-debug for pre-releases: yes,extra (following 
upstream default)
confgcc+=( --enable-checking="${GCC_CHECKS_LIST:-$(usex 
debug yes,extra,rtl yes,extra)}" )
else



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Sam James
commit: 8d90f4f76448e89de32e6cd4338e953d673c4f72
Author: Sam James  gentoo  org>
AuthorDate: Thu Oct  3 04:01:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Oct  3 04:01:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d90f4f7

toolchain.eclass: fix seq params

I didn't notice as I tested on a machine with ${SLOT} available.

Fixes: c9f79ed713758a95abea32d9c41f4f2a49f999b2
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 3cacc2da31b7..a2eba0a9297e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -848,7 +848,7 @@ toolchain_setup_ada() {
# 1) Match the version being built;
# 2) Iterate downwards from the version being built;
# 3) Iterate upwards from the version being built to the greatest 
version installed.
-   for ada_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
+   for ada_candidate in ${SLOT} $(seq $((${SLOT} - 1)) -1 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${ada_candidate}" || continue
 
ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
@@ -1010,7 +1010,7 @@ toolchain_setup_d() {
# 1) Match the version being built;
# 2) Iterate downwards from the version being built;
# 3) Iterate upwards from the version being built to the greatest 
version installed.
-   for d_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
+   for d_candidate in ${SLOT} $(seq $((${SLOT} - 1)) -1 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${d_candidate}" || continue
 
ebegin "Testing sys-devel/gcc:${d_candidate} for D"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Sam James
commit: c9f79ed713758a95abea32d9c41f4f2a49f999b2
Author: Sam James  gentoo  org>
AuthorDate: Thu Oct  3 03:41:14 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Oct  3 03:43:15 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9f79ed7

toolchain.eclass: change iteration strategy for GNAT and GDC

This improves upon the strategy from 9bb87839a6ad66ee7c89837a546fbf2e7f69b577
and d1aa56b6e39f07490021e594920f4a965a968c07.

Earlier, I saw building GCC 15's gdc fail w/ bootstrap from 10, even
though we had 11/12/13/14 installed.

The new logic is as follows, with descending order of preference:
1) Match the version being built;
2) Iterate downwards from the version being built;
3) Iterate upwards from the version being built to the greatest version 
installed.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 1c990f1f1114..3cacc2da31b7 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -844,10 +844,11 @@ toolchain_setup_ada() {
# GNAT can usually be built using the last major version and
# the current version, at least.
#
-   # We always prefer the version being built if possible
-   # as it has the greatest chance of success. Failing that,
-   # try GCC 10 and iterate upwards.
-   for ada_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
+   # Order of preference (descending):
+   # 1) Match the version being built;
+   # 2) Iterate downwards from the version being built;
+   # 3) Iterate upwards from the version being built to the greatest 
version installed.
+   for ada_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${ada_candidate}" || continue
 
ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
@@ -1005,10 +1006,11 @@ toolchain_setup_d() {
 
local d_bootstrap
local d_candidate
-   # We always prefer the version being built if possible
-   # as it has the greatest chance of success. Failing that,
-   # try GCC 10 and iterate upwards.
-   for d_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
+   # Order of preference (descending):
+   # 1) Match the version being built;
+   # 2) Iterate downwards from the version being built;
+   # 3) Iterate upwards from the version being built to the greatest 
version installed.
+   for d_candidate in ${SLOT} $(seq -1 $((${SLOT} - 1)) 10) $(seq 
$((${SLOT} + 1)) ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${d_candidate}" || continue
 
ebegin "Testing sys-devel/gcc:${d_candidate} for D"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Miroslav Šulc
commit: c1a63f395cae95a5603715ef7d43f58253252a97
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Wed Sep 11 11:27:39 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Wed Oct  2 09:01:44 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1a63f39

java-utils-2.eclass: add some missing function descriptions

Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/38559
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-utils-2.eclass | 32 
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index aa69cce14cae..1e9c28d5868f 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1648,6 +1648,10 @@ java-pkg_set-current-vm() {
export GENTOO_VM=${1}
 }
 
+# @FUNCTION: java-pkg_current-vm-matches
+# @USAGE:  [ [...]]
+# @RETURN: 0: the current vm matches any of the provided strings
+# @RETURN: 1: the current vm does not match any of the provided strings
 java-pkg_current-vm-matches() {
has $(java-pkg_get-current-vm) ${@}
return $?
@@ -2321,7 +2325,7 @@ java-pkg_init() {
export ANT_RESPECT_JAVA_HOME=
 }
 
-# @FUNCTION: java-pkg-init-compiler_
+# @FUNCTION: java-pkg_init-compiler_
 # @INTERNAL
 # @DESCRIPTION:
 # This function attempts to figure out what compiler should be used. It does
@@ -2342,9 +2346,7 @@ java-pkg_init() {
 # If the user doesn't defined anything in JAVA_PKG_COMPILERS_CONF, or no
 # suitable compiler was found there, then the default is to use javac provided
 # by the current VM.
-#
-#
-# @RETURN name of the compiler to use
+# @RETURN: name of the compiler to use
 java-pkg_init-compiler_() {
debug-print-function ${FUNCNAME} $*
 
@@ -2946,6 +2948,12 @@ java-pkg_ensure-dep() {
fi
 }
 
+# @FUNCTION: java-pkg_check-phase
+# @INTERNAL
+# @USAGE: 
+# @DESCRIPTION:
+# Checks whether the phase specified in $1 is the current active phase. If not,
+# a helpful QA message is displayed
 java-pkg_check-phase() {
local phase=${1}
local funcname=${FUNCNAME[1]}
@@ -2955,6 +2963,12 @@ java-pkg_check-phase() {
fi
 }
 
+# @FUNCTION: java-pkg_check-versioned-jar
+# @INTERNAL
+# @USAGE: 
+# @DESCRIPTION:
+# Checks whether the jar specified in $1 contains ${PV}. If it does, a helpful
+# QA message is displayed
 java-pkg_check-versioned-jar() {
local jar=${1}
 
@@ -2963,6 +2977,12 @@ java-pkg_check-versioned-jar() {
fi
 }
 
+# @FUNCTION: java-pkg_announce-qa-violation
+# @INTERNAL
+# @USAGE: [--nodie] 
+# @DESCRIPTION:
+# Prints out the  as a QA message. If ${JAVA_PKG_STRICT} is set, then die
+# is called. This can be overridden by providing --nodie
 java-pkg_announce-qa-violation() {
local nodie
if [[ ${1} == "--nodie" ]]; then
@@ -2979,6 +2999,10 @@ increment-qa-violations() {
export JAVA_PKG_QA_VIOLATIONS
 }
 
+# @FUNCTION: is-java-strict
+# @INTERNAL
+# @RETURN: 0: JAVA_PKG_STRICT is set
+# @RETURN: 1: JAVA_PKG_STRICT is not set
 is-java-strict() {
[[ -n ${JAVA_PKG_STRICT} ]]
return $?



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Miroslav Šulc
commit: cb2cde8fccc89412e914986153bf706e3c16a63a
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Wed Sep 11 05:55:59 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Wed Oct  2 09:01:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb2cde8f

java-pkg-2.eclass: remove unused eclass functions java-pkg-2_src_{compile,test}

The last ebuild using these functions was net-vpn/i2p-2.5.2-r1

Closes: https://bugs.gentoo.org/940526
Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-pkg-2.eclass | 92 +---
 1 file changed, 1 insertion(+), 91 deletions(-)

diff --git a/eclass/java-pkg-2.eclass b/eclass/java-pkg-2.eclass
index 6da4efd222c2..2b2a298cfe74 100644
--- a/eclass/java-pkg-2.eclass
+++ b/eclass/java-pkg-2.eclass
@@ -59,96 +59,6 @@ java-pkg-2_src_prepare() {
java-utils-2_src_prepare
 }
 
-
-# @FUNCTION: java-pkg-2_src_compile
-# @DEPRECATED: none
-# @DESCRIPTION:
-# Default src_compile for java packages
-#
-# @CODE
-# Variables:
-#   EANT_BUILD_XML - controls the location of the build.xml (default: 
./build.xml)
-#   EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
-#   EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
-#   EANT_DOC_TARGET - the target to build extra docs under the doc use flag
-# (default: javadoc; declare empty to disable completely)
-#   EANT_GENTOO_CLASSPATH - @see eant documentation in java-utils-2.eclass
-#   EANT_EXTRA_ARGS - extra arguments to pass to eant
-#   EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment
-# @CODE
-java-pkg-2_src_compile() {
-   if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
-   # auto generate classpath
-   java-pkg_gen-cp EANT_GENTOO_CLASSPATH
-
-   [[ "${EANT_FILTER_COMPILER}" ]] && \
-   java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
-   local antflags="${EANT_BUILD_TARGET:=jar}"
-   if has doc ${IUSE} && [[ -n "${EANT_DOC_TARGET=javadoc}" ]]; 
then
-   antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
-   fi
-   local tasks
-   [[ ${EANT_ANT_TASKS} ]] && tasks="${ANT_TASKS} 
${EANT_ANT_TASKS}"
-   ANT_TASKS="${tasks:-${ANT_TASKS}}" \
-   eant ${antflags} -f "${EANT_BUILD_XML}" 
${EANT_EXTRA_ARGS} "${@}"
-   else
-   echo "${FUNCNAME}: ${EANT_BUILD_XML} not found so nothing to 
do."
-   fi
-}
-
-# @FUNCTION: java-pkg-2_src_test
-# @DEPRECATED: none
-# @DESCRIPTION:
-# src_test, not exported.
-java-pkg-2_src_test() {
-   [[ -e "${EANT_BUILD_XML:=build.xml}" ]] || return
-
-   if [[ ${EANT_TEST_TARGET} ]] || < "${EANT_BUILD_XML}" tr -d "\n" | grep 
-Eq "]*\bname=[\"']test[\"']"; then
-   local opts task_re junit_re pkg
-
-   if [[ ${EANT_TEST_JUNIT_INTO} ]]; then
-   java-pkg_jar-from --into "${EANT_TEST_JUNIT_INTO}" junit
-   fi
-
-   if [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]; then
-   EANT_GENTOO_CLASSPATH="${EANT_TEST_GENTOO_CLASSPATH}"
-   fi
-
-   
ANT_TASKS=${EANT_TEST_ANT_TASKS:-${ANT_TASKS:-${EANT_ANT_TASKS}}}
-
-   task_re="\bdev-java/ant-junit(4)?(-[^:]+)?(:\S+)\b"
-   junit_re="\bdev-java/junit(-[^:]+)?(:\S+)\b"
-
-   if [[ ${DEPEND} =~ ${task_re} ]]; then
-   pkg="ant-junit${BASH_REMATCH[1]}${BASH_REMATCH[3]}"
-   pkg="${pkg%:0}"
-
-   if [[ ${ANT_TASKS} && "${ANT_TASKS}" != none ]]; then
-   ANT_TASKS="${ANT_TASKS} ${pkg}"
-   else
-   ANT_TASKS="${pkg}"
-   fi
-   elif [[ ${DEPEND} =~ ${junit_re} ]]; then
-   pkg="junit${BASH_REMATCH[2]}"
-   pkg="${pkg%:0}"
-
-   opts="-Djunit.jar=\"$(java-pkg_getjar ${pkg} 
junit.jar)\""
-
-   if [[ ${EANT_GENTOO_CLASSPATH} ]]; then
-   EANT_GENTOO_CLASSPATH+=",${pkg}"
-   else
-   EANT_GENTOO_CLASSPATH="${pkg}"
-   fi
-   fi
-
-   eant ${opts} -f "${EANT_BUILD_XML}" \
-   ${EANT_EXTRA_ARGS} ${EANT_TEST_EXTRA_ARGS} 
${EANT_TEST_TARGET:-test}
-
-   else
-   echo "${FUNCNAME}: No test target in ${EANT_BUILD_XML}"
-   fi
-}
-
 # @FUNCTION: java-pkg-2_pkg_preinst
 # @DESCRIPTION:
 # wrapper for java-utils-2_pkg_preinst
@@ -158,4 +68,4 @@ java-pkg-2_pkg_preinst() {
 
 fi
 
-EXPORT_FUNCTIONS pkg_setup src_prepare src_compile pkg_preinst
+EXPORT_FUNCTIONS pkg_setup src_prepare pkg_preinst



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Miroslav Šulc
commit: 34b685bb7d76a897630091e2b45745f34499bb66
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Sun Sep  8 07:52:01 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Wed Oct  2 09:01:44 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b685bb

java-utils-2.eclass: remove java-pkg_check-jikes

Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-utils-2.eclass | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 43d9b749ba3d..98426e1851eb 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -204,9 +204,9 @@ 
JAVA_PKG_COMPILERS_CONF=${JAVA_PKG_COMPILERS_CONF:="/etc/java-config-2/build/com
 #
 # Useful for local testing.
 #
-# Use jikes and javac, in that order
+# Use  and javac, in that order
 # @CODE
-#  JAVA_PKG_FORCE_COMPILER="jikes javac"
+#  JAVA_PKG_FORCE_COMPILER=" javac"
 # @CODE
 
 # @ECLASS_VARIABLE: JAVA_PKG_FORCE_ANT_TASKS
@@ -2307,9 +2307,6 @@ java-pkg_init() {
 
# TODO we will probably want to set JAVAC and JAVACFLAGS
 
-   # Do some QA checks
-   java-pkg_check-jikes
-
# Can't use unset here because Portage does not save the unset
# see https://bugs.gentoo.org/show_bug.cgi?id=189417#c11
 
@@ -2967,12 +2964,6 @@ java-pkg_check-versioned-jar() {
fi
 }
 
-java-pkg_check-jikes() {
-   if has jikes ${IUSE}; then
-   java-pkg_announce-qa-violation "deprecated USE flag 'jikes' in 
IUSE"
-   fi
-}
-
 java-pkg_announce-qa-violation() {
local nodie
if [[ ${1} == "--nodie" ]]; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-02 Thread Miroslav Šulc
commit: 834ed97a952c011c5e86d893cc6a329dd88bf9ac
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Sun Sep  8 07:37:22 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Wed Oct  2 09:01:44 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=834ed97a

java-utils-2.eclass: stop mentioning java-ant-2 eclass

Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-utils-2.eclass | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 98426e1851eb..aa69cce14cae 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -9,13 +9,12 @@
 # @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: Base eclass for Java packages
 # @DESCRIPTION:
-# This eclass provides functionality which is used by java-pkg-2.eclass,
-# java-pkg-opt-2.eclass and java-ant-2 eclass, as well as from ebuilds.
+# This eclass provides functionality which is used by java-pkg-2.eclass and
+# java-pkg-opt-2.eclass as well as from ebuilds.
 #
 # This eclass should not be inherited this directly from an ebuild. Instead,
 # you should inherit java-pkg-2 for Java packages or java-pkg-opt-2 for 
packages
-# that have optional Java support. In addition you can inherit java-ant-2 for
-# Ant-based packages.
+# that have optional Java support.
 
 if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
 _JAVA_UTILS_2_ECLASS=1
@@ -101,7 +100,7 @@ JAVA_PKG_ALLOW_VM_CHANGE=${JAVA_PKG_ALLOW_VM_CHANGE:="yes"}
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Specify a non-standard Java source version for compilation (via javac -source
-# parameter or Ant equivalent via build.xml rewriting done by java-ant-2 
eclass).
+# parameter).
 # Normally this is determined from the jdk version specified in DEPEND.
 # See java-pkg_get-source function below.
 #



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Sam James
commit: 6ef120e9895172dd7b2c6a1c9f5b14ef56c75ea7
Author: Sam James  gentoo  org>
AuthorDate: Wed Oct  2 00:57:30 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Oct  2 00:57:30 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ef120e9

toolchain.eclass: print all relevant flags, not just C{,XX}FLAGS + LDFLAGS

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 6a816a66275d..1c990f1f1114 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1040,9 +1040,10 @@ toolchain_src_configure() {
export ac_cv_std_swap_in_utility=no
fi
 
-   einfo "CFLAGS=\"${CFLAGS}\""
-   einfo "CXXFLAGS=\"${CXXFLAGS}\""
-   einfo "LDFLAGS=\"${LDFLAGS}\""
+   local flag
+   for flag in $(all-flag-vars) ; do
+   einfo "${flag}=\"${!flag}\""
+   done
 
local confgcc=( --host=${CHOST} )
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Eli Schwartz
commit: 50a9e89135f0e924fa0fe7c4482791c8056d9d75
Author: Eli Schwartz  gentoo  org>
AuthorDate: Tue Oct  1 19:46:56 2024 +
Commit: Eli Schwartz  gentoo  org>
CommitDate: Tue Oct  1 23:03:47 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50a9e891

toolchain.eclass: also reset STAGE1_CXXFLAGS for old compilers

Since commit a9156e205ca667cf40f43329b5bc22749f166501 we pass CXXFLAGS
as well, but it didn't include the existing logic we have for checking if
you have a really old compiler and taking precautions to avoid garbage
codegen breaking the stage1 compiler.

Signed-off-by: Eli Schwartz  gentoo.org>
Reviewed-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 3547549b1a12..d5570a746a2e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2076,6 +2076,7 @@ gcc_do_make() {
# using not-O0 is just a build-time speed improvement anyway.
if ! tc-is-gcc || ver_test $(gcc-fullversion) -lt 10 ; then
STAGE1_CFLAGS="-O0"
+   STAGE1_CXXFLAGS="-O0"
fi
 
# We only want to use the system's CFLAGS if not building a



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Eli Schwartz
commit: 9a089ae37edf29aa5956932209751379a1bceb21
Author: Eli Schwartz  gentoo  org>
AuthorDate: Tue Oct  1 20:07:21 2024 +
Commit: Eli Schwartz  gentoo  org>
CommitDate: Tue Oct  1 23:04:04 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a089ae3

toolchain.eclass: restrict *FLAGS for stage1 compiler when bootstrapping

e.g. if gnat1 from a bootstrap compiler is older than the host compiler
itself, we are going to end up passing flags that the host compiler does
understand, but gnat1 does not. This is trivially broken with
-march=native (passes loads of flags) and also more plebeian things such
as -march=x86-64-v3 which is sadly too new for gnat-10

Signed-off-by: Eli Schwartz  gentoo.org>
Reviewed-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d5570a746a2e..6a816a66275d 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2077,6 +2077,13 @@ gcc_do_make() {
if ! tc-is-gcc || ver_test $(gcc-fullversion) -lt 10 ; then
STAGE1_CFLAGS="-O0"
STAGE1_CXXFLAGS="-O0"
+   # We have a very good host compiler but it may be a bit too 
good, and
+   # know about flags that the version we are compiling does not 
know
+   # about. In principle we could check e.g. which gnat1 we are 
using as
+   # a bootstrap. It's simpler to do it unconditionally for now.
+   elif _tc_use_if_iuse ada || _tc_use_if_iuse d; then
+   STAGE1_CFLAGS="-O2"
+   STAGE1_CXXFLAGS="-O2"
fi
 
# We only want to use the system's CFLAGS if not building a



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread James Le Cuirot
commit: b4ca7760f8bb83e8d6180d6be48dcbd7af8b3498
Author: James Le Cuirot  gentoo  org>
AuthorDate: Tue Oct  1 20:37:51 2024 +
Commit: James Le Cuirot  gentoo  org>
CommitDate: Tue Oct  1 20:37:51 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4ca7760

cargo.eclass: Respect existing CARGO_TARGET_${TRIPLE}_RUSTFLAGS

This variable is used to disable crt-static with musl.

Closes: https://bugs.gentoo.org/940197
Signed-off-by: James Le Cuirot  gentoo.org>

 eclass/cargo.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 3a63e5027250..499fe5498c96 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -585,7 +585,7 @@ cargo_env() {
local -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
local TRIPLE=${TRIPLE^^} LD_A=( $(tc-getCC) ${LDFLAGS} )
-   local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C strip=none -C 
linker=${LD_A[0]}"
+   local -Ix CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+=" -C strip=none -C 
linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
local CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+=" ${RUSTFLAGS}"
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Eli Schwartz
commit: 8c195224ab8d8a499d120cb0b44371d7d7c0511c
Author: Eli Schwartz  gentoo  org>
AuthorDate: Tue Oct  1 15:26:00 2024 +
Commit: Eli Schwartz  gentoo  org>
CommitDate: Tue Oct  1 19:38:24 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c195224

toolchain.eclass: fix typo that prevented configuring with USE=ada

We need a bootstrap (version) and a bootstrap_type (value irrelevant for
now except to flag whether it is ada-bootstrap).

Due to a typo, we set the former first to the detected slot and then
immediately to the value "gcc", which made no sense since "gcc" isn't a
valid SLOT version of gcc. Hence we tried to run ${triplet}-gcc-gcc
instead of running ${triplet}-gcc-${SLOT}.

Only reproducible when using gnat-gpl itself as the gcc edition.

Signed-off-by: Eli Schwartz  gentoo.org>
Reviewed-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index e253cffa777b..3547549b1a12 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -884,7 +884,7 @@ toolchain_setup_ada() {
ebegin "Testing fallback dev-lang/gnat-gpl for Ada"
if has_version -b "dev-lang/gnat-gpl" ; then
ada_bootstrap=10
-   ada_bootstrap=gcc
+   ada_bootstrap_type=gcc
eend 0
else
eend 1



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Sam James
commit: ddc2dc1bbb001d95bdf0ece36f379481c97156be
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 10:16:58 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 10:16:58 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddc2dc1b

toolchain.eclass: conditionally pass -Wno-complain-wrong-lang for >= GCC 13

... ditto for -Wno-format-security and so on. It causes far more noise
than test cases it helps with. Of course, when we have -Wno-complain-wrong-lang
available (in >= GCC 13), then it's worth it.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7b302afdf5cc..e253cffa777b 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2171,8 +2171,10 @@ toolchain_src_test() {
(
# Workaround our -Wformat-security default which breaks
# various tests as it adds unexpected warning output.
-   GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format"
-   GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format"
+   if tc_version_is_at_least 13 ; then
+   GCC_TESTS_CFLAGS+=" -Wno-format-security -Wno-format"
+   GCC_TESTS_CXXFLAGS+=" -Wno-format-security -Wno-format"
+   fi
 
# Workaround our -Wtrampolines default which breaks
# tests too.
@@ -2182,8 +2184,10 @@ toolchain_src_test() {
GCC_TESTS_LDFLAGS+=" -Wl,--no-warn-execstack"
# Avoid confusing tests like Fortran/C interop ones where
# CFLAGS are used.
-   GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang"
-   GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang"
+   if tc_version_is_at_least 13 ; then
+   GCC_TESTS_CFLAGS+=" -Wno-complain-wrong-lang"
+   GCC_TESTS_CXXFLAGS+=" -Wno-complain-wrong-lang"
+   fi
 
# Issues with Ada tests:
# gnat.dg/align_max.adb



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-10-01 Thread Sam James
commit: 80f7aebfa94401e62f9f8132cf2fe16b51d9be40
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 07:46:22 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 07:46:22 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80f7aebf

toolchain.eclass: don't pass --specs= to gnat* tools

The gnat* tools don't understand --specs=* and we only need to do that
to ensure the compiler driver (gcc) calls the right things anyway.

What we might have to do in future however is force --gcc and --link...

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a9f02d6d6a46..7b302afdf5cc 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -982,7 +982,7 @@ toolchain_setup_ada() {
for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do
cat <<-EOF > "${T}"/ada-wrappers/${tool} || die
#!/bin/sh
-   exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
--specs=${T}/ada.spec "\$@"
+   exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) "\$@"
EOF
 
export "${tool^^}"="${T}"/ada-wrappers/${tool}



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: c52997d9b125de280d75b169b8bc6f3964d5d051
Author: Andrei Horodniceanu  proton  me>
AuthorDate: Mon Sep 30 16:32:52 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 06:59:28 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c52997d9

toolchain.eclass: Try harder to disable cet automagic

On arches that support USE=cet (those being amd64, arm64, and, x86)
always pass --enable-cet or --disable-cet (or aarch64
standard-branch-protection equivalent) to prevent any configure automagic
from happening.

Preserve the same CTARGET logic so only pass --enable-cet if the
target environment supports it and if `use cet`.

Also fix the regex `i[[34567]]86` as that matches an i, followed by any
of the digits from 3 to 7 or the [ character, followed by ], followed by
8, followed by 6. The regex originated in config/cet.m4 which uses []
for quotes.

The automatic specifically breaks gcc[d] on musl because it prevents the
code from using an internal assembly implementation for a function and
deferring to using an implementation that would be provided by
sys-libs/libucontext which results in undefined symbol errors:

```
/usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld:
/usr/lib/gcc/x86_64-pc-linux-musl/11/libgphobos.a(fiber.o): in function 
`_D4core6thread5fiber5Fiber9initStackMFNbNiZv':
(.text._D4core6thread5fiber5Fiber9initStackMFNbNiZv+0x2e): undefined reference 
to `getcontext'
/usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: 
(.text._D4core6thread5fiber5Fiber9initStackMFNbNiZv+0x5f): undefined reference 
to `makecontext'
/usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: 
/usr/lib/gcc/x86_64-pc-linux-musl/11/libgphobos.a(fiber.o): in function 
`_D4core6thread5fiber5Fiber12_staticCtor1FZv':
(.text._D4core6thread5fiber5Fiber12_staticCtor1FZv+0x1c): undefined reference 
to `getcontext'
```

Bug: https://bugs.gentoo.org/939874
Closes: https://bugs.gentoo.org/918692
Signed-off-by: Andrei Horodniceanu  proton.me>
Closes: https://github.com/gentoo/gentoo/pull/38830
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 65523041302e..a9f02d6d6a46 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1526,10 +1526,20 @@ toolchain_src_configure() {
fi
 
if in_iuse cet ; then
-   if [[ ${CTARGET} == i[[34567]]86-*-linux* || ${CTARGET} == 
x86_64-*-gnu* ]] ; then
-   confgcc+=( $(use_enable cet) )
-   fi
-   [[ ${CTARGET} == aarch64-*-gnu* ]] && confgcc+=( $(use_enable 
cet standard-branch-protection) )
+   # Usage: triple_arch triple_env cet_name
+   enable_cet_for() {
+   if [[ ${CTARGET} == ${1}-* ]] ; then
+   if use cet && [[ ${CTARGET} == *-${2}* ]]; then
+   confgcc+=( --enable-${3} )
+   else
+   confgcc+=( --disable-${3} )
+   fi
+   fi
+   }
+
+   enable_cet_for 'i[34567]86' 'linux' 'cet'
+   enable_cet_for 'x86_64' 'gnu' 'cet'
+   enable_cet_for 'aarch64' 'gnu' 'standard-branch-protection'
fi
 
if in_iuse systemtap ; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: 2492e4efc220c6f50eb2cfa01addcd1aaf198063
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 02:15:04 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 02:15:04 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2492e4ef

toolchain.eclass: reflow comments slightly

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a5c7d5df47d5..65523041302e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -956,8 +956,8 @@ toolchain_setup_ada() {
;;
esac
 
-   # Easier to substitute these values in rather than escape
-   # lots of bits above in heredoc.
+   # Easier to substitute these values in rather than escape lots of
+   # bits above in the heredoc.
sed -i \
-e "s:\${BROOT}:${BROOT}:" \
-e "s:\${CBUILD}:${CBUILD}:" \
@@ -965,9 +965,9 @@ toolchain_setup_ada() {
-e "s:\${ada_bootstrap}:${ada_bootstrap}:" \
"${T}"/ada.spec || die
 
-   # The Makefile tries to find libgnat by querying $(CC) which
-   # won't work for us as the stage1 compiler doesn't necessarily
-   # have Ada support. Substitute the Ada compiler we found earlier.
+   # The Makefile tries to find libgnat by querying $(CC) which won't
+   # work for us as the stage1 compiler doesn't necessarily have Ada
+   # support. Substitute the Ada compiler we found earlier.
local adalib
adalib=$(${CBUILD}-gcc-${ada_bootstrap} -print-libgcc-file-name || die 
"Finding adalib dir failed")
adalib="${adalib%/*}/adalib"
@@ -975,8 +975,8 @@ toolchain_setup_ada() {
-e "s:adalib=.*:adalib=${adalib}:" \
"${S}"/gcc/ada/gcc-interface/Make-lang.in || die
 
-   # Create bin wrappers because not all of the build system
-   # respects GNATBIND or GNATMAKE.
+   # Create bin wrappers because not all of the build system respects
+   # GNATBIND or GNATMAKE.
mkdir "${T}"/ada-wrappers || die
local tool
for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: e560bd7b70ae2d64ab1d86a716756c320b6d2f70
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 02:13:31 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 02:13:31 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e560bd7b

toolchain.eclass: further special-case dropping for ada-bootstrap

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 31 ---
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f9c5f58bf7d4..a5c7d5df47d5 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -945,19 +945,23 @@ toolchain_setup_ada() {
%{gnatc*|gnats*: -o %j} %{-param*}
EOF
 
-   # XXX: Hack for now
-   if [[ ${ada_bootstrap_type} == ada-bootstrap ]] ; then
-   sed -i \
-   -e 
"s:\${gnat1_path}:${BROOT}/usr/lib/ada-bootstrap/libexec/gcc/x86_64-pc-linux-gnu/10/gnat1:"
 \
-   "${T}"/ada.spec || die
-   fi
+   old_path="${PATH}"
+   case ${ada_bootstrap_type} in
+   ada-bootstrap)
+   export PATH="${BROOT}/usr/lib/ada-bootstrap/bin:${PATH}"
+   
gnat1_path=${BROOT}/usr/lib/ada-bootstrap/libexec/gcc/${CBUILD}/${ada_bootstrap}/gnat1
+   ;;
+   *)
+   
gnat1_path=${BROOT}/usr/libexec/gcc/${CBUILD}/${ada_bootstrap}/gnat1
+   ;;
+   esac
 
# Easier to substitute these values in rather than escape
# lots of bits above in heredoc.
sed -i \
-e "s:\${BROOT}:${BROOT}:" \
-e "s:\${CBUILD}:${CBUILD}:" \
-   -e 
"s:\${gnat1_path}:${BROOT}/usr/libexec/gcc/${CBUILD}/${ada_bootstrap}/gnat1:" \
+   -e "s:\${gnat1_path}:${gnat1_path}:" \
-e "s:\${ada_bootstrap}:${ada_bootstrap}:" \
"${T}"/ada.spec || die
 
@@ -965,13 +969,7 @@ toolchain_setup_ada() {
# won't work for us as the stage1 compiler doesn't necessarily
# have Ada support. Substitute the Ada compiler we found earlier.
local adalib
-   if [[ ${ada_bootstrap_type} == ada-bootstrap ]] ; then
-   old_path="${PATH}"
-   export PATH="${BROOT}/usr/lib/ada-bootstrap/bin:${PATH}"
-   adalib=$("${BROOT}"/usr/lib/ada-bootstrap/bin/${CBUILD}-gcc 
-print-libgcc-file-name || die "Finding adalib dir failed")
-   else
-   adalib=$(${CBUILD}-gcc-${ada_bootstrap} -print-libgcc-file-name 
|| die "Finding adalib dir failed")
-   fi
+   adalib=$(${CBUILD}-gcc-${ada_bootstrap} -print-libgcc-file-name || die 
"Finding adalib dir failed")
adalib="${adalib%/*}/adalib"
sed -i \
-e "s:adalib=.*:adalib=${adalib}:" \
@@ -982,11 +980,6 @@ toolchain_setup_ada() {
mkdir "${T}"/ada-wrappers || die
local tool
for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do
-   if [[ ${ada_bootstrap_type} == ada-bootstrap ]] ; then
-   ln -s "${BROOT}"/usr/lib/ada-bootstrap/bin/${tool} \
-   
"${T}"/ada-wrappers/${CBUILD}-${tool}-${ada_bootstrap} || die
-   fi
-
cat <<-EOF > "${T}"/ada-wrappers/${tool} || die
#!/bin/sh
exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
--specs=${T}/ada.spec "\$@"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: 6971e384576057adda25bb49a45f898fa13f83b1
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 02:04:41 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 02:04:41 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6971e384

toolchain.eclass: go back to PATH lookup for Ada wrappers

This should work now that we install gcc-config-style symlinks in
ada-bootstrap.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 355d5e12b4b5..f9c5f58bf7d4 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -989,7 +989,7 @@ toolchain_setup_ada() {
 
cat <<-EOF > "${T}"/ada-wrappers/${tool} || die
#!/bin/sh
-   exec ${CBUILD}-${tool}-${ada_bootstrap} --specs=${T}/ada.spec 
"\$@"
+   exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
--specs=${T}/ada.spec "\$@"
EOF
 
export "${tool^^}"="${T}"/ada-wrappers/${tool}



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: 409fcc75caaa1c29188227011638873bda6a5ef5
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 01:47:22 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 01:47:22 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=409fcc75

toolchain.eclass: quote BROOT

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f52ff0e6bb60..7a67951fb7ab 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -968,7 +968,7 @@ toolchain_setup_ada() {
if [[ ${ada_bootstrap_type} == ada-bootstrap ]] ; then
old_path="${PATH}"
export PATH="${BROOT}/usr/lib/ada-bootstrap/bin:${PATH}"
-   adalib=$(${BROOT}/usr/lib/ada-bootstrap/bin/${CBUILD}-gcc 
-print-libgcc-file-name || die "Finding adalib dir failed")
+   adalib=$("${BROOT}"/usr/lib/ada-bootstrap/bin/${CBUILD}-gcc 
-print-libgcc-file-name || die "Finding adalib dir failed")
else
adalib=$(${CBUILD}-gcc-${ada_bootstrap} -print-libgcc-file-name 
|| die "Finding adalib dir failed")
fi



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: 23575e7311a21db0aa2dac9b29c5baa4f172658d
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 01:49:19 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 01:57:31 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23575e73

toolchain.eclass: small ada-bootstrap tweaks

* Don't try to do a PATH lookup for the wrappers for now; need to install
  more symlinks in ada-bootstrap, I think
* Style tweaks

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7a67951fb7ab..355d5e12b4b5 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -983,17 +983,18 @@ toolchain_setup_ada() {
local tool
for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do
if [[ ${ada_bootstrap_type} == ada-bootstrap ]] ; then
-   ln -s "${BROOT}"/usr/lib/ada-bootstrap/bin/${tool} 
"${T}"/ada-wrappers/${CBUILD}-${tool}-${ada_bootstrap} || die
+   ln -s "${BROOT}"/usr/lib/ada-bootstrap/bin/${tool} \
+   
"${T}"/ada-wrappers/${CBUILD}-${tool}-${ada_bootstrap} || die
fi
 
cat <<-EOF > "${T}"/ada-wrappers/${tool} || die
-   #!/bin/sh
-   exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
-specs=${T}/ada.spec "\$@"
-   EOF
-   chmod +x "${T}"/ada-wrappers/${tool} || die
+   #!/bin/sh
+   exec ${CBUILD}-${tool}-${ada_bootstrap} --specs=${T}/ada.spec 
"\$@"
+   EOF
 
export "${tool^^}"="${T}"/ada-wrappers/${tool}
done
+   chmod +x 
"${T}"/ada-wrappers/gnat{,bind,chop,clean,kr,link,ls,make,name,prep} || die
 
export PATH="${T}/ada-wrappers:${old_path}"
export CC="$(tc-getCC) -specs=${T}/ada.spec"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: 7a6f738a6e505b65bf7d9032810adccc419e9467
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 01:45:16 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 01:45:45 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a6f738a

toolchain.eclass: further adaptations to dev-lang/ada-bootstrap

This needs prettifying, which I'll do shortly.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 42 +++---
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 648e67b9493b..f52ff0e6bb60 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -840,6 +840,7 @@ toolchain_setup_ada() {
 
local ada_bootstrap
local ada_candidate
+   local ada_bootstrap_type
# GNAT can usually be built using the last major version and
# the current version, at least.
#
@@ -852,6 +853,7 @@ toolchain_setup_ada() {
ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
if has_version -b "sys-devel/gcc:${ada_candidate}[ada(-)]" ; 
then
ada_bootstrap=${ada_candidate}
+   ada_bootstrap_type=gcc
 
eend 0
break
@@ -863,16 +865,15 @@ toolchain_setup_ada() {
if ver_test ${ada_bootstrap} -gt ${PV} || [[ -z ${ada_bootstrap} ]] ; 
then
ebegin "Testing fallback dev-lang/ada-bootstrap for Ada"
if has_version -b " "${T}"/ada-wrappers/${tool} || die
#!/bin/sh
exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
-specs=${T}/ada.spec "\$@"
EOF
chmod +x "${T}"/ada-wrappers/${tool} || die
 
-   export "${tool^^}"=${CBUILD}-${tool}-${ada_bootstrap}
+   export "${tool^^}"="${T}"/ada-wrappers/${tool}
done
 
-   export PATH="${T}/ada-wrappers:${PATH}"
+   export PATH="${T}/ada-wrappers:${old_path}"
export CC="$(tc-getCC) -specs=${T}/ada.spec"
 }
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-30 Thread Sam James
commit: e6a69ea10ed74a0ce49e979bbc4bbce139949259
Author: Sam James  gentoo  org>
AuthorDate: Tue Oct  1 01:02:17 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Oct  1 01:10:28 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6a69ea1

toolchain.eclass: support dev-lang/ada-bootstrap

Bug: https://bugs.gentoo.org/547358
Bug: https://bugs.gentoo.org/919667
Bug: https://bugs.gentoo.org/940472
Closes: https://bugs.gentoo.org/940471
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 42 +-
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 939c68113188..648e67b9493b 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -402,7 +402,16 @@ if tc_has_feature valgrind ; then
 fi
 
 if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
-   BDEPEND+=" ada? ( || ( sys-devel/gcc:${SLOT}[ada] 
 "${T}"/ada.spec || die



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 1bc16717ffb9819d1f5f03c1fe413be04d378246
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 05:54:07 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 05:57:22 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bc16717

toolchain.eclass: tweak Ada, D deps

Without this, we can end up with something like:
```
[ebuild  NS] sys-devel/gcc-11.5.0:11::gentoo [13.3.1_p20240614:13::gentoo] 
USE="(ada*) cet (cxx) (d*) [...]"
[ebuild   R]  sys-devel/gcc-13.3.1_p20240614:13::gentoo  USE="(ada*) cet 
(cxx) (d*) [...]"

Total: 2 packages (1 in new slot, 1 reinstall), Size of downloads: 0 KiB

 * Error: circular dependencies:

(sys-devel/gcc-13.3.1_p20240614:13/13::gentoo, ebuild scheduled for merge) 
depends on
 (sys-devel/gcc-11.5.0:11/11::gentoo, ebuild scheduled for merge) (buildtime)
  (sys-devel/gcc-13.3.1_p20240614:13/13::gentoo, ebuild scheduled for merge) 
(buildtime)
```

Portage sees sys-devel/gcc[ada] is queued and tries to use it to satisfy
the dep for 11, which pulls in 13, which pulls in 11 for D.

We can workaround this by depending on older GCC for whatever slot we're
in. This matches upstream documentation and also reality as you usually
need an older version anyway.

See also 370253f008a8922c9aebe8099ab9c34bd6947f66 in binhost.git.

Bug: https://bugs.gentoo.org/880825
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d29d07080582..939c68113188 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -402,7 +402,7 @@ if tc_has_feature valgrind ; then
 fi
 
 if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
-   BDEPEND+=" ada? ( || ( sys-devel/gcc[ada] dev-lang/gnat-gpl[ada] ) )"
+   BDEPEND+=" ada? ( || ( sys-devel/gcc:${SLOT}[ada] 


[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: f24f34cb062fce22d27296d989ec85a8e3cc106c
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:59:13 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:59:13 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f24f34cb

toolchain.eclass: drop obsolete Java workaround

toolchain.eclass hasn't supported versions of GCC that included GCJ
for a while (see ::toolchain and toolchain-legacy.eclass if interested
in that), so drop an obsolete Java workaround we forgot to remove
when cleaning up the rest.

Bug: https://bugs.gentoo.org/384291
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 
 1 file changed, 4 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 2950eaa3ccf2..d29d07080582 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1006,10 +1006,6 @@ toolchain_src_configure() {
einfo "CXXFLAGS=\"${CXXFLAGS}\""
einfo "LDFLAGS=\"${LDFLAGS}\""
 
-   # Force internal zip based jar script to avoid random
-   # issues with 3rd party jar implementations. bug #384291
-   export JAR=no
-
local confgcc=( --host=${CHOST} )
 
if is_crosscompile || tc-is-cross-compiler ; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: d8160b8b90c6c752640af9db65061bb76c05d0c4
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:58:25 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:58:25 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8160b8b

toolchain.eclass: consolidate a comment

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 9900b2989abf..2950eaa3ccf2 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -998,8 +998,7 @@ toolchain_src_configure() {
gcc_do_filter_flags
 
if ! tc_version_is_at_least 11 && [[ $(gcc-major-version) -ge 12 ]] ; 
then
-   # https://gcc.gnu.org/PR105695
-   # bug #849359
+   # https://gcc.gnu.org/PR105695 (bug #849359)
export ac_cv_std_swap_in_utility=no
fi
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 9cfe1db9d69d0363f7591734822d4ba527d538fd
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:17:50 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:17:50 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cfe1db9

toolchain.eclass: consolidate language configure options

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 41f51b1bb747..9900b2989abf 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1022,18 +1022,6 @@ toolchain_src_configure() {
fi
[[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
 
-   _need_ada_bootstrap_mangling() {
-   if [[ ${CATEGORY}/${PN} == dev-lang/gnat-gpl ]] ; then
-   _tc_use_if_iuse system-bootstrap && return 0
-   return 1
-   fi
-
-   _tc_use_if_iuse ada
-   }
-
-   _need_ada_bootstrap_mangling && toolchain_setup_ada
-   _tc_use_if_iuse d && toolchain_setup_d
-
confgcc+=(
--prefix="${PREFIX}"
--bindir="${BINPATH}"
@@ -1088,6 +1076,18 @@ toolchain_src_configure() {
is_modula2 && GCC_LANG+=",m2"
is_rust && GCC_LANG+=",rust"
 
+   _need_ada_bootstrap_mangling() {
+   if [[ ${CATEGORY}/${PN} == dev-lang/gnat-gpl ]] ; then
+   _tc_use_if_iuse system-bootstrap && return 0
+   return 1
+   fi
+
+   _tc_use_if_iuse ada
+   }
+
+   _need_ada_bootstrap_mangling && toolchain_setup_ada
+   _tc_use_if_iuse d && toolchain_setup_d
+
confgcc+=( --enable-languages=${GCC_LANG} )
 
### general options



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: cd4189a259b3f34d0da39851931dc1a6a6a631f2
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:14:13 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:14:13 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd4189a2

toolchain.eclass: move Ada and D logic into their own functions

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 285 +---
 1 file changed, 149 insertions(+), 136 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f64128baef48..41f51b1bb747 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -819,100 +819,62 @@ setup_multilib_osdirnames() {
sed -i "${sed_args[@]}" "${S}"/gcc/config/${config} || die
 }
 
-#>> src_configure <<
-
-toolchain_src_configure() {
-   BUILD_CONFIG_TARGETS=()
-   is-flagq '-O3' && BUILD_CONFIG_TARGETS+=( bootstrap-O3 )
-
-   downgrade_arch_flags
-   gcc_do_filter_flags
-
-   if ! tc_version_is_at_least 11 && [[ $(gcc-major-version) -ge 12 ]] ; 
then
-   # https://gcc.gnu.org/PR105695
-   # bug #849359
-   export ac_cv_std_swap_in_utility=no
-   fi
-
-   einfo "CFLAGS=\"${CFLAGS}\""
-   einfo "CXXFLAGS=\"${CXXFLAGS}\""
-   einfo "LDFLAGS=\"${LDFLAGS}\""
-
-   # Force internal zip based jar script to avoid random
-   # issues with 3rd party jar implementations. bug #384291
-   export JAR=no
+# @FUNCTION: toolchain_setup_ada
+# @INTERNAL
+# @DESCRIPTION:
+# Determine the most suitable GNAT (Ada compiler) for bootstrapping
+# and setup the environment, including wrappers, for building.
+toolchain_setup_ada() {
+   local latest_gcc=$(best_version -b "sys-devel/gcc")
+   latest_gcc="${latest_gcc#sys-devel/gcc-}"
+   latest_gcc=$(ver_cut 1 ${latest_gcc})
+
+   local ada_bootstrap
+   local ada_candidate
+   # GNAT can usually be built using the last major version and
+   # the current version, at least.
+   #
+   # We always prefer the version being built if possible
+   # as it has the greatest chance of success. Failing that,
+   # try GCC 10 and iterate upwards.
+   for ada_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
+   has_version -b "sys-devel/gcc:${ada_candidate}" || continue
 
-   local confgcc=( --host=${CHOST} )
+   ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
+   if has_version -b "sys-devel/gcc:${ada_candidate}[ada(-)]" ; 
then
+   ada_bootstrap=${ada_candidate}
 
-   if is_crosscompile || tc-is-cross-compiler ; then
-   # Straight from the GCC install doc:
-   # "GCC has code to correctly determine the correct value for 
target
-   # for nearly all native systems. Therefore, we highly recommend 
you
-   # not provide a configure target when configuring a native 
compiler."
-   confgcc+=( --target=${CTARGET} )
-   fi
-   [[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
-
-   _need_ada_bootstrap_mangling() {
-   if [[ ${CATEGORY}/${PN} == dev-lang/gnat-gpl ]] ; then
-   _tc_use_if_iuse system-bootstrap && return 0
-   return 1
+   eend 0
+   break
fi
+   eend 1
+   done
 
-   _tc_use_if_iuse ada
-   }
-
-   if _need_ada_bootstrap_mangling ; then
-   local latest_gcc=$(best_version -b "sys-devel/gcc")
-   latest_gcc="${latest_gcc#sys-devel/gcc-}"
-   latest_gcc=$(ver_cut 1 ${latest_gcc})
-
-   local ada_bootstrap
-   local ada_candidate
-   # GNAT can usually be built using the last major version and
-   # the current version, at least.
-   #
-   # We always prefer the version being built if possible
-   # as it has the greatest chance of success. Failing that,
-   # try GCC 10 and iterate upwards.
-   for ada_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
-   has_version -b "sys-devel/gcc:${ada_candidate}" || 
continue
-
-   ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
-   if has_version -b 
"sys-devel/gcc:${ada_candidate}[ada(-)]" ; then
-   ada_bootstrap=${ada_candidate}
-
-   eend 0
-   break
-   fi
+   # As a last resort, use dev-lang/gnat-gpl.
+   # TODO: Make gnat-gpl coinstallable with gcc:10 (bug #940471).
+   if ver_test ${ada_bootstrap} -gt ${PV} || [[ -z ${ada_bootstrap} ]] ; 
then
+   ebegin "Testing dev-lang/gnat-gpl for Ada"
+   if has_version -b "dev-lang/gnat-gpl" ; then
+  

[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 4f9c576ac91e273b0023084d4be134c94c65f7df
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:04:48 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:05:23 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f9c576a

toolchain.eclass: switch to /bin/sh shebang for Ada wrappers

type -P is used in ebuild context, not in the script itself (it is expanded
in the heredoc), so we can use POSIX shell. It might make things slightly
faster given these tools get invoked a lot during the build.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7800681a6fb8..f64128baef48 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -981,7 +981,7 @@ toolchain_src_configure() {
local tool
for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; 
do
cat <<-EOF > "${T}"/ada-wrappers/${tool} || die
-   #!/bin/bash
+   #!/bin/sh
exec $(type -P ${CBUILD}-${tool}-${ada_bootstrap}) 
-specs=${T}/ada.spec "\$@"
EOF
chmod +x "${T}"/ada-wrappers/${tool} || die



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 579c67b21758fbacff3527a01a12f00ed90f931d
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:58:41 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 01:58:41 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=579c67b2

toolchain.eclass: add explanation for 'sorry' on fallback Ada path

Give a nicer message to users in case they hit the 'sorry' fallback
Ada path.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index b563277e90b1..b2ada2190328 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -903,6 +903,9 @@ toolchain_src_configure() {
# OK, even gnat-gpl didn't work. Give up for now.
# TODO: Source a newer, or build our own, bootstrap tarball.
if [[ -z ${ada_bootstrap} ]] ; then
+   eerror "Couldn't find a suitable GNAT compiler for Ada!"
+   eerror "Please try installing dev-lang/gnat-gpl."
+   eerror "For other platforms, you may need to use 
crossdev."
die "Fallback ada-bootstrap path not yet implemented!"
 
#einfo "Using bootstrap GNAT compiler..."



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: a90f7ff581cae6ab4d92a73ba734dc5377288616
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 02:01:53 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:01:53 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a90f7ff5

toolchain.eclass: move GNAT comment

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index dfa46f094e45..7800681a6fb8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -869,6 +869,9 @@ toolchain_src_configure() {
 
local ada_bootstrap
local ada_candidate
+   # GNAT can usually be built using the last major version and
+   # the current version, at least.
+   #
# We always prefer the version being built if possible
# as it has the greatest chance of success. Failing that,
# try GCC 10 and iterate upwards.
@@ -877,9 +880,6 @@ toolchain_src_configure() {
 
ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
if has_version -b 
"sys-devel/gcc:${ada_candidate}[ada(-)]" ; then
-   # Make sure we set a path to the Ada bootstrap 
if gcc[ada] is not already
-   # installed. GNAT can usually be built using 
the last major version and
-   # the current version, at least.
ada_bootstrap=${ada_candidate}
 
eend 0



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 1ce76a16c8f6e283f277190e4b86dfea8fc38cb3
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:59:37 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 02:00:49 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ce76a16

toolchain.eclass: add bug reference to ada-bootstrap comment

Bug: https://bugs.gentoo.org/940471
Bug: https://bugs.gentoo.org/940472
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index b2ada2190328..dfa46f094e45 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -889,7 +889,7 @@ toolchain_src_configure() {
done
 
# As a last resort, use dev-lang/gnat-gpl.
-   # TODO: Make gnat-gpl coinstallable with gcc:10.
+   # TODO: Make gnat-gpl coinstallable with gcc:10 (bug #940471).
if ver_test ${ada_bootstrap} -gt ${PV} || [[ -z 
${ada_bootstrap} ]] ; then
ebegin "Testing dev-lang/gnat-gpl for Ada"
if has_version -b "dev-lang/gnat-gpl" ; then
@@ -901,7 +901,7 @@ toolchain_src_configure() {
fi
 
# OK, even gnat-gpl didn't work. Give up for now.
-   # TODO: Source a newer, or build our own, bootstrap tarball.
+   # TODO: Source a newer, or build our own, bootstrap tarball 
(bug #940472).
if [[ -z ${ada_bootstrap} ]] ; then
eerror "Couldn't find a suitable GNAT compiler for Ada!"
eerror "Please try installing dev-lang/gnat-gpl."



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: d0d87a54bb3bb7b077c75b44ff419177fc03ebb8
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:22:34 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 01:51:43 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0d87a54

toolchain.eclass: check CXXFLAGS too in -march=native sanity check

Bug: https://bugs.gentoo.org/904426
Thanks-to: Pacho Ramos  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 616bc01a840a..d6445ea3227e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1812,7 +1812,7 @@ gcc_do_filter_flags() {
declare -A l1_cache_sizes=()
# Workaround for inconsistent cache sizes on hybrid P/E cores
# See PR111768 (and bug #904426, bug #908523, and bug #915389)
-   if [[ ${CBUILD} == @(x86_64|i?86)* ]] && [[ ${CFLAGS} == 
*-march=native* ]] && tc-is-gcc ; then
+   if [[ ${CBUILD} == @(x86_64|i?86)* ]] && [[ "${CFLAGS}${CXXFLAGS}" == 
*-march=native* ]] && tc-is-gcc ; then
local x
local l1_cache_size
# Iterate over all cores and find their L1 cache size



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: c965c2d0a66b0827add2ac7708c69589491c5e8b
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:20:59 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 01:51:43 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c965c2d0

toolchain.eclass: drop whitespace at end of function

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 1 -
 1 file changed, 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7dc905ecd7d8..616bc01a840a 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -775,7 +775,6 @@ tc_enable_hardened_gcc() {
sed -i \
-e "/^HARD_CFLAGS = /s|=|= ${hardened_gcc_flags} |" \
"${S}"/gcc/Makefile.in || die
-
 }
 
 # This is a historical wart.  The original Gentoo/amd64 port used:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: ea474da34fe1f904936f0f6b6e52d91364c36c95
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:25:23 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 01:51:44 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea474da3

toolchain.eclass: unset _GLIBCXX_ASSERTIONS for stage1 with D bootstrap

When bootstrapping D for >= GCC 12 - where we enable _GLIBCXX_ASSERTIONS
by default for USE=hardened - using GCC 11, we run into trouble where
an implementation detail of _GLIBCXX_ASSERTIONS changed: see PR104807,
r12-7504-gd3a757af21ac33, and r12-7522-g4cb935cb69f120.

Workaround this by just disabling _GLIBCXX_ASSERTIONS for the stage 1
compiler (where it's not particularly important anyway) when USE=hardened
and we're building D. We could make this more conditional if needed
but I don't think it's worth it. In fact, maybe we should do this
unconditionally for a minor speed boost in building.

Bug: https://gcc.gnu.org/PR104807
Bug: https://bugs.gentoo.org/940470
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 9 +
 1 file changed, 9 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d6445ea3227e..b563277e90b1 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2029,6 +2029,15 @@ gcc_do_make() {
BOOT_LDFLAGS=${BOOT_LDFLAGS-"${abi_ldflags} ${LDFLAGS}"}
LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}"
 
+   # If we need to in future, we could really simplify this
+   # to just be unconditional for stage1. It doesn't really
+   # matter there. If we want to go in the other direction
+   # and make this more conditional, we could check if
+   # the bootstrap compiler is < GCC 12. See bug #940470.
+   if _tc_use_if_iuse d && use hardened ; then
+   STAGE1_CXXFLAGS+=" -U_GLIBCXX_ASSERTIONS"
+   fi
+
emakeargs+=(
STAGE1_CFLAGS="${STAGE1_CFLAGS}"
STAGE1_CXXFLAGS="${STAGE1_CXXFLAGS}"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: a9156e205ca667cf40f43329b5bc22749f166501
Author: Sam James  gentoo  org>
AuthorDate: Mon Sep 30 01:19:35 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep 30 01:51:42 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9156e20

toolchain.eclass: pass STAGE1_CXXFLAGS

Note that we're reusing get_abi_CFLAGS here as multilib.eclass doesn't
have get_abi_CXXFLAGS yet (bug #940501).

Adding this for the benefit of some GDC hackery we're doing (bug #940470).

Bug: https://bugs.gentoo.org/940501
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 138925777dd6..7dc905ecd7d8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2023,6 +2023,8 @@ gcc_do_make() {
# We only want to use the system's CFLAGS if not building a
# cross-compiler.
STAGE1_CFLAGS=${STAGE1_CFLAGS-"$(get_abi_CFLAGS 
${TARGET_DEFAULT_ABI}) ${CFLAGS}"}
+   # multilib.eclass lacks get_abi_CXXFLAGS (bug #940501)
+   STAGE1_CXXFLAGS=${STAGE1_CXXFLAGS-"$(get_abi_CFLAGS 
${TARGET_DEFAULT_ABI}) ${CXXFLAGS}"}
STAGE1_LDFLAGS=${STAGE1_LDFLAGS-"${abi_ldflags} ${LDFLAGS}"}
BOOT_CFLAGS=${BOOT_CFLAGS-"$(get_abi_CFLAGS 
${TARGET_DEFAULT_ABI}) ${CFLAGS}"}
BOOT_LDFLAGS=${BOOT_LDFLAGS-"${abi_ldflags} ${LDFLAGS}"}
@@ -2030,6 +2032,7 @@ gcc_do_make() {
 
emakeargs+=(
STAGE1_CFLAGS="${STAGE1_CFLAGS}"
+   STAGE1_CXXFLAGS="${STAGE1_CXXFLAGS}"
STAGE1_LDFLAGS="${STAGE1_LDFLAGS}"
BOOT_CFLAGS="${BOOT_CFLAGS}"
BOOT_LDFLAGS="${BOOT_LDFLAGS}"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 6c118fbbefc7ab5340c98179908fab2e6fca6b8a
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 11:27:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 11:27:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c118fbb

toolchain.eclass: attempt to use gnat-gpl if the bootstrap GNAT is too new

Bug: https://bugs.gentoo.org/880825
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 62ff83feed28..138925777dd6 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -891,7 +891,7 @@ toolchain_src_configure() {
 
# As a last resort, use dev-lang/gnat-gpl.
# TODO: Make gnat-gpl coinstallable with gcc:10.
-   if [[ -z ${ada_bootstrap} ]] ; then
+   if ver_test ${ada_bootstrap} -gt ${PV} || [[ -z 
${ada_bootstrap} ]] ; then
ebegin "Testing dev-lang/gnat-gpl for Ada"
if has_version -b "dev-lang/gnat-gpl" ; then
ada_bootstrap=10



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 28fd52a103787d2bffa9136cb3bf5418beeb3ea9
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 11:18:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 11:21:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28fd52a1

toolchain.eclass: don't set GDC if we couldn't find anything

This avoids wrongly/unnecessarily setting GDC for < GCC 12.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 759d871fde62..d68055f909fd 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1014,7 +1014,9 @@ toolchain_src_configure() {
eend 1
done
 
-   export GDC="${BROOT}/usr/${CTARGET}/gcc-bin/${d_bootstrap}/gdc"
+   if [[ -n ${d_bootstrap} ]] ; then
+   export 
GDC="${BROOT}/usr/${CTARGET}/gcc-bin/${d_bootstrap}/gdc"
+   fi
fi
 
confgcc+=(



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: 9bb87839a6ad66ee7c89837a546fbf2e7f69b577
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 11:17:33 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 11:21:25 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bb87839

toolchain.eclass: start with oldest GNAT and work upwards instead

Per https://gcc.gnu.org/install/prerequisites.html
"""
Similarly, it is strongly recommended to use an older version of GNAT to build 
GNAT.

More recent versions of GNAT than the version built are not guaranteed to work
and will often fail during the build with compilation errors.
"""

Bug: https://gcc.gnu.org/PR103357
Bug: https://bugs.gentoo.org/880825
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f941f08d4198..759d871fde62 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -872,8 +872,8 @@ toolchain_src_configure() {
local ada_candidate
# We always prefer the version being built if possible
# as it has the greatest chance of success. Failing that,
-   # try the latest installed GCC and iterate downwards.
-   for ada_candidate in ${SLOT} $(seq ${latest_gcc} -1 10) ; do
+   # try GCC 10 and iterate upwards.
+   for ada_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${ada_candidate}" || 
continue
 
ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-29 Thread Sam James
commit: d1aa56b6e39f07490021e594920f4a965a968c07
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 11:20:08 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 11:21:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1aa56b6

toolchain.eclass: start with oldest GDC and work upwards instead

Per https://gcc.gnu.org/install/prerequisites.html
"""
It is strongly recommended to use an older version of GDC to build GDC.

More recent versions of GDC than the version built are not guaranteed to work
and will often fail during the build with compilation errors relating to
deprecations or removed features.
"""

... so do as I just did for GNAT.

Bug: https://bugs.gentoo.org/940470
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index d68055f909fd..62ff83feed28 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1000,8 +1000,8 @@ toolchain_src_configure() {
local d_candidate
# We always prefer the version being built if possible
# as it has the greatest chance of success. Failing that,
-   # try the latest installed GCC and iterate downwards.
-   for d_candidate in ${SLOT} $(seq ${latest_gcc} -1 10) ; do
+   # try GCC 10 and iterate upwards.
+   for d_candidate in ${SLOT} $(seq 10 ${latest_gcc}) ; do
has_version -b "sys-devel/gcc:${d_candidate}" || 
continue
 
ebegin "Testing sys-devel/gcc:${d_candidate} for D"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 8b286cd2cbe5be93c91115080340157047ac05a9
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 01:11:19 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 01:11:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b286cd2

toolchain.eclass: print GDC version used

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 9c0e38519b29..15fe4dfb60bc 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1603,6 +1603,8 @@ toolchain_src_configure() {
einfo "Languages:   ${GCC_LANG}"
einfo "GCC version: $($(tc-getCC) -v 2>&1 | grep ' version ' | awk 
'{ print $3 }')"
is_ada && einfo "GNAT version:$(gnat 2>&1 | grep GNAT | awk '{ 
print $2 }')"
+   is_d && einfo "GDC version: $(${GDC} -v 2>&1 | grep ' version ' | 
awk '{ print $3 }')"
+
echo
 
# Build in a separate build tree



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 53173d7420d926eb94cf94135350b124345cfa7a
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 01:12:29 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 01:12:54 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53173d74

toolchain.eclass: use ${GNAT} for GNAT version print

It shouldn't matter as we set PATH but let's do it anyway for consistency.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 15fe4dfb60bc..f941f08d4198 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1602,7 +1602,7 @@ toolchain_src_configure() {
einfo "STDCXX_INCDIR:   ${STDCXX_INCDIR}"
einfo "Languages:   ${GCC_LANG}"
einfo "GCC version: $($(tc-getCC) -v 2>&1 | grep ' version ' | awk 
'{ print $3 }')"
-   is_ada && einfo "GNAT version:$(gnat 2>&1 | grep GNAT | awk '{ 
print $2 }')"
+   is_ada && einfo "GNAT version:$(${GNAT} 2>&1 | grep GNAT | awk '{ 
print $2 }')"
is_d && einfo "GDC version: $(${GDC} -v 2>&1 | grep ' version ' | 
awk '{ print $3 }')"
 
echo



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: b9c70336a7a58e03dc59f8f9f71397c090e657a7
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 01:06:19 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 01:06:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9c70336

toolchain.eclass: install gdc symlink too

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 30d96f25aaa8..9c0e38519b29 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -2303,7 +2303,7 @@ toolchain_src_install() {
cd "${D}"${BINPATH} || die
# Ugh: we really need to auto-detect this list.
#  It's constantly out of date.
-   for x in cpp gcc gccrs g++ c++ gcov g77 gfortran gccgo gnat* ; do
+   for x in cpp gcc gccrs g++ c++ gcov gdc g77 gfortran gccgo gnat* ; do
# For some reason, g77 gets made instead of ${CTARGET}-g77...
# this should take care of that
if [[ -f ${x} ]] ; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 3355cb0ab6d92d84eeff44163da5309d114726b3
Author: Sam James  gentoo  org>
AuthorDate: Sun Sep 29 01:04:44 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 01:04:44 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3355cb0a

toolchain.eclass: rework D handling

The recent work for Ada makes things easier here because you don't
have to try juggle both GNAT and GDC at the same time.

Anyway, let's do something similar: iterate over installed GCCs
and try to use the best GDC available for bootstrapping, so users
don't have to manually select it with `gcc-config`. More mangling
may be needed than setting GDC down the line.

Bug: https://bugs.gentoo.org/868228
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index cfddba99a1a8..30d96f25aaa8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -991,6 +991,32 @@ toolchain_src_configure() {
export CC="$(tc-getCC) -specs=${T}/ada.spec"
fi
 
+   if _tc_use_if_iuse d ; then
+   local latest_gcc=$(best_version -b "sys-devel/gcc")
+   latest_gcc="${latest_gcc#sys-devel/gcc-}"
+   latest_gcc=$(ver_cut 1 ${latest_gcc})
+
+   local d_bootstrap
+   local d_candidate
+   # We always prefer the version being built if possible
+   # as it has the greatest chance of success. Failing that,
+   # try the latest installed GCC and iterate downwards.
+   for d_candidate in ${SLOT} $(seq ${latest_gcc} -1 10) ; do
+   has_version -b "sys-devel/gcc:${d_candidate}" || 
continue
+
+   ebegin "Testing sys-devel/gcc:${d_candidate} for D"
+   if has_version -b "sys-devel/gcc:${d_candidate}[d(-)]" 
; then
+   d_bootstrap=${d_candidate}
+
+   eend 0
+   break
+   fi
+   eend 1
+   done
+
+   export GDC="${BROOT}/usr/${CTARGET}/gcc-bin/${d_bootstrap}/gdc"
+   fi
+
confgcc+=(
--prefix="${PREFIX}"
--bindir="${BINPATH}"



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 687e6b6f1b665dbc5b37f470d4984c9c34eabad3
Author: Sam James  gentoo  org>
AuthorDate: Sat Aug  3 02:10:34 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 00:18:07 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=687e6b6f

toolchain.eclass: enable libada with USE=ada

This was added in d6d640106d59381bf34fea26b80c31e1de8c9e6b but it's not
clear to me why.

Noticed because it causes loads of Ada test failures as UNRESOLVED,
failing with:
```
gnatmake: RTS path 
"/var/tmp/portage/sys-devel/gcc-15.0./work/build/x86_64-pc-linux-gnu/./libada"
 not valid: missing adainclude and adalib directories
compiler exited with status 1
```

Fixes: d6d640106d59381bf34fea26b80c31e1de8c9e6b
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 53b64a470e37..e9ee095d772e 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1309,7 +1309,7 @@ toolchain_src_configure() {
fi
 
if in_iuse ada ; then
-   confgcc+=( --disable-libada )
+   confgcc+=( $(use_enable ada libada) )
fi
 
if in_iuse cet ; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 1381eb9987c440618861c7d22df04871a235233c
Author: Sam James  gentoo  org>
AuthorDate: Sun Aug  4 01:27:16 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 00:18:08 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1381eb99

toolchain.eclass: more Ada cleanup

Breaks w/ pic linking and unnecessary. Use the regular build system route.

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 12 
 1 file changed, 12 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index e9ee095d772e..f8c290bf4a07 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1878,18 +1878,6 @@ gcc_do_make() {
pushd "${WORKDIR}"/build >/dev/null || die
emake "${emakeargs[@]}" ${GCC_MAKE_TARGET}
 
-   if is_ada; then
-   # Without these links, it is not getting the good compiler
-   # TODO: Need to check why
-   ln -s gcc ../build/prev-gcc || die
-   ln -s ${CHOST} ../build/prev-${CHOST} || die
-
-   # Building standard ada library
-   emake -C gcc gnatlib-shared
-   # Building gnat toold
-   emake -C gcc gnattools
-   fi
-
if ! is_crosscompile && _tc_use_if_iuse cxx && _tc_use_if_iuse doc ; 
then
if type -p doxygen > /dev/null ; then
cd "${CTARGET}"/libstdc++-v3/doc || die



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-28 Thread Sam James
commit: 799693623d76c89e8b04d2434d0dfece44bb49f9
Author: Sam James  gentoo  org>
AuthorDate: Sat Aug  3 02:27:51 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep 29 00:18:08 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=79969362

toolchain.eclass: Ada rework

Look hard for an existing GNAT for use for bootstrapping without requiring
users to run `gcc-config` / switch their system copy of GCC, which is both
brittle in that it requires manual intervention, and also unclean.

Started looking at this after 
https://public-inbox.gentoo.org/gentoo-dev/2a700166-f01a-4807-bd76-7b0cce72af0b 
 archeia.com/
although the approach is different. I did use it as a base although not
much of it remains.

We take the following approach:
* Iterate over installed GCC slots (preferring ${SLOT}, then iterating
  from the latest version installed down to GCC 10) to find a copy of
  GNAT;

* Create wrappers for gnat* to redirect calls when building GCC to
  our found bootstrap copy of GNAT;

* Use an extracted spec file to redirect gnat1 calls to that bootstrap
  copy too, as the build system doesn't allow saying "just use this copy
  of gnat" (it always wants $(CC) to support it).

  The real nasty part here is that GCC's build system doesn't seem to have
  a way to point to 'ADACC' or similar (it looks like it did have 'ADAC' years 
ago).

Remaining bits to be done:
* Adapting/replacing/supplementing dev-lang/gnat-gpl with a version that
  can be installed in parallel to sys-devel/gcc:10 so it can be pulled
  in transparently for bootstrapping;

* Build our own, or source some other copy (e.g. from Alire), of a newer
  bootstrap GNAT. https://github.com/alire-project/GNAT-FSF-builds is
  a likely candidate.

I also hope that we can ultimately do the same for D.

Bug: https://gcc.gnu.org/PR864
Bug: https://gcc.gnu.org/PR108909
Bug: https://bugs.gentoo.org/137268
Bug: https://bugs.gentoo.org/547358
Bug: https://bugs.gentoo.org/919667
Closes: https://bugs.gentoo.org/937774
Link: https://lists.fedorahosted.org/archives/list/epel-devel  
lists.fedoraproject.org/thread/CVQ3JIOZI5ODYDZU2DZLA37JWSLMCIN7/
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 143 +++-
 1 file changed, 141 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index f8c290bf4a07..cfddba99a1a8 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -401,8 +401,6 @@ if tc_has_feature valgrind ; then
BDEPEND+=" valgrind? ( dev-debug/valgrind )"
 fi
 
-# TODO: Add a pkg_setup & pkg_pretend check for whether the active compiler
-# supports Ada.
 if [[ ${PN} != gnat-gpl ]] && tc_has_feature ada ; then
BDEPEND+=" ada? ( || ( sys-devel/gcc[ada] dev-lang/gnat-gpl[ada] ) )"
 fi
@@ -558,6 +556,8 @@ SRC_URI=$(get_gcc_src_uri)
 
 toolchain_pkg_pretend() {
if ! _tc_use_if_iuse cxx ; then
+   _tc_use_if_iuse ada && \
+   ewarn 'Ada requires a C++ compiler, disabled due to 
USE="-cxx"'
_tc_use_if_iuse go && \
ewarn 'Go requires a C++ compiler, disabled due to 
USE="-cxx"'
_tc_use_if_iuse objc++ && \
@@ -854,6 +854,143 @@ toolchain_src_configure() {
fi
[[ -n ${CBUILD} ]] && confgcc+=( --build=${CBUILD} )
 
+   _need_ada_bootstrap_mangling() {
+   if [[ ${CATEGORY}/${PN} == dev-lang/gnat-gpl ]] ; then
+   _tc_use_if_iuse system-bootstrap && return 0
+   return 1
+   fi
+
+   _tc_use_if_iuse ada
+   }
+
+   if _need_ada_bootstrap_mangling ; then
+   local latest_gcc=$(best_version -b "sys-devel/gcc")
+   latest_gcc="${latest_gcc#sys-devel/gcc-}"
+   latest_gcc=$(ver_cut 1 ${latest_gcc})
+
+   local ada_bootstrap
+   local ada_candidate
+   # We always prefer the version being built if possible
+   # as it has the greatest chance of success. Failing that,
+   # try the latest installed GCC and iterate downwards.
+   for ada_candidate in ${SLOT} $(seq ${latest_gcc} -1 10) ; do
+   has_version -b "sys-devel/gcc:${ada_candidate}" || 
continue
+
+   ebegin "Testing sys-devel/gcc:${ada_candidate} for Ada"
+   if has_version -b 
"sys-devel/gcc:${ada_candidate}[ada(-)]" ; then
+   # Make sure we set a path to the Ada bootstrap 
if gcc[ada] is not already
+   # installed. GNAT can usually be built using 
the last major version and
+   # the current version, at least.
+   ada_bootstrap=${ada_candidate}
+
+   eend 0
+   break
+   fi
+   eend 

[gentoo-commits] repo/gentoo:master commit in: eclass/, profiles/base/, profiles/desc/

2024-09-26 Thread Patrick Lauer
commit: b906b4ed40b71a991a4f775ab8821c0595d3606f
Author: Patrick Lauer  gentoo  org>
AuthorDate: Thu Sep 26 11:43:21 2024 +
Commit: Patrick Lauer  gentoo  org>
CommitDate: Thu Sep 26 13:21:01 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b906b4ed

eclass/, profiles/: Enable PostgreSQL 17 support

Signed-off-by: Patrick Lauer  gentoo.org>

 eclass/postgres.eclass  | 2 +-
 profiles/base/use.stable.mask   | 4 
 profiles/desc/postgres_targets.desc | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index 9bf84fe13118..2c44358898e6 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -27,7 +27,7 @@ _POSTGRES_ECLASS=1
 # @DESCRIPTION:
 # List of versions to reverse sort POSTGRES_COMPAT slots
 
-_POSTGRES_ALL_VERSIONS=(  16 15 14 13 12 )
+_POSTGRES_ALL_VERSIONS=(  17 16 15 14 13 12 )
 
 
 

diff --git a/profiles/base/use.stable.mask b/profiles/base/use.stable.mask
index 93d8ee1913f9..9167592b9e10 100644
--- a/profiles/base/use.stable.mask
+++ b/profiles/base/use.stable.mask
@@ -4,6 +4,10 @@
 # This file requires eapi 5 or later. New entries go on top.
 # Please use the same syntax as in use.mask
 
+# Patrick Lauer  (2024-09-26)
+# Postgresql 17 isn't stable yet
+postgres_targets_postgres17
+
 # Sam James  (2024-09-18)
 # LLVM slots without stable keywords.
 llvm_slot_19

diff --git a/profiles/desc/postgres_targets.desc 
b/profiles/desc/postgres_targets.desc
index d40f508181cc..7e18a89e66d0 100644
--- a/profiles/desc/postgres_targets.desc
+++ b/profiles/desc/postgres_targets.desc
@@ -8,3 +8,4 @@ postgres13 - Build against PostgreSQL 13
 postgres14 - Build against PostgreSQL 14
 postgres15 - Build against PostgreSQL 15
 postgres16 - Build against PostgreSQL 16
+postgres17 - Build against PostgreSQL 17



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-25 Thread Eli Schwartz
commit: 58128e2701881192e5d551d6b1d27bac3f6cde58
Author: Eli Schwartz  gentoo  org>
AuthorDate: Wed Sep 25 17:51:52 2024 +
Commit: Eli Schwartz  gentoo  org>
CommitDate: Wed Sep 25 18:22:23 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58128e27

toolchain.eclass: ban the use of rlibtool

dev-build/slibtool provides an alternative implementation of libtool
which is intended to hook itself into and replace the ltmain.sh-based
./libtool shell scripts installed into an autotools build system.

It has some interesting quirks. In particular, it takes the idea of
"packagers don't want to install libtool archives for random libraries
because nobody uses them and pkg-config is better" and runs with it. It
runs quite far with it, as it doesn't install them at all without a new
flag passed to slibtool. This is redundant with our existing approach of
deleting them in src_install when we know they are useless, and is
downright broken in cases such as GCC, where the libtool archives are
load-bearing and the resultant compiler is, in their absence,
nonfunctional.

slibtool supports a variety of wrappers to enable reasonable
functionality which it by default disabled. The official recommendation
is you are supposed to use "rlibtool" to replace ./libtool as it
performs heuristics based on the generated config. But we actually need
"rclibtool", which both respects the generated config and also generates
the *.la archives and leaves it up to ebuilds to decide whether they
should be removed.

Raise a fatal error if the user has misconfigured slibtool. This
prevents the user from building a broken and malformed GCC.

Closes: https://bugs.gentoo.org/932245
Closes: https://bugs.gentoo.org/924150
Closes: https://bugs.gentoo.org/931268
Closes: https://bugs.gentoo.org/931279
Signed-off-by: Eli Schwartz  gentoo.org>
Reviewed-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 0557db974035..53b64a470e37 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -574,6 +574,9 @@ toolchain_pkg_setup() {
# bug #265283
unset LANGUAGES
 
+   # bug #932245
+   [[ ${LIBTOOL} = rlibtool ]] && die "\$LIBTOOL is using rlibtool from 
dev-build/slibtool. You must not use rlibtool, only rclibtool."
+
# See 
https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
# Avoid really confusing logs from subconfigure spam, makes logs far
# more legible.



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-25 Thread Sam James
commit: 439ef0b575ddeda03f92542339cff14e84b21604
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 25 11:11:26 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 25 11:11:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=439ef0b5

guile-single.eclass: fix EclassExportFuncsBeforeInherit

Bug: https://github.com/pkgcore/pkgcheck/issues/702
Bug: https://github.com/pkgcore/pkgcheck/issues/703
Signed-off-by: Sam James  gentoo.org>

 eclass/guile-single.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/guile-single.eclass b/eclass/guile-single.eclass
index 91f6036139da..66898504a6c4 100644
--- a/eclass/guile-single.eclass
+++ b/eclass/guile-single.eclass
@@ -240,6 +240,6 @@ guile-single_src_install() {
guile_unstrip_ccache
 }
 
-EXPORT_FUNCTIONS pkg_setup src_prepare src_install
-
 fi  # _GUILE_SINGLE_ECLASS
+
+EXPORT_FUNCTIONS pkg_setup src_prepare src_install



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-25 Thread Sam James
commit: 4c3f798d2394f8c4b6e7e8fc5e8cc4a35c0f8ed5
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 25 11:12:12 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 25 11:12:12 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4c3f798d

xdg.eclass: fix EclassExportFuncsBeforeInherit

Bug: https://github.com/pkgcore/pkgcheck/issues/702
Bug: https://github.com/pkgcore/pkgcheck/issues/703
Signed-off-by: Sam James  gentoo.org>

 eclass/xdg.eclass | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 6af4b91875fc..2e16a438d840 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -45,8 +45,6 @@ case ${EAPI} in
default
}
 
-   EXPORT_FUNCTIONS src_prepare
-
DEPEND="${_XDG_DEPEND}"
;;
*)
@@ -131,4 +129,12 @@ xdg_pkg_postrm() {
 
 fi
 
+case ${EAPI} in
+   6|7)
+   EXPORT_FUNCTIONS src_prepare
+   ;;
+   *)
+   ;;
+esac
+
 EXPORT_FUNCTIONS pkg_preinst pkg_postinst pkg_postrm



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-25 Thread Sam James
commit: c99c693ff970d9c5cf5204466d791b9a3d4499fa
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 25 11:12:05 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 25 11:12:05 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c99c693f

guile.eclass: fix EclassExportFuncsBeforeInherit

Bug: https://github.com/pkgcore/pkgcheck/issues/702
Bug: https://github.com/pkgcore/pkgcheck/issues/703
Signed-off-by: Sam James  gentoo.org>

 eclass/guile.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/guile.eclass b/eclass/guile.eclass
index 323d04ef1152..e8fde64266e5 100644
--- a/eclass/guile.eclass
+++ b/eclass/guile.eclass
@@ -353,7 +353,7 @@ guile_src_install() {
einstalldocs
 }
 
-EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile \
-src_install src_test
-
 fi  # _GUILE_ECLASS
+
+EXPORT_FUNCTIONS pkg_setup src_prepare src_configure src_compile \
+   src_install src_test



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-24 Thread Ulrich Müller
commit: b427795a254820cc188cad8c88d47eaf7078c7f4
Author: Ulrich Müller  gentoo  org>
AuthorDate: Mon Aug 26 12:23:35 2024 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Wed Sep 25 04:51:03 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b427795a

plasma-mobile.kde.org.eclass: Remove dead eclass

Signed-off-by: Ulrich Müller  gentoo.org>

 eclass/plasma-mobile.kde.org.eclass | 49 -
 1 file changed, 49 deletions(-)

diff --git a/eclass/plasma-mobile.kde.org.eclass 
b/eclass/plasma-mobile.kde.org.eclass
deleted file mode 100644
index 3349f90745bd..
--- a/eclass/plasma-mobile.kde.org.eclass
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 1999-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# @DEAD
-# @ECLASS: plasma-mobile.kde.org.eclass
-# @MAINTAINER:
-# k...@gentoo.org
-# @SUPPORTED_EAPIS: 8
-# @PROVIDES: kde.org
-# @BLURB: Support eclass for KDE Plasma Mobile packages.
-# @DESCRIPTION:
-# This eclass extends kde.org.eclass for Plasma Mobile release group to 
assemble
-# default SRC_URI for tarballs, set up git-r3.eclass for stable/master branch
-# versions or restrict access to unreleased (packager access only) tarballs
-# in Gentoo KDE overlay.
-#
-# This eclass unconditionally inherits kde.org.eclass and all its public
-# variables and helper functions (not phase functions) may be considered as
-# part of this eclass's API.
-
-case ${EAPI} in
-   8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
-if [[ -z ${_PLASMA_MOBILE_KDE_ORG_ECLASS} ]]; then
-_PLASMA_MOBILE_KDE_ORG_ECLASS=1
-
-# @ECLASS_VARIABLE: KDE_ORG_CATEGORY
-# @PRE_INHERIT
-# @DESCRIPTION:
-# For proper description see kde.org.eclass manpage.
-: "${KDE_ORG_CATEGORY:=plasma-mobile}"
-
-inherit kde.org
-
-HOMEPAGE="https://plasma-mobile.org/";
-
-# @ECLASS_VARIABLE: KDE_ORG_SCHEDULE_URI
-# @INTERNAL
-# @DESCRIPTION:
-# For proper description see kde.org.eclass manpage.
-KDE_ORG_SCHEDULE_URI="https://invent.kde.org/plasma/plasma-mobile/-/wikis/Release-Schedule";
-
-if [[ ${KDE_BUILD_TYPE} != live && -z ${KDE_ORG_COMMIT} ]]; then
-   SRC_URI="mirror://kde/stable/plasma-mobile/$(ver_cut 
1-2)/${KDE_ORG_NAME}-${PV}.tar.xz"
-fi
-
-fi



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-24 Thread Michał Górny
commit: d8d5d91d4f63eff646ed7cd25138a02ffec1b1b3
Author: Michał Górny  gentoo  org>
AuthorDate: Wed Sep 25 04:18:51 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Sep 25 04:39:05 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8d5d91d

distutils-r1.eclass: Revert "Switch scikit-build-core to build.verbose"

This change broke all packages using a lower minimum-version.  Sigh.

Reverts: 0be38fc6bebba7f193d243a35915f6d393319fd3
Signed-off-by: Michał Górny  gentoo.org>

 eclass/distutils-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 53b40163c216..5a6ebdcede8a 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1339,9 +1339,9 @@ distutils_pep517_install() {
ninjaopts = 
shlex.split(os.environ["NINJAOPTS"])
print(json.dumps({
"build.tool-args": ninjaopts,
-   "build.verbose": True,
"cmake.args": 
";".join(sys.argv[1:]),
"cmake.build-type": 
"${CMAKE_BUILD_TYPE}",
+   "cmake.verbose": True,
"install.strip": False,
}))
EOF



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-24 Thread Michał Górny
commit: e9d99a93456b6dc99cdefe280506a2384a6ef031
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 24 17:36:02 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 24 18:02:40 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9d99a93

llvm.org.eclass: Remove old snapshots

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 6 --
 1 file changed, 6 deletions(-)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 5b58209b70ce..2338c3f2cc53 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -78,12 +78,6 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
20.0.0_pre20240917)

EGIT_COMMIT=41f1b467a29d2ca4e35df37c3aa79a0a8c04bc4f
;;
-   20.0.0_pre20240910)
-   
EGIT_COMMIT=bece0d7517bd0a036dc8a319514e4a8a5c497dee
-   ;;
-   20.0.0_pre20240830)
-   
EGIT_COMMIT=5500e21942f7047344b6fee62d3e08c0ba2f9182
-   ;;
*)
die "Unknown snapshot: ${PV}"
;;



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-24 Thread Michał Górny
commit: af6c5d43495b66c3d450f9b9072d653a222fd5ad
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 24 17:35:44 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 24 18:02:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af6c5d43

llvm.org.eclass: Add 20.0.0_pre20240924 snapshot

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 3050fd1e471e..5b58209b70ce 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -72,6 +72,9 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
_LLVM_SOURCE_TYPE=snapshot
 
case ${PV} in
+   20.0.0_pre20240924)
+   
EGIT_COMMIT=cde7b30268a85a3e7900a31534a97e7eb4de9236
+   ;;
20.0.0_pre20240917)

EGIT_COMMIT=41f1b467a29d2ca4e35df37c3aa79a0a8c04bc4f
;;



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-24 Thread Sam James
commit: 5ff4a902b3706209c6fe148d9e3c621f6cc53ba4
Author: YiFei Zhu  gmail  com>
AuthorDate: Fri Sep 13 04:38:04 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Sep 24 11:51:20 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ff4a902

autotools.eclass: Run eautoheader with --force

To quote Eli [1] (I can't explain it better than this):

  autotools.eclass runs autoheader without options (and in
  particular without --force). This will only remake config.h.in
  if there are actual changes to the content, which in turn means
  that it will be out of date compared to aclocal.m4 (which we very
  much expect to have changes).

  So `make` sees that the header is out of date, and runs autoheader
  yet again, this time updating the timestamp for `make` purposes.

This causes QA warning that "maintainer mode" is detected.

autoheader and autoconf added --force option at the same time [2],
so no reason only autoconf has that option in the eclass and not
autoheader.

Like, autoconf, a check on WANT_AUTOCONF != 2.1 is added because the
feature was added in autoconf 2.52.

[1] https://bugs.gentoo.org/939468#c6
[2] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=dbf7fc61

Closes: https://bugs.gentoo.org/939468
Closes: https://bugs.gentoo.org/939535
Signed-off-by: YiFei Zhu  gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38588
Signed-off-by: Sam James  gentoo.org>

 eclass/autotools.eclass | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 0571b18ba525..641612f37193 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -312,7 +312,13 @@ eautoreconf() {
else
eautoconf --force
fi
-   [[ ${AT_NOEAUTOHEADER} != "yes" ]] && eautoheader
+   if [[ ${AT_NOEAUTOHEADER} != "yes" ]] ; then
+   if [[ ${WANT_AUTOCONF} == "2.1" ]] ; then
+   eautoheader
+   else
+   eautoheader --force
+   fi
+   fi
[[ ${AT_NOEAUTOMAKE} != "yes" ]] && FROM_EAUTORECONF="yes" eautomake 
${AM_OPTS}
 
if [[ ${AT_NOELIBTOOLIZE} != "yes" ]] ; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-23 Thread Michał Górny
commit: 0be38fc6bebba7f193d243a35915f6d393319fd3
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 24 06:12:34 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 24 06:41:39 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0be38fc6

distutils-r1.eclasS: Switch scikit-build-core to build.verbose

Replace `cmake.verbose` with `build.verbose`, following the change
in scikit-build-core 0.10.

Signed-off-by: Michał Górny  gentoo.org>

 eclass/distutils-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5a6ebdcede8a..53b40163c216 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1339,9 +1339,9 @@ distutils_pep517_install() {
ninjaopts = 
shlex.split(os.environ["NINJAOPTS"])
print(json.dumps({
"build.tool-args": ninjaopts,
+   "build.verbose": True,
"cmake.args": 
";".join(sys.argv[1:]),
"cmake.build-type": 
"${CMAKE_BUILD_TYPE}",
-   "cmake.verbose": True,
"install.strip": False,
}))
EOF



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-23 Thread Michał Górny
commit: f0877c745f598b59edcb3e9b5395259f16df8611
Author: Michał Górny  gentoo  org>
AuthorDate: Mon Sep 23 14:41:17 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Mon Sep 23 15:11:41 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0877c74

llvm.org.eclass: Enable prebuilt manpages for 19

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 7f7edd6fb652..3050fd1e471e 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -300,6 +300,9 @@ llvm.org_set_globals() {
18*)

LLVM_MANPAGE_DIST="llvm-18.1.0-manpages.tar.bz2"
;;
+   19*)
+   
LLVM_MANPAGE_DIST="llvm-19.1.0-manpages.tar.bz2"
+   ;;
esac
fi
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-23 Thread Ulrich Müller
commit: 452c39b1b97dd8e472c381c90814ca7151bbd80d
Author: Ulrich Müller  gentoo  org>
AuthorDate: Mon Sep  2 15:18:17 2024 +
Commit: Ulrich Müller  gentoo  org>
CommitDate: Mon Sep 23 12:05:36 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=452c39b1

elisp.eclass: Add pkg_info

Sync from Emacs overlay.

Signed-off-by: Ulrich Müller  gentoo.org>

 eclass/elisp.eclass | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
index 20139491c976..1fa8aab29753 100644
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -1,4 +1,4 @@
-# Copyright 2002-2023 Gentoo Authors
+# Copyright 2002-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: elisp.eclass
@@ -205,5 +205,11 @@ elisp_pkg_postrm() {
elisp-site-regen
 }
 
+elisp_pkg_info() {
+   if [[ -n ${_ELISP_EMACS_VERSION} ]]; then
+   echo "Built with Emacs version: ${_ELISP_EMACS_VERSION}"
+   fi
+}
+
 EXPORT_FUNCTIONS src_{unpack,prepare,configure,compile,test,install} \
-   pkg_{setup,postinst,postrm}
+   pkg_{setup,postinst,postrm,info}



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-19 Thread Sam James
commit: d56d8f8e35fa4f7b8d65dbd6cd535ad6ac69cc9c
Author: Sam James  gentoo  org>
AuthorDate: Thu Sep 19 22:55:44 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 19 22:57:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d56d8f8e

toolchain.eclass: disable automagic CET for x86

It's not supported on 32-bit kernels anyway.

This got lost in b6bf005b843e3d6ee10aa1f088d93c4f89055cc6 when wiring
up arm64.

Bug: https://bugs.gentoo.org/916381
Closes: https://bugs.gentoo.org/939874
Fixes: b6bf005b843e3d6ee10aa1f088d93c4f89055cc6
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index a545f730ada7..0557db974035 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1310,7 +1310,9 @@ toolchain_src_configure() {
fi
 
if in_iuse cet ; then
-   [[ ${CTARGET} == x86_64-*-gnu* ]] && confgcc+=( $(use_enable 
cet) )
+   if [[ ${CTARGET} == i[[34567]]86-*-linux* || ${CTARGET} == 
x86_64-*-gnu* ]] ; then
+   confgcc+=( $(use_enable cet) )
+   fi
[[ ${CTARGET} == aarch64-*-gnu* ]] && confgcc+=( $(use_enable 
cet standard-branch-protection) )
fi
 



[gentoo-commits] repo/gentoo:master commit in: eclass/tests/

2024-09-18 Thread Sam James
commit: 0e3fcf7b631e7afe04af8ac80bae2759d222d2de
Author: Sam James  gentoo  org>
AuthorDate: Thu Sep 19 04:12:46 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 19 04:13:46 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e3fcf7b

eclass/tests: fix toolchain.sh tests by dropping old GCC support

eb49d171430cc2baffbf9d37493a78cc02b33fe2 dropped old GCC support but
the tests weren't updated.

Closes: https://bugs.gentoo.org/939817
Fixes: eb49d171430cc2baffbf9d37493a78cc02b33fe2
Signed-off-by: Sam James  gentoo.org>

 eclass/tests/toolchain.sh | 17 -
 1 file changed, 17 deletions(-)

diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 6f8df5b4fc4a..1ba2e6b1f29d 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -49,10 +49,6 @@ test_downgrade_arch_flags 4.5 "-march=core2"  
"-march=haswell"
 test_downgrade_arch_flags 4.4 "-march=core2"  "-march=haswell"
 test_downgrade_arch_flags 4.3 "-march=core2"  "-march=haswell"
 test_downgrade_arch_flags 4.2 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 4.1 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 4.0 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 3.4 "-march=nocona" "-march=haswell"
-test_downgrade_arch_flags 3.3 "-march=nocona" "-march=haswell"
 
 test_downgrade_arch_flags 4.9 "-march=bdver4" "-march=bdver4"
 test_downgrade_arch_flags 4.8 "-march=bdver3" "-march=bdver4"
@@ -62,31 +58,18 @@ test_downgrade_arch_flags 4.5 "-march=amdfam10"   
"-march=bdver4"
 test_downgrade_arch_flags 4.4 "-march=amdfam10"   "-march=bdver4"
 test_downgrade_arch_flags 4.3 "-march=amdfam10"   "-march=bdver4"
 test_downgrade_arch_flags 4.2 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 4.1 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 4.0 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 3.4 "-march=k8" "-march=bdver4"
-test_downgrade_arch_flags 3.3 "-march=x86-64" "-march=bdver4"
-
-test_downgrade_arch_flags 3.4 "-march=c3-2"   "-march=c3-2"
-test_downgrade_arch_flags 3.3 "-march=c3" "-march=c3-2"
 
 test_downgrade_arch_flags 4.5 "-march=garbage""-march=garbage"
 
 test_downgrade_arch_flags 10  "-mtune=intel"  "-mtune=intel"
 test_downgrade_arch_flags 4.9 "-mtune=intel"  "-mtune=intel"
 test_downgrade_arch_flags 4.8 "-mtune=generic""-mtune=intel"
-test_downgrade_arch_flags 3.4 ""  "-mtune=generic"
-test_downgrade_arch_flags 3.4 ""  "-mtune=x86-64"
-test_downgrade_arch_flags 3.3 ""  "-mtune=anything"
 
 test_downgrade_arch_flags 4.5 "-march=amdfam10 -mtune=generic" "-march=btver2 
-mtune=generic"
-test_downgrade_arch_flags 3.3 "-march=k6-2"   "-march=geode 
-mtune=barcelona"
-test_downgrade_arch_flags 3.4 "-march=k8" "-march=btver2 
-mtune=generic"
 
 test_downgrade_arch_flags 10  "-march=native" "-march=native"
 test_downgrade_arch_flags 8   "-march=znver1" "-march=znver2"
 test_downgrade_arch_flags 4.2 "-march=native" "-march=native"
-test_downgrade_arch_flags 4.1 "-march=nocona" "-march=native"
 test_downgrade_arch_flags 9   "-march=znver2" "-march=znver3"
 
 test_downgrade_arch_flags 10  "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx 
-mno-sse4.1" "-march=foo -mno-sha -mno-rtm -mno-avx2 -mno-avx -mno-sse4.1"



[gentoo-commits] repo/gentoo:master commit in: eclass/tests/

2024-09-18 Thread Sam James
commit: 3f3bfeac6adc6b4e9db50b1204c1a398523c55b1
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 18 15:49:34 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 18 15:49:34 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f3bfeac

Revert "eclass/tests/toolchain.sh: declare PYTHON_COMPAT"

This reverts commit 992fc2954c2281285bc50156ba12d310a1b434e1.

This should no longer be necessary now that tests are opt-in
with TOOLCHAIN_HAS_TESTS.

Bug: https://bugs.gentoo.org/859157
Signed-off-by: Sam James  gentoo.org>

 eclass/tests/toolchain.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 2e48c3443493..6f8df5b4fc4a 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -11,8 +11,6 @@ PR=r0
 source tests-common.sh || exit
 source version-funcs.sh || exit
 
-PYTHON_COMPAT=( python3_{10..13} )
-
 EAPI=7 inherit toolchain
 
 # Ignore actually running version of gcc and fake new version



[gentoo-commits] repo/gentoo:master commit in: eclass/tests/

2024-09-18 Thread Sam James
commit: 992fc2954c2281285bc50156ba12d310a1b434e1
Author: Petr Vaněk  gentoo  org>
AuthorDate: Wed Sep 18 11:30:12 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 18 15:49:09 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=992fc295

eclass/tests/toolchain.sh: declare PYTHON_COMPAT

toolchain.sh test script requires PYTHON_COMPAT array since commit
1d93a491096f ("toolchain.eclass: rework tests more") otherwise it dies
with

 die: PYTHON_COMPAT not declared.

error.

Bug: https://bugs.gentoo.org/859157
Signed-off-by: Petr Vaněk  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 eclass/tests/toolchain.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eclass/tests/toolchain.sh b/eclass/tests/toolchain.sh
index 6f8df5b4fc4a..2e48c3443493 100755
--- a/eclass/tests/toolchain.sh
+++ b/eclass/tests/toolchain.sh
@@ -11,6 +11,8 @@ PR=r0
 source tests-common.sh || exit
 source version-funcs.sh || exit
 
+PYTHON_COMPAT=( python3_{10..13} )
+
 EAPI=7 inherit toolchain
 
 # Ignore actually running version of gcc and fake new version



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-18 Thread Sam James
commit: e9971cf188e6578ebdd68af6785a59ab5615abbf
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 18 15:42:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 18 15:49:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9971cf1

toolchain.eclass: make tests opt-in per-ebuild

In 1d93a491096f1cc0234fcf44458bfec142c213bb, we kind of introduced a
timebomb to all GCC ebuilds.

Switch to making it opt-in by setting TOOLCHAIN_HAS_TESTS in ebuilds
which want to use validate_failures.py. It hasn't been tested and may
not even work with gnat-gpl and kgcc64 so it doesn't make sense
to have it by default, especially for gnat-gpl which is now just
a bootstrap package anyway.

Bug: https://bugs.gentoo.org/934124
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 22 --
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index c03312be43ad..a545f730ada7 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -22,7 +22,9 @@ _TOOLCHAIN_ECLASS=1
 DESCRIPTION="The GNU Compiler Collection"
 HOMEPAGE="https://gcc.gnu.org/";
 
-inherit edo flag-o-matic gnuconfig libtool multilib pax-utils python-any-r1 
toolchain-funcs prefix
+inherit edo flag-o-matic gnuconfig libtool multilib pax-utils toolchain-funcs 
prefix
+
+[[ -n ${TOOLCHAIN_HAS_TESTS} ]] && inherit python-any-r1
 
 tc_is_live() {
[[ ${PV} == ** ]]
@@ -143,6 +145,12 @@ tc_version_is_between() {
 # @DESCRIPTION:
 # Indicate the developer who hosts the patchset for an ebuild.
 
+# @ECLASS_VARIABLE: TOOLCHAIN_HAS_TESTS
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Controls whether python-any-r1 is inherited and validate_failures.py
+# is used.
+
 # @ECLASS_VARIABLE: GCC_PV
 # @INTERNAL
 # @DESCRIPTION:
@@ -273,6 +281,7 @@ 
STDCXX_INCDIR=${TOOLCHAIN_STDCXX_INCDIR:-${LIBPATH}/include/g++-v${GCC_BRANCH_VE
 LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ 
gcc-runtime-library-exception-3.1 ) FDL-1.3+"
 IUSE="test vanilla +nls"
 RESTRICT="!test? ( test )"
+[[ -z ${TOOLCHAIN_HAS_TESTS} ]] && RESTRICT+=" test"
 
 TC_FEATURES=()
 
@@ -537,7 +546,8 @@ get_gcc_src_uri() {
[[ -n ${MUSL_VER} ]] && \
GCC_SRC_URI+=" $(gentoo_urls 
gcc-${MUSL_GCC_VER}-musl-patches-${MUSL_VER}.tar.${TOOLCHAIN_PATCH_SUFFIX})"
 
-   GCC_SRC_URI+=" test? ( 
https://gitweb.gentoo.org/proj/gcc-patches.git/plain/scripts/testsuite-management/validate_failures.py?id=${GCC_VALIDATE_FAILURES_VERSION}
 -> gcc-validate-failures-${GCC_VALIDATE_FAILURES_VERSION}.py )"
+   [[ -n ${TOOLCHAIN_HAS_TESTS} ]] && \
+   GCC_SRC_URI+=" test? ( 
https://gitweb.gentoo.org/proj/gcc-patches.git/plain/scripts/testsuite-management/validate_failures.py?id=${GCC_VALIDATE_FAILURES_VERSION}
 -> gcc-validate-failures-${GCC_VALIDATE_FAILURES_VERSION}.py )"
 
echo "${GCC_SRC_URI}"
 }
@@ -569,7 +579,7 @@ toolchain_pkg_setup() {
# more legible.
MAKEOPTS="--output-sync=line ${MAKEOPTS}"
 
-   use test && python-any-r1_pkg_setup
+   [[ -n ${TOOLCHAIN_HAS_TESTS} ]] && use test && python-any-r1_pkg_setup
 }
 
 #>> src_unpack <<
@@ -633,7 +643,7 @@ toolchain_src_prepare() {
tc_enable_hardened_gcc
fi
 
-   if use test ; then
+   if [[ -n ${TOOLCHAIN_HAS_TESTS} ]] && use test ; then
cp 
"${DISTDIR}"/gcc-validate-failures-${GCC_VALIDATE_FAILURES_VERSION}.py 
"${T}"/validate_failures.py || die
chmod +x "${T}"/validate_failures.py || die
fi
@@ -2275,7 +2285,7 @@ toolchain_src_install() {
pax-mark -r "${ED}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1"
pax-mark -r "${ED}/libexec/gcc/${CTARGET}/${GCC_CONFIG_VER}/cc1plus"
 
-   if use test ; then
+   if [[ -n ${TOOLCHAIN_HAS_TESTS} ]] && use test ; then
mkdir "${T}"/test-results || die
cd "${WORKDIR}"/build || die
find . -name \*.sum -exec cp --parents -v {} 
"${T}"/test-results \; || die
@@ -2434,7 +2444,7 @@ create_revdep_rebuild_entry() {
 #>> pkg_pre* <<
 
 toolchain_pkg_preinst() {
-   if [[ ${MERGE_TYPE} != binary ]] && use test ; then
+   if [[ -n ${TOOLCHAIN_HAS_TESTS} && ${MERGE_TYPE} != binary ]] && use 
test ; then
# Install as orphaned to allow comparison across more versions 
even
# after unmerged. Also useful for historical records and 
tracking
# down regressions a while after they first appeared, but were 
only



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-17 Thread Michał Górny
commit: 2b795499a41a01b1c06190d4f537693c01d43c04
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 17 09:56:36 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 17 12:12:46 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b795499

llvm.org.eclass: Add 20.0.0_pre20240917 snapshot

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index f8953ec11826..7f7edd6fb652 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -72,6 +72,9 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
_LLVM_SOURCE_TYPE=snapshot
 
case ${PV} in
+   20.0.0_pre20240917)
+   
EGIT_COMMIT=41f1b467a29d2ca4e35df37c3aa79a0a8c04bc4f
+   ;;
20.0.0_pre20240910)

EGIT_COMMIT=bece0d7517bd0a036dc8a319514e4a8a5c497dee
;;



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-17 Thread Andrew Ammerlaan
commit: d50ed41dd6702054d5c8fd7ae86722e9c410f84c
Author: Andrew Ammerlaan  gentoo  org>
AuthorDate: Tue Sep 17 10:45:55 2024 +
Commit: Andrew Ammerlaan  gentoo  org>
CommitDate: Tue Sep 17 11:51:22 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d50ed41d

kernel-install.eclass: fix gentoo-kernel-bin with llvm-objcopy

We ship the kernel in gentoo-kernel-bin in the form of an UKI, using
objcopy we extract from this the kernel image (and if desired the
generic initramfs).

However, llvm-objcopy does not properly handle the -O argument and as a
result the extracted kernel image is of the same file type as the UKI
(i.e. a PE32+ executable) instead of a regular kernel image. This causes
issues in bootloader such as grub which differentiate between loading
a normal kernel image and loading an EFI executable (such as an UKI).
And also causes the signature verification to fail since the kernel
image is bigger then it should be due to the additional headers.

Using the --dump-section argument instead resolves this problem.

See-also: https://github.com/llvm/llvm-project/issues/108946
Signed-off-by: Andrew Ammerlaan  gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/38643
Signed-off-by: Andrew Ammerlaan  gentoo.org>

 eclass/kernel-install.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/kernel-install.eclass b/eclass/kernel-install.eclass
index 930640188c26..dc337c7862fd 100644
--- a/eclass/kernel-install.eclass
+++ b/eclass/kernel-install.eclass
@@ -650,7 +650,7 @@ kernel-install_extract_from_uki() {
local uki=${2}
local out=${3}
 
-   $(tc-getOBJCOPY) -O binary "-j.${extract_type}" "${uki}" "${out}" ||
+   $(tc-getOBJCOPY) "${uki}" --dump-section ".${extract_type}=${out}" ||
die "Failed to extract ${extract_type}"
chmod 644 "${out}" || die
 }



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-12 Thread Sam James
commit: 1aa40c5365c0333421d0187a2d9896e910662159
Author: Sam James  gentoo  org>
AuthorDate: Thu Sep 12 22:05:41 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep 12 22:08:10 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1aa40c53

mozcoreconf-v6.eclass: drop ia64 support

For toolchain eclasses we usually keep generic stuff like this
for e.g. cross but there's no benefit to leaving it in non-toolchain
eclasses like this.

Signed-off-by: Sam James  gentoo.org>

 eclass/mozcoreconf-v6.eclass | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/eclass/mozcoreconf-v6.eclass b/eclass/mozcoreconf-v6.eclass
index 71dbc6802d71..e7cf85fca24a 100644
--- a/eclass/mozcoreconf-v6.eclass
+++ b/eclass/mozcoreconf-v6.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: mozcoreconf-v6.eclass
@@ -157,7 +157,7 @@ mozconfig_init() {
mozconfig_annotate "less than -O2 causes a segfault on x86" 
--enable-optimize=-O2
elif [[ ${ARCH} == arm ]] && [[ $(gcc-major-version) -ge 6 ]]; then
mozconfig_annotate "less than -O2 causes a breakage on arm with 
gcc-6" --enable-optimize=-O2
-   elif use custom-optimization || [[ ${ARCH} =~ (alpha|ia64) ]]; then
+   elif use custom-optimization || [[ ${ARCH} == alpha ]]; then
# Set optimization level based on CFLAGS
if is-flag -O0; then
mozconfig_annotate "from CFLAGS" --enable-optimize=-O0
@@ -204,10 +204,6 @@ mozconfig_init() {
# operation
append-flags -fPIC -mieee
;;
-   ia64)
-   # Historically we have needed to add this manually for 64-bit
-   append-flags -fPIC
-   ;;
esac
 
# We need to append flags for gcc-6 support



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-11 Thread Sam James
commit: d99053c9327d72eb0e13de964b0b79355caebc5b
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep 11 22:17:22 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Sep 11 22:20:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d99053c9

toolchain.eclass: depend on sys-devel/binutils:*

GCC doesn't build in Gentoo at least without GNU Binutils. It is possible
but it requires some work. It's not clear to me if some of that work
needs to happen in LLVM upstream too (see below).

In commits 7011340a0f13dcada6f3be48054957035bc6e01a and
a7c27596827072f586dc07e6d53531ecb2c7cd6e, I tried to get things building
with Clang's assembler but didn't get it over the line. I think I remember
Arfrever and I coming up with a few later drafts (?) on IRC in #gentoo-hardened
but I didn't commit any of it as it didn't work in the end anyway.

But see https://briancallahan.net/blog/20240122.html which tackles at least
one of the issues I ended up hitting before.

In any case, add the dependency for now to keep things working.

Closes: https://bugs.gentoo.org/936271
Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ac236f3127f9..c03312be43ad 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -353,6 +353,7 @@ fi
 
 BDEPEND="
app-alternatives/yacc
+   sys-devel/binutils:*
>=sys-devel/flex-2.5.4
nls? ( sys-devel/gettext )
test? (



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-10 Thread Miroslav Šulc
commit: b4de2efc298df6cee8c443bb5a1b6ae999a19592
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Tue Sep 10 07:59:21 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Tue Sep 10 19:11:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4de2efc

java-utils-2.eclass: remove unused eclass fuction use_doc

Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/38544
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-utils-2.eclass | 24 
 1 file changed, 24 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 481c9b7df081..43d9b749ba3d 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -2254,30 +2254,6 @@ java-pkg_force-compiler() {
JAVA_PKG_FORCE_COMPILER="$@"
 }
 
-# @FUNCTION: use_doc
-# @DEPRECATED: none
-# @DESCRIPTION:
-#
-# Helper function for getting ant to build javadocs. If the user has USE=doc,
-# then 'javadoc' or the argument are returned. Otherwise, there is no return.
-#
-# The output of this should be passed to ant.
-# @CODE
-# Parameters:
-# $@ - Option value to return. Defaults to 'javadoc'
-#
-# Examples:
-# build javadocs by calling 'javadoc' target
-#  eant $(use_doc)
-#
-# build javadocs by calling 'apidoc' target
-#  eant $(use_doc apidoc)
-# @CODE
-# @RETURN string - Name of the target to create javadocs
-use_doc() {
-   use doc && echo ${@:-javadoc}
-}
-
 
 # @FUNCTION: java-pkg_init
 # @INTERNAL



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-10 Thread Michał Górny
commit: 76e7b39353e5e726f4ecebf2e723f4dc071b94e9
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 10 11:45:08 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 10 12:58:41 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76e7b393

llvm.org.eclass: Add 20.0.0_pre20240910 snapshot

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index fe805382115b..f8953ec11826 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -72,6 +72,9 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
_LLVM_SOURCE_TYPE=snapshot
 
case ${PV} in
+   20.0.0_pre20240910)
+   
EGIT_COMMIT=bece0d7517bd0a036dc8a319514e4a8a5c497dee
+   ;;
20.0.0_pre20240830)

EGIT_COMMIT=5500e21942f7047344b6fee62d3e08c0ba2f9182
;;



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-10 Thread Michał Górny
commit: f362cfe39056fe0277b71b045d0a753fdaad82b7
Author: Michał Górny  gentoo  org>
AuthorDate: Tue Sep 10 07:12:27 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Sep 10 08:54:21 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f362cfe3

llvm.org.eclass: Remove old snapshot list

Signed-off-by: Michał Górny  gentoo.org>

 eclass/llvm.org.eclass | 12 
 1 file changed, 12 deletions(-)

diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index da943081b9bf..fe805382115b 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -75,18 +75,6 @@ if [[ -z ${_LLVM_SOURCE_TYPE+1} ]]; then
20.0.0_pre20240830)

EGIT_COMMIT=5500e21942f7047344b6fee62d3e08c0ba2f9182
;;
-   20.0.0_pre20240822)
-   
EGIT_COMMIT=503907dc505db1e439e7061113bf84dd105f2e35
-   ;;
-   20.0.0_pre20240815)
-   
EGIT_COMMIT=db8ef6188cbbe2125e6d60bdef77a535105772df
-   ;;
-   20.0.0_pre20240808)
-   
EGIT_COMMIT=fd7d7882e7fa5a38d4bfde426120d4663718beb4
-   ;;
-   20.0.0_pre20240801)
-   
EGIT_COMMIT=130c135689ec12ab78c53645808524a8d28f7cae
-   ;;
*)
die "Unknown snapshot: ${PV}"
;;



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-09 Thread Miroslav Šulc
commit: d9c0273228e50613d354bdf6bf5a91caa8eb919f
Author: Volkmar W. Pogatzki  pogatzki  net>
AuthorDate: Mon Sep  9 08:21:19 2024 +
Commit: Miroslav Šulc  gentoo  org>
CommitDate: Tue Sep 10 06:40:42 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9c02732

java-utils-2.eclass: mark function use_doc as deprecated

Signed-off-by: Volkmar W. Pogatzki  pogatzki.net>
Closes: https://github.com/gentoo/gentoo/pull/37338
Signed-off-by: Miroslav Šulc  gentoo.org>

 eclass/java-utils-2.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 6bf6b7788aa5..481c9b7df081 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -2255,6 +2255,7 @@ java-pkg_force-compiler() {
 }
 
 # @FUNCTION: use_doc
+# @DEPRECATED: none
 # @DESCRIPTION:
 #
 # Helper function for getting ant to build javadocs. If the user has USE=doc,



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-09 Thread Sam James
commit: e2c865d8b5507755d6ad9c63e3b4b8ccbb5d6cd7
Author: Sv. Lockal  gmail  com>
AuthorDate: Tue Jul 30 23:14:55 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Sep  9 18:15:10 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2c865d8

rocm.eclass: add rocm_use_hipcc function and update example accordingly

Bug: https://bugs.gentoo.org/936099
Signed-off-by: Sv. Lockal  gmail.com>
Signed-off-by: Sam James  gentoo.org>

 eclass/rocm.eclass | 40 ++--
 1 file changed, 34 insertions(+), 6 deletions(-)

diff --git a/eclass/rocm.eclass b/eclass/rocm.eclass
index 7039455dec6b..cf501d5a8861 100644
--- a/eclass/rocm.eclass
+++ b/eclass/rocm.eclass
@@ -15,9 +15,13 @@
 # edit USE flag to control which GPU architecture to compile. Using
 # ${ROCM_USEDEP} can ensure coherence among dependencies. Ebuilds can call the
 # function get_amdgpu_flag to translate activated target to GPU compile flags,
-# passing it to configuration. Function check_amdgpu can help ebuild ensure
+# passing it to configuration. Function rocm_use_hipcc switches active compiler
+# to hipcc and cleans incompatible flags (useful for users with gcc-only flags
+# in /etc/portage/make.conf). Function check_amdgpu can help ebuild ensure
 # read and write permissions to GPU device in src_test phase, throwing friendly
-# error message if unavailable.
+# error message if unavailable. However src_configure in general should not
+# access any AMDGPU devices. If it does, it usually means that CMakeLists.txt
+# ignores AMDGPU_TARGETS in favor of autodetected GPU, which is not desired.
 #
 # @EXAMPLE:
 # Example ebuild for ROCm library in https://github.com/ROCmSoftwarePlatform
@@ -39,14 +43,12 @@
 # "
 #
 # src_configure() {
-# # avoid sandbox violation
-# addpredict /dev/kfd
-# addpredict /dev/dri/
+# rocm_use_hipcc
 # local mycmakeargs=(
 # -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
 # -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
 # )
-# CXX=hipcc cmake_src_configure
+# cmake_src_configure
 # }
 #
 # src_test() {
@@ -90,6 +92,8 @@ esac
 if [[ ! ${_ROCM_ECLASS} ]]; then
 _ROCM_ECLASS=1
 
+inherit flag-o-matic
+
 # @ECLASS_VARIABLE: ROCM_VERSION
 # @REQUIRED
 # @PRE_INHERIT
@@ -231,3 +235,27 @@ check_amdgpu() {
 }
 
 fi
+
+# @FUNCTION: rocm_use_hipcc
+# @USAGE: rocm_use_hipcc
+# @DESCRIPTION:
+# switch active C and C++ compilers to hipcc, clean unsupported flags and 
setup ROCM_TARGET_LST file.
+rocm_use_hipcc() {
+   # During the configuration stage, CMake tests whether the compiler is 
able to compile a simple program.
+   # Since CMake checker does not specify --offload-arch=, hipcc 
enumerates devices using four methods
+   # until it finds at least one device. Last way is by accessing them 
(via rocminfo).
+   # To prevent potential sandbox violations, we set the ROCM_TARGET_LST 
variable (which is checked first).
+   local target_lst="${T}"/gentoo_rocm_target.lst
+   if [[ "${AMDGPU_TARGETS[@]}" = "" ]]; then
+   # Expected no GPU code; still need to calm down sandbox
+   echo "gfx000" > "${target_lst}" || die
+   else
+   printf "%s\n" ${AMDGPU_TARGETS[@]} > "${target_lst}" || die
+   fi
+   export ROCM_TARGET_LST="${target_lst}"
+
+   # Export updated CC and CXX. Note that CC is needed even if no C code 
used,
+   # as CMake checks that C compiler can compile a simple test program.
+   export CC=hipcc CXX=hipcc
+   strip-unsupported-flags
+}



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 47d7fb1a65af001085f973704dfeed320111ab6b
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:39:15 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:28 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47d7fb1a

xdg-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/xdg-utils.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 34535a129e33..84f88eee18fc 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2023 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg-utils.eclass
@@ -18,7 +18,11 @@
 #  * XDG mime information database management
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 001d4ff8cf4b01897276841e706a78eeb119a4c5
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:46 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:23 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=001d4ff8

udev.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/udev.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/udev.eclass b/eclass/udev.eclass
index ac94f98221aa..7fd99cbba8b0 100644
--- a/eclass/udev.eclass
+++ b/eclass/udev.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: udev.eclass
@@ -36,14 +36,18 @@
 # }
 # @CODE
 
+if [[ -z ${_UDEV_ECLASS} ]]; then
+_UDEV_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_UDEV_ECLASS} ]]; then
-_UDEV_ECLASS=1
-
 inherit toolchain-funcs
 
 if [[ ${EAPI} == [56] ]]; then



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 1177526dad936922685cd77c0bd05474a8407462
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:39:01 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:25 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1177526d

vim-spell.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/vim-spell.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index 607771ae8035..57bcb0dc8021 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -62,14 +62,18 @@
 # spell files. It's best to let upstream know if you've generated spell files
 # for another language rather than keeping them Gentoo-specific.
 
+if [[ -z ${_VIM_SPELL_ECLASS} ]] ; then
+_VIM_SPELL_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIM_SPELL_ECLASS} ]] ; then
-_VIM_SPELL_ECLASS=1
-
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 SLOT="0"
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 93c765a9b349be736f86cb6ca823d8cf6220a335
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:39:09 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:27 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93c765a9

wrapper.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/wrapper.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass
index 8d3d273d81c6..a62bb51d0fe7 100644
--- a/eclass/wrapper.eclass
+++ b/eclass/wrapper.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: wrapper.eclass
@@ -7,15 +7,19 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: create a shell wrapper script
 
+if [[ -z ${_WRAPPER_ECLASS} ]]; then
+_WRAPPER_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_WRAPPER_ECLASS} ]]; then
-_WRAPPER_ECLASS=1
-
-# @FUNCTION: make_wrapper
+# FUNCTION: make_wrapper
 # @USAGE:   [chdir] [libpaths] [installpath]
 # @DESCRIPTION:
 # Create a shell wrapper script named wrapper in installpath



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 08cb1492fe62e8f15aa0d546db59ba27ec7a5ab3
Author: James Le Cuirot  gentoo  org>
AuthorDate: Sat Aug 31 13:18:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:29 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08cb1492

distutils-r1.eclass: Don't run cargo_env unless cargo_gen_config has run

Normally, failing to run cargo_gen_config results in an error, but that
is unhelpful for ebuilds with optional Cargo support.

Closes: https://bugs.gentoo.org/938764
Signed-off-by: James Le Cuirot  gentoo.org>
Signed-off-by: Michał Górny  gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/38041
Signed-off-by: Sam James  gentoo.org>

 eclass/distutils-r1.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 39705c5c3c84..5a6ebdcede8a 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1253,7 +1253,9 @@ distutils_pep517_install() {
fi
 
local cmd=() config_settings=
-   has cargo ${INHERITED} && cmd+=( cargo_env )
+   if has cargo ${INHERITED} && [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]]; then
+   cmd+=( cargo_env )
+   fi
 
case ${DISTUTILS_USE_PEP517} in
maturin)



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 0641762abe1deeec8ff4802ac726a1ce63d786aa
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:56 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:24 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0641762a

vim-doc.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/vim-doc.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
index 119ce793071d..f20f7397cf65 100644
--- a/eclass/vim-doc.eclass
+++ b/eclass/vim-doc.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-doc.eclass
@@ -16,13 +16,17 @@
 # DEPEND in vim-plugin or by whatever version of vim is being
 # installed by the eclass.
 
+if [[ ! ${_VIM_DOC_ECLASS} ]] ; then
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_VIM_DOC_ECLASS} ]] ; then
-
 # @FUNCTION: update_vim_helptags
 # @USAGE:
 # @DESCRIPTION:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: fda83fc093d3e82a6357e55a62de07b43635
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:39:13 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:27 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fda83fc0

xdg.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/xdg.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 14c56047af45..6af4b91875fc 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg.eclass
@@ -13,14 +13,18 @@
 # Utility eclass to update the desktop, icon and shared mime info as laid
 # out in the freedesktop specs & implementations
 
+if [[ -z ${_XDG_ECLASS} ]]; then
+_XDG_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_XDG_ECLASS} ]]; then
-_XDG_ECLASS=1
-
 inherit xdg-utils
 
 # Avoid dependency loop as both depend on glib-2



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 2ba4a06b94b1b3c679c964eb4fc8ee5cdd47adaf
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:59 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:24 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ba4a06b

vim-plugin.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/vim-plugin.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index ee4f1b6e0f81..b2ae0cb9e4c3 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-plugin.eclass
@@ -12,14 +12,18 @@
 # which is read automatically by vim.  The only exception is
 # documentation, for which we make a special case via vim-doc.eclass.
 
+if [[ -z ${_VIM_PLUGIN_ECLASS} ]]; then
+_VIM_PLUGIN_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIM_PLUGIN_ECLASS} ]]; then
-_VIM_PLUGIN_ECLASS=1
-
 inherit vim-doc
 
 [[ ${EAPI} != [67] ]] && _DEFINE_VIM_PLUGIN_SRC_PREPARE=true



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 9b9de22b1f07676b7501e320563841207a69db32
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:39:04 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:26 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b9de22b

virtualx.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/virtualx.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index f7318eafc59e..07d303899582 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: virtualx.eclass
@@ -9,14 +9,18 @@
 # @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: This eclass can be used for packages that need a working X 
environment to build.
 
+if [[ -z ${_VIRTUALX_ECLASS} ]]; then
+_VIRTUALX_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIRTUALX_ECLASS} ]]; then
-_VIRTUALX_ECLASS=1
-
 # @ECLASS_VARIABLE: VIRTUALX_REQUIRED
 # @PRE_INHERIT
 # @DESCRIPTION:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 31705da10b8165380b2eb7b21da4cffd7d3a1621
Author: Michał Górny  gentoo  org>
AuthorDate: Sat Aug 10 05:33:33 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:29 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31705da1

distutils-r1.eclass: Allow .jar files in sitedir

Closes: https://bugs.gentoo.org/937642
Signed-off-by: Michał Górny  gentoo.org>
Signed-off-by: Sam James  gentoo.org>

 eclass/distutils-r1.eclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 0f9dc8d14d5e..39705c5c3c84 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -2109,8 +2109,10 @@ _distutils-r1_post_python_install() {
local strays=()
local p
mapfile -d $'\0' -t strays < <(
+   # jar for jpype, https://bugs.gentoo.org/937642
find "${sitedir}" -maxdepth 1 -type f '!' '(' \
-name '*.egg-info' -o \
+   -name '*.jar' -o \
-name '*.pth' -o \
-name '*.py' -o \
-name '*.pyi' -o \



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 9624aabd7852cde30d5c4392c5b05d51921f1a7a
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:39 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:21 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9624aabd

tmpfiles.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/tmpfiles.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 39650401a6a0..63889a275fef 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -1,4 +1,4 @@
-# Copyright 2016-2022 Gentoo Authors
+# Copyright 2016-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: tmpfiles.eclass
@@ -55,9 +55,13 @@
 if [[ -z ${_TMPFILES_ECLASS} ]]; then
 _TMPFILES_ECLASS=1
 
-case "${EAPI}" in
-5|6|7|8) ;;
-*) die "API is undefined for EAPI ${EAPI}" ;;
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 # @ECLASS_VARIABLE: TMPFILES_OPTIONAL



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 8e4a8408904a21168ed94c8ca7b7320c265e66ee
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:14 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e4a8408

ruby-fakegem.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/ruby-fakegem.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 40ff76ce900e..04099a82ef4f 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-fakegem.eclass
@@ -139,7 +139,11 @@ RUBY_FAKEGEM_BINDIR="${RUBY_FAKEGEM_BINDIR-bin}"
 RUBY_FAKEGEM_EXTENSION_LIBDIR="${RUBY_FAKEGEM_EXTENSION_LIBDIR-lib}"
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: f5ef210074c1b8c5ea29c8b4cb64ccab6f48628b
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:32 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:20 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f5ef2100

strip-linguas.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/strip-linguas.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/strip-linguas.eclass b/eclass/strip-linguas.eclass
index 718341b4a626..b31f414c87c3 100644
--- a/eclass/strip-linguas.eclass
+++ b/eclass/strip-linguas.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2021 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: strip-linguas.eclass
@@ -9,15 +9,19 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: convenience function for LINGUAS support
 
+if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
+_STRIP_LINGUAS_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
-_STRIP_LINGUAS_ECLASS=1
-
-# @FUNCTION: strip-linguas
+# FUNCTION: strip-linguas
 # @USAGE: [|<-i|-u> ]
 # @DESCRIPTION:
 # Make sure that LINGUAS only contains languages that a package can



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 2adde4478398749f442fd67d72fd631b8138ea1a
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:35 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:21 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2adde447

systemd.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/systemd.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 03d6a82fd310..a5f0decde1e3 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 2011-2023 Gentoo Authors
+# Copyright 2011-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: systemd.eclass
@@ -25,7 +25,11 @@
 # @CODE
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 3a9d3b4238e7706d8f2f3d5d652faae69091a9ad
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:42 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:22 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a9d3b42

toolchain-funcs.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/toolchain-funcs.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 5e36fa275dcd..66819996ea33 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -13,14 +13,18 @@
 # in such a way that you can rely on the function always returning
 # something sane.
 
+if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
+_TOOLCHAIN_FUNCS_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
-_TOOLCHAIN_FUNCS_ECLASS=1
-
 inherit multilib
 
 # tc-getPROG   [tuple]



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: cf14792ae9471b1d95ee93ecc5de35922654e5cc
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:17 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:19 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf14792a

ruby-ng.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/ruby-ng.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index d80ae96dd40b..2ef6d2247435 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-ng.eclass
@@ -67,7 +67,11 @@
 # passed to "grep -E" to remove reporting of these shared objects.
 
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 2580b25033cac0b63d1195449b2a7dfeb7d0d22d
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:37:56 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:17 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2580b250

prefix.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/prefix.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index 8d50d0ba7b6e..e968e8ae8bac 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: prefix.eclass
@@ -12,14 +12,18 @@
 # located somewhere in the filesystem.  Prefix ebuilds require
 # additional functions and variables which are defined by this eclass.
 
-case ${EAPI:-0} in
-   [5678]) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_PREFIX_ECLASS} ]]; then
 _PREFIX_ECLASS=1
 
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 # @ECLASS_VARIABLE: EPREFIX
 # @DESCRIPTION:
 # The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 1a99e837bd683a50583c7a6a83bae5ad918cec74
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:08 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:18 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a99e837

readme.gentoo-r1.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/readme.gentoo-r1.eclass | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass
index 48023d9c049f..3d2d8244687c 100644
--- a/eclass/readme.gentoo-r1.eclass
+++ b/eclass/readme.gentoo-r1.eclass
@@ -21,7 +21,11 @@ if [[ -z ${_README_GENTOO_ECLASS} ]]; then
 _README_GENTOO_ECLASS=1
 
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: fabfe377fe7451c3a1f62d5e5cda837c63a583e2
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:38:21 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:20 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fabfe377

ruby-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/ruby-utils.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 789f57ce25f6..48a25114b396 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-utils.eclass
@@ -15,13 +15,17 @@
 # This eclass does not set any metadata variables nor export any phase
 # functions. It can be inherited safely.
 
-case ${EAPI:-0} in
-   [5678]) ;;
+if [[ ! ${_RUBY_UTILS} ]]; then
+
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_RUBY_UTILS} ]]; then
-
 # @ECLASS_VARIABLE: RUBY_TARGETS_PREFERENCE
 # @INTERNAL
 # @DESCRIPTION:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 4d90c2033b85e64c3b6be717a930be84f629f35c
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:37:52 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:16 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d90c203

portability.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/portability.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/portability.eclass b/eclass/portability.eclass
index 78da440e22dd..926ac8b8b825 100644
--- a/eclass/portability.eclass
+++ b/eclass/portability.eclass
@@ -9,14 +9,18 @@
 # @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: This eclass is created to avoid using non-portable GNUisms inside 
ebuilds
 
+if [[ -z ${_PORTABILITY_ECLASS} ]]; then
+_PORTABILITY_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PORTABILITY_ECLASS} ]]; then
-_PORTABILITY_ECLASS=1
-
 # @FUNCTION: treecopy
 # @USAGE:  [orig2 orig3 ] 
 # @DESCRIPTION:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: e2bb16305d903272dcef1e902d0e7b3ec87dd87b
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:37:59 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:18 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2bb1630

preserve-libs.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/preserve-libs.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass
index 35c65ef4436f..38571447b945 100644
--- a/eclass/preserve-libs.eclass
+++ b/eclass/preserve-libs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: preserve-libs.eclass
@@ -7,14 +7,18 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: preserve libraries after SONAME changes
 
+if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
+_PRESERVE_LIBS_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
-_PRESERVE_LIBS_ECLASS=1
-
 # @FUNCTION: preserve_old_lib
 # @USAGE:  [more libs]
 # @DESCRIPTION:



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 107c548f56cfcfc133e10918dfc175bf6d9128c3
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:37:48 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:16 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=107c548f

php-pear-r2.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/php-pear-r2.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/php-pear-r2.eclass b/eclass/php-pear-r2.eclass
index 9882c7dcc700..567aa9a8144f 100644
--- a/eclass/php-pear-r2.eclass
+++ b/eclass/php-pear-r2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: php-pear-r2.eclass
@@ -14,14 +14,18 @@
 # Note that this eclass doesn't handle dependencies of PEAR packages
 # on purpose; please use (R)DEPEND to define them correctly!
 
+if [[ -z ${_PHP_PEAR_R2_ECLASS} ]]; then
+_PHP_PEAR_R2_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PHP_PEAR_R2_ECLASS} ]]; then
-_PHP_PEAR_R2_ECLASS=1
-
 RDEPEND=">=dev-php/pear-1.8.1"
 [[ ${EAPI} != [67] ]] && IDEPEND=">=dev-php/pear-1.8.1"
 



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-08 Thread Sam James
commit: 75c1c9c04acf63c2c7ed1d8bf62609a654754758
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 21:37:43 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Sep  8 18:21:15 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75c1c9c0

perl-functions.eclass: add global-scope ewarn for deprecated < EAPI 7

Signed-off-by: Sam James  gentoo.org>

 eclass/perl-functions.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 142fdeb8cfbd..d2b6cfb85f73 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: perl-functions.eclass
@@ -17,11 +17,12 @@
 # global scope.
 
 case ${EAPI} in
-   7|8)
-   ;;
-   *)
-   die "${ECLASS}: EAPI ${EAPI:-0} not supported"
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 [[ ${CATEGORY} == "perl-core" ]] && inherit alternatives



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-07 Thread Sam James
commit: 19cfcafa125dbbe389fc84e4f89cc851df6baa46
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 18:23:03 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Sep  7 18:23:03 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19cfcafa

kernel-build.eclass: localise 'target'

Fixes: c3f4e3f788e2d5973ce49293fe20354b20576426
Signed-off-by: Sam James  gentoo.org>

 eclass/kernel-build.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 93523629de41..ce87fd72acdd 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -302,6 +302,7 @@ kernel-build_src_compile() {
targets+=( ctf )
fi
 
+   local target
for target in "${targets[@]}" ; do
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" "${target}"
done
@@ -327,6 +328,7 @@ kernel-build_src_test() {
strip_args="--strip-unneeded"
fi
 
+   local target
for target in "${targets[@]}" ; do
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
INSTALL_MOD_PATH="${T}" 
INSTALL_MOD_STRIP="${strip_args}" \
@@ -375,6 +377,7 @@ kernel-build_src_install() {
)
fi
 
+   local target
for target in "${targets[@]}" ; do
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
INSTALL_MOD_PATH="${ED}" 
INSTALL_MOD_STRIP="${strip_args}" \



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-07 Thread Sam James
commit: c3f4e3f788e2d5973ce49293fe20354b20576426
Author: Sam James  gentoo  org>
AuthorDate: Sat Sep  7 16:22:45 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Sep  7 18:21:32 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3f4e3f7

kernel-build.eclass: call ctf targets serially

Workaround for install + ctf_install not working in parallel for now
(have reported this).

Signed-off-by: Sam James  gentoo.org>

 eclass/kernel-build.eclass | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 91c962d671ab..93523629de41 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -302,7 +302,9 @@ kernel-build_src_compile() {
targets+=( ctf )
fi
 
-   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" "${targets[@]}"
+   for target in "${targets[@]}" ; do
+   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" "${target}"
+   done
 }
 
 # @FUNCTION: kernel-build_src_test
@@ -325,9 +327,11 @@ kernel-build_src_test() {
strip_args="--strip-unneeded"
fi
 
-   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
-   INSTALL_MOD_PATH="${T}" INSTALL_MOD_STRIP="${strip_args}" \
-   "${targets[@]}"
+   for target in "${targets[@]}" ; do
+   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
+   INSTALL_MOD_PATH="${T}" 
INSTALL_MOD_STRIP="${strip_args}" \
+   "${target}"
+   done
 
kernel-install_test "${KV_FULL}" \
"${WORKDIR}/build/$(dist-kernel_get_image_path)" \
@@ -371,9 +375,11 @@ kernel-build_src_install() {
)
fi
 
-   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
-   INSTALL_MOD_PATH="${ED}" INSTALL_MOD_STRIP="${strip_args}" \
-   INSTALL_PATH="${ED}/boot" "${compress[@]}" "${targets[@]}"
+   for target in "${targets[@]}" ; do
+   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
+   INSTALL_MOD_PATH="${ED}" 
INSTALL_MOD_STRIP="${strip_args}" \
+   INSTALL_PATH="${ED}/boot" "${compress[@]}" "${target}"
+   done
 
# note: we're using mv rather than doins to save space and time
# install main and arch-specific headers first, and scripts



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-05 Thread Sam James
commit: 82f9bef4ed76f656a3d79b607eecff526b78b7ee
Author: Sam James  gentoo  org>
AuthorDate: Thu Sep  5 11:48:02 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Thu Sep  5 12:09:45 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82f9bef4

linux-mod-r1.eclass: BDEPEND on dev-util/pahole

If the kernel is built with CONFIG_DEBUG_INFO_BTF_MODULES, external
kernel module builds will try to call `pahole` to generate BTF and
fail if it's not present.

pahole is a small dependency and we're likely to enable BTF by default
in more configurations going forward, so do it unconditionally.

The alternatives aren't great anyway, we would have to instead:
* RDEPEND in g-k-bin
* BDEPEND in g-k-bin and break the binpkg case
* Use an ewarn in the eclass if pahole isn't installed + config option is set
so this is the best option available to us.

Thanks-to: Ionen Wolkens  gentoo.org>
Reported-by: Sebastian Engel  gmx.de>
Signed-off-by: Sam James  gentoo.org>

 eclass/linux-mod-r1.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass
index 9911a6ddee12..120fb019d74a 100644
--- a/eclass/linux-mod-r1.eclass
+++ b/eclass/linux-mod-r1.eclass
@@ -121,6 +121,7 @@ DEPEND="
virtual/linux-sources
 "
 BDEPEND="
+   dev-util/pahole
sys-apps/kmod[tools]
modules-sign? (
dev-libs/openssl



[gentoo-commits] repo/gentoo:master commit in: eclass/

2024-09-04 Thread Michał Górny
commit: ae9987ba9684a83a0310b42e28299c545e0e5468
Author: Sam James  gentoo  org>
AuthorDate: Wed Sep  4 14:38:34 2024 +
Commit: Michał Górny  gentoo  org>
CommitDate: Wed Sep  4 20:33:03 2024 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae9987ba

kernel-build.eclass: fix src_test w/o CTF

Fixes: 983fe336a7571f822655c25e0785f067de80c64c
Signed-off-by: Sam James  gentoo.org>
Signed-off-by: Michał Górny  gentoo.org>

 eclass/kernel-build.eclass | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 3836bef1276b..91c962d671ab 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -312,6 +312,12 @@ kernel-build_src_compile() {
 kernel-build_src_test() {
debug-print-function ${FUNCNAME} "${@}"
 
+   local targets=( modules_install )
+
+   if grep -q "CONFIG_CTF=y" "${WORKDIR}/modprep/.config"; then
+   targets+=( ctf_install )
+   fi
+
# Use the kernel build system to strip, this ensures the modules
# are stripped *before* they are signed or compressed.
local strip_args
@@ -321,7 +327,7 @@ kernel-build_src_test() {
 
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
INSTALL_MOD_PATH="${T}" INSTALL_MOD_STRIP="${strip_args}" \
-   modules_install ctf_install
+   "${targets[@]}"
 
kernel-install_test "${KV_FULL}" \
"${WORKDIR}/build/$(dist-kernel_get_image_path)" \



  1   2   3   4   5   6   7   8   9   10   >