public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, /
Date: Sun, 23 Apr 2023 20:49:29 +0000 (UTC)	[thread overview]
Message-ID: <1682282966.6a21e8643a56f91c724f23d652fb43ead5c1e2af.sam@gentoo> (raw)

commit:     6a21e8643a56f91c724f23d652fb43ead5c1e2af
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 19 14:27:42 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr 23 20:49:26 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6a21e864

install-qa-check.d: Add a install log check for missing dev-python/cython dep

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1024
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                |  2 ++
 bin/install-qa-check.d/90cython-dep | 45 +++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/NEWS b/NEWS
index e60262509..50d96402c 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ Features:
   - -Wmain
   - -Wimplicit-int
   - -Wstring-compare
+* install-qa-check.d: cython-dep: Report packages that are using Cython
+  but are missing BDEPEND on it.
 
 Bug fixes:
 * econf now checks for proper end of string in "configure --help" output for

diff --git a/bin/install-qa-check.d/90cython-dep b/bin/install-qa-check.d/90cython-dep
new file mode 100644
index 000000000..4932c0242
--- /dev/null
+++ b/bin/install-qa-check.d/90cython-dep
@@ -0,0 +1,45 @@
+# Check for missing dev-python/cython dep based on output
+# from setuptools cythonize() support
+
+cython_dep_check() {
+	[[ ${CATEGORY}/${PN} == dev-python/cython ]] && return
+	# grepping log files is expensive, so do it only for ebuilds using
+	# distutils-r1
+	has distutils-r1 ${INHERITED} || return
+	[[ ${BDEPEND} == *dev-python/cython* ]] && return
+
+	# Evaluate misc gcc warnings
+	if [[ -n ${PORTAGE_LOG_FILE} && -r ${PORTAGE_LOG_FILE} ]] ; then
+		# In debug mode, the grep calls will produce false positives
+		# if they're shown in the trace.
+		local reset_debug=0
+		if [[ ${-/x/} != $- ]] ; then
+			set +x
+			reset_debug=1
+		fi
+
+		local grep_cmd=grep
+		[[ ${PORTAGE_LOG_FILE} = *.gz ]] && grep_cmd=zgrep
+
+		# Force C locale to work around slow multibyte locales, bug #160234
+		# Force text mode as newer grep will treat non-ASCII (e.g. UTF-8) as
+		# binary when we run in the C locale.
+		local f=$(
+			LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -a "Cythonizing" \
+				"${PORTAGE_LOG_FILE}" | uniq
+		)
+		if [[ -n ${f} ]] ; then
+			__vecho -ne '\n'
+			eqawarn "QA Notice: Package seems to be missing a BDEPEND on dev-python/cython."
+			eqawarn "${f}"
+			__vecho -ne '\n'
+		fi
+
+		[[ ${reset_debug} = 1 ]] && set -x
+	fi
+}
+
+cython_dep_check
+: # guarantee successful exit
+
+# vim:ft=sh


             reply	other threads:[~2023-04-23 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23 20:49 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-12-10  1:46 [gentoo-commits] proj/portage:master commit in: bin/install-qa-check.d/, / Sam James
2022-11-09  7:30 Sam James
2022-11-09  3:31 Sam James
2022-11-08 23:49 Sam James

Reply instructions:

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

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

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

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

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

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

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