* [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, bin/
@ 2018-04-17 2:14 Zac Medico
0 siblings, 0 replies; 4+ messages in thread
From: Zac Medico @ 2018-04-17 2:14 UTC (permalink / raw
To: gentoo-commits
commit: ae6d6aa22d074c04cd9caefe1ca02bf615bfd86f
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Apr 17 02:06:38 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 17 02:11:19 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ae6d6aa2
estrip, install-qa-check.d/10ignored-flags: fix bug 653352
Update detection of ELF files to work with >=sys-apps/file-5.33.
Bug: https://bugs.gentoo.org/653352
bin/estrip | 3 ++-
bin/install-qa-check.d/10ignored-flags | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/bin/estrip b/bin/estrip
index 030d9e8bf..5709b862c 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -427,7 +427,8 @@ do
${STRIP} -g "${x}"
fi
fi
- elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
+ elif [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* ||
+ ${f} == *"SB shared object"* ]] ; then
process_elf "${x}" "${inode_link}" ${PORTAGE_STRIP_FLAGS}
elif [[ ${f} == *"SB relocatable"* ]] ; then
process_elf "${x}" "${inode_link}" ${SAFE_STRIP_FLAGS}
diff --git a/bin/install-qa-check.d/10ignored-flags b/bin/install-qa-check.d/10ignored-flags
index 28aec6787..dc160e182 100644
--- a/bin/install-qa-check.d/10ignored-flags
+++ b/bin/install-qa-check.d/10ignored-flags
@@ -32,7 +32,7 @@ ignored_flag_check() {
# similar to how prepstrip uses it.
f=$(file "${x}") || continue
[[ -z ${f} ]] && continue
- if [[ ${f} == *"SB executable"* ||
+ if [[ ${f} == *"SB executable"* || ${f} == *"SB pie executable"* ||
${f} == *"SB shared object"* ]] ; then
echo "${x}" >> "${T}"/scanelf-ignored-CFLAGS.log
fi
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, bin/
@ 2018-09-20 18:49 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2018-09-20 18:49 UTC (permalink / raw
To: gentoo-commits
commit: aecc59a5f2c05db09ee7e04a32875998adddf446
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 20 18:18:44 2018 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 20 18:48:37 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=aecc59a5
Move parallel xargs wrapping to isolated-functions.sh
Move the parallel xargs support used in pngfix QA check
to isolated-functions.sh, to be reused in ecompress.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
bin/helper-functions.sh | 9 +--------
bin/install-qa-check.d/60pngfix | 13 ++-----------
bin/isolated-functions.sh | 22 ++++++++++++++++++++++
3 files changed, 25 insertions(+), 19 deletions(-)
diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
index 9b6e201aa..2d359762a 100644
--- a/bin/helper-functions.sh
+++ b/bin/helper-functions.sh
@@ -10,13 +10,6 @@ source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
#
# API functions for doing parallel processing
#
-makeopts_jobs() {
- # Copied from eutils.eclass:makeopts_jobs()
- local jobs=$(echo " ${MAKEOPTS} " | \
- sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p')
- echo ${jobs:-1}
-}
-
__multijob_init() {
# Setup a pipe for children to write their pids to when they finish.
# We have to allocate two fd's because POSIX has undefined behavior
@@ -34,7 +27,7 @@ __multijob_init() {
rm -f "${pipe}"
# See how many children we can fork based on the user's settings.
- mj_max_jobs=$(makeopts_jobs "$@")
+ mj_max_jobs=$(___makeopts_jobs "$@")
mj_num_jobs=0
}
diff --git a/bin/install-qa-check.d/60pngfix b/bin/install-qa-check.d/60pngfix
index b69c55614..a2e23d1d3 100644
--- a/bin/install-qa-check.d/60pngfix
+++ b/bin/install-qa-check.d/60pngfix
@@ -1,16 +1,7 @@
# Check for issues with PNG files
-source "${PORTAGE_BIN_PATH}/helper-functions.sh" || exit 1
-
pngfix_check() {
- local chunksize=1 jobs pngfix=$(type -P pngfix) xargs=(${XARGS})
-
- if "${xargs[@]}" --help | grep -q -- --max-procs=; then
- jobs=$(makeopts_jobs)
- if [[ ${jobs} -gt 1 ]]; then
- xargs+=("--max-procs=${jobs}" -L "${chunksize}")
- fi
- fi
+ local pngfix=$(type -P pngfix)
if [[ -n ${pngfix} ]] ; then
local pngout=()
@@ -35,7 +26,7 @@ pngfix_check() {
fi
eqawarn " ${pngout[@]:7}: ${error}"
fi
- done < <(find "${ED}" -type f -name '*.png' -print0 | "${xargs[@]}" -0 "${pngfix}")
+ done < <(find "${ED}" -type f -name '*.png' -print0 | ___parallel_xargs -0 "${pngfix}")
fi
}
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index cac42a4c5..39b0ad344 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -460,6 +460,28 @@ if [[ -z ${XARGS} ]] ; then
esac
fi
+___makeopts_jobs() {
+ # Copied from eutils.eclass:makeopts_jobs()
+ local jobs=$(echo " ${MAKEOPTS} " | \
+ sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p')
+ echo ${jobs:-1}
+}
+
+# Run ${XARGS} in parallel for detected number of CPUs, if supported.
+# Passes all arguments to xargs, and returns its exit code
+___parallel_xargs() {
+ local chunksize=1 jobs xargs=( ${XARGS} )
+
+ if "${xargs[@]}" --help | grep -q -- --max-procs=; then
+ jobs=$(___makeopts_jobs)
+ if [[ ${jobs} -gt 1 ]]; then
+ xargs+=("--max-procs=${jobs}" -L "${chunksize}")
+ fi
+ fi
+
+ "${xargs[@]}" "${@}"
+}
+
hasq() {
has $EBUILD_PHASE prerm postrm || eqawarn \
"QA Notice: The 'hasq' function is deprecated (replaced by 'has')"
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, bin/
@ 2022-11-09 1:17 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-11-09 1:17 UTC (permalink / raw
To: gentoo-commits
commit: 85723dbd4d8fa6392001adeb8ca695a29e530949
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 9 01:16:27 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 9 01:17:50 2022 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=85723dbd
bin: replace check-implicit-pointer-usage.py
Always die on -Wimplicit-function-declaration as Clang 16 is going
to make it fatal and it's always pretty dubious.
The licencing of check-implicit-pointer-usage.py is also unclear,
but the tool has been broken since GCC 4.5(!)
Bug: https://bugs.gentoo.org/365655
Bug: https://bugs.gentoo.org/870412
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/check-implicit-pointer-usage.py | 79 -----------------------------------
bin/install-qa-check.d/90gcc-warnings | 46 ++++----------------
2 files changed, 7 insertions(+), 118 deletions(-)
diff --git a/bin/check-implicit-pointer-usage.py b/bin/check-implicit-pointer-usage.py
deleted file mode 100755
index 06b666c88..000000000
--- a/bin/check-implicit-pointer-usage.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python
-
-# Ripped from HP and updated from Debian
-# Update by Gentoo to support unicode output
-
-#
-# Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
-# David Mosberger <davidm@hpl.hp.com>
-#
-# Scan standard input for GCC warning messages that are likely to
-# source of real 64-bit problems. In particular, see whether there
-# are any implicitly declared functions whose return values are later
-# interpreted as pointers. Those are almost guaranteed to cause
-# crashes.
-#
-
-import re
-import sys
-
-implicit_pattern = re.compile(
- r"([^:]*):(\d+): warning: implicit declaration " + "of function [`']([^']*)'"
-)
-pointer_pattern = (
- r"([^:]*):(\d+): warning: "
- + r"("
- + r"(assignment"
- + r"|initialization"
- + r"|return"
- + r"|passing arg \d+ of `[^']*'"
- + r"|passing arg \d+ of pointer to function"
- + r") makes pointer from integer without a cast"
- + r"|"
- + r"cast to pointer from integer of different size)"
-)
-
-unicode_quote_open = "\u2018"
-unicode_quote_close = "\u2019"
-
-
-def write(msg):
- sys.stdout.buffer.write(msg.encode("utf_8", "backslashreplace"))
-
-
-pointer_pattern = re.compile(pointer_pattern)
-
-last_implicit_filename = ""
-last_implicit_linenum = -1
-last_implicit_func = ""
-
-while True:
- line = sys.stdin.buffer.readline().decode("utf_8", "replace")
- if not line:
- break
- # translate unicode open/close quotes to ascii ones
- line = line.replace(unicode_quote_open, "`")
- line = line.replace(unicode_quote_close, "'")
- m = implicit_pattern.match(line)
- if m:
- last_implicit_filename = m.group(1)
- last_implicit_linenum = int(m.group(2))
- last_implicit_func = m.group(3)
- else:
- m = pointer_pattern.match(line)
- if m:
- pointer_filename = m.group(1)
- pointer_linenum = int(m.group(2))
- if (
- last_implicit_filename == pointer_filename
- and last_implicit_linenum == pointer_linenum
- ):
- write(
- "Function `%s' implicitly converted to pointer at "
- "%s:%d\n"
- % (
- last_implicit_func,
- last_implicit_filename,
- last_implicit_linenum,
- )
- )
diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings
index f5dae8a76..cd12558ba 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -110,12 +110,17 @@ gcc_warn_check() {
f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E -a "${joined_msgs}" "${PORTAGE_LOG_FILE}" | uniq)
if [[ -n ${f} ]] ; then
abort="yes"
+
# for now, don't make this fatal (see bug #337031)
#if [[ ${f} == *'will always overflow destination buffer'* ]]; then
# always_overflow=yes
#fi
- if [[ ${always_overflow} = yes ]] ; then
+ if [[ ${f} == *'[-Wimplicit-function-declaration]'* ]] ; then
+ implicit_func_decl=yes
+ fi
+
+ if [[ ${always_overflow} = yes || ${implicit_func_decl} = yes ]] ; then
eerror
eerror "QA Notice: Package triggers severe warnings which indicate that it"
eerror " may exhibit random runtime failures."
@@ -134,47 +139,10 @@ gcc_warn_check() {
fi
fi
- local cat_cmd=cat
- [[ ${PORTAGE_LOG_FILE} = *.gz ]] && cat_cmd=zcat
[[ ${reset_debug} = 1 ]] && set -x
- # Use safe cwd, avoiding unsafe import for bug #469338.
- f=$(cd "${PORTAGE_PYM_PATH}" ; ${cat_cmd} "${PORTAGE_LOG_FILE}" | \
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/check-implicit-pointer-usage.py || die "check-implicit-pointer-usage.py failed")
-
- if [[ -n ${f} ]] ; then
- # In the future this will be a forced "die". In preparation,
- # increase the log level from "qa" to "eerror" so that people
- # are aware this is a problem that must be fixed ASAP.
-
- # Just warn on 32bit hosts but bail on 64bit hosts
- case ${CHOST} in
- alpha*|aarch64*|arm64*|hppa64*|ia64*|powerpc64*|loongarch64*|mips64*|riscv64*|sparc64*|sparcv9*|s390x*|x86_64*) gentoo_bug=yes ;;
- esac
-
- abort=yes
-
- if [[ ${gentoo_bug} = yes ]] ; then
- eerror
- eerror "QA Notice: Package triggers severe warnings which indicate that it"
- eerror " will almost certainly crash on 64bit architectures."
- eerror
- eerror "${f}"
- eerror
- eerror " Please file a bug about this at https://bugs.gentoo.org/"
- eerror " with the maintainer of the package."
- eerror
- else
- __vecho -ne '\n'
- eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
- eqawarn " will almost certainly crash on 64bit architectures."
- eqawarn "${f}"
- __vecho -ne '\n'
- fi
-
- fi
if [[ ${abort} == "yes" ]] ; then
- if [[ ${gentoo_bug} = yes || ${always_overflow} = yes ]] ; then
+ if [[ ${gentoo_bug} = yes || ${always_overflow} = yes || ${implicit_func_decl} = yes ]] ; then
die "install aborted due to severe warnings shown above"
else
echo "Please do not file a Gentoo bug and instead" \
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, bin/
@ 2024-07-26 10:22 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-07-26 10:22 UTC (permalink / raw
To: gentoo-commits
commit: cc793fb5f0d7c39c904f9e209b804d8f762a96cd
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Jul 23 16:05:51 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 26 10:22:40 2024 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cc793fb5
Check whether xtrace is enabled sensibly
To write [[ ${-/x/} != $- ]] is horribly backwards and comparatively
expensive. Implement the test - and its inverse - in a sensible fashion.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/ebuild.sh | 4 ++--
bin/install-qa-check.d/90cython-dep | 2 +-
bin/install-qa-check.d/90gcc-warnings | 2 +-
bin/phase-functions.sh | 6 +++---
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 8b1e0861a8..a742397db9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -473,7 +473,7 @@ __try_source() {
if [[ -r ${1} && -f ${1} ]]; then
local debug_on=false
- if [[ "${PORTAGE_DEBUG}" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then
+ if [[ ${PORTAGE_DEBUG} == 1 ]] && [[ $- != *x* ]]; then
debug_on=true
fi
@@ -628,7 +628,7 @@ if ! has "${EBUILD_PHASE}" clean cleanrm ; then
unset E_RESTRICT PROVIDES_EXCLUDE REQUIRES_EXCLUDE
unset PORTAGE_EXPLICIT_INHERIT
- if [[ ${PORTAGE_DEBUG} != 1 || ${-/x/} != $- ]] ; then
+ if [[ ${PORTAGE_DEBUG} != 1 || $- == *x* ]] ; then
source "${EBUILD}" || die "error sourcing ebuild"
else
set -x
diff --git a/bin/install-qa-check.d/90cython-dep b/bin/install-qa-check.d/90cython-dep
index 4932c02429..2458074c39 100644
--- a/bin/install-qa-check.d/90cython-dep
+++ b/bin/install-qa-check.d/90cython-dep
@@ -13,7 +13,7 @@ cython_dep_check() {
# In debug mode, the grep calls will produce false positives
# if they're shown in the trace.
local reset_debug=0
- if [[ ${-/x/} != $- ]] ; then
+ if [[ $- == *x* ]] ; then
set +x
reset_debug=1
fi
diff --git a/bin/install-qa-check.d/90gcc-warnings b/bin/install-qa-check.d/90gcc-warnings
index 1060618dfa..2e728268e1 100644
--- a/bin/install-qa-check.d/90gcc-warnings
+++ b/bin/install-qa-check.d/90gcc-warnings
@@ -10,7 +10,7 @@ gcc_warn_check() {
# In debug mode, this variable definition and corresponding grep calls
# will produce false positives if they're shown in the trace.
local reset_debug=0
- if [[ ${-/x/} != $- ]] ; then
+ if [[ $- == *x* ]] ; then
set +x
reset_debug=1
fi
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index d037cf6776..2c3f2d389f 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -1002,7 +1002,7 @@ __ebuild_main() {
ewarn "pkg_${1}() is not defined: '${EBUILD##*/}'"
fi
export SANDBOX_ON="0"
- if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
+ if [[ ${PORTAGE_DEBUG} != 1 || $- == *x* ]]; then
__ebuild_phase_with_hooks pkg_${1}
else
set -x
@@ -1069,7 +1069,7 @@ __ebuild_main() {
;;
esac
- if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
+ if [[ ${PORTAGE_DEBUG} != 1 || $- == *x* ]]; then
__dyn_${1}
else
set -x
@@ -1083,7 +1083,7 @@ __ebuild_main() {
# for example, awking and piping a file in /tmp requires a temp file to be created
# in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
export SANDBOX_ON="0"
- if [[ "${PORTAGE_DEBUG}" != "1" || "${-/x/}" != "$-" ]]; then
+ if [[ ${PORTAGE_DEBUG} != 1 || $- == *x* ]]; then
__dyn_${1}
else
set -x
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-26 10:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 18:49 [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, bin/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-07-26 10:22 Sam James
2022-11-09 1:17 Sam James
2018-04-17 2:14 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox