From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lDkfHHuFjWra+j4AWB0awg (envelope-from ) for ; Tue, 25 Aug 2026 08:07:23 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=jXAvOyLQ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4OxKFIQh; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZzReveUs; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=m+MN1Khc; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5C2F81E0A3; Tue, 25 Aug 2026 08:07:23 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,URIBL_CSS_A autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 130BB1E033 for ; Tue, 25 Aug 2026 08:07:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 769044BA79A1 for ; Tue, 25 Aug 2026 12:07:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 769044BA79A1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=jXAvOyLQ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4OxKFIQh; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZzReveUs; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=m+MN1Khc Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 3E81E4BA2E05 for ; Tue, 25 Aug 2026 12:06:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E81E4BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3E81E4BA2E05 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787659614; cv=none; b=nW/15NeiuAWfdIgg9MMa55XKDKLZF2tetdwZgv0uWqyYVc6b1NEv7ziZca2Yoifz7fwNu7YFmQyeBJXrFCD/I2sQ1wHYLwgaf9JgsKjG9uJxXNgGwbIOFZw/FmEBsioluj6yVVNB10WQGksg+Yz3vdoO2DA+MngfoLibYP20vvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1787659614; c=relaxed/simple; bh=mTU3FjMYkPiLx2P98AmI0IIlVJ6/1qOvl06qQU+qyHQ=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=jjTEfjJ7rAuI145iQhF5hgpb/Jnh/jBjXbhbJGKZgGdf6BH6rIZJcIxvU733YoRbW6JlGPtKAyw5yrkDK/zgvcZUdwRbuebRWTX4hZairLfwU4UMDAh/G6iypBXQ0ChQEshwh99PYkJlKfuLat0ylS+O4RAKUA05m7W+Nb6g838= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=jXAvOyLQ; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=4OxKFIQh; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZzReveUs; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=m+MN1Khc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E81E4BA2E05 Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id D586A1F827 for ; Tue, 25 Aug 2026 12:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787659609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JQcmvQ4NXZWfPk4ES4gmFxivj9Nby76G1g/GZuapm3o=; b=jXAvOyLQt5fGpCPTT/vweCajD9QNL1ZO20LuESs7h6lrbifhMM+PoSukvhaAocOaFPTtag zrW7PhqF1nDGiA9RNsQkkgJ9Z9+OdxjuWaGbEX8GuvOAzKx4gT/vWCyybNNzlJ26tTWnNH nwoPMjXa2o6JfZksYYSHr+es/E6/PZE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787659609; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JQcmvQ4NXZWfPk4ES4gmFxivj9Nby76G1g/GZuapm3o=; b=4OxKFIQh24XpSmNlQbHytWikLYhluj6OTbw2BGd1zggIG7N0RFRmGq1ubI6jm4ovyoIcYn 4mJa+cKxA9SKnaDw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1787659604; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JQcmvQ4NXZWfPk4ES4gmFxivj9Nby76G1g/GZuapm3o=; b=ZzReveUsyPn/t6LF+FudqgMu//EYFSboNARwQYZc7a5ZGC0YieFmVC5hrcHUIOeIdFSGQa A5dYcno2ntg6OjTZSG4raJQyPCfNdHfEhn19M/1Kn6T4gZHBEEo2LjH59rrg9gkmIBuq5A hgtymoi+ivXXMPDLtyvPAmdxphjZmHE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1787659604; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JQcmvQ4NXZWfPk4ES4gmFxivj9Nby76G1g/GZuapm3o=; b=m+MN1KhcgJJMAsdZ0o7eSF0cqwElboE4Xcq/OEwQDzVmUFHM7ZZJe6IZA9CcaxdQpzJv0G FIpN8kHvLzuqEvAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id BF72C13335 for ; Tue, 25 Aug 2026 12:06:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4IXELFSFjWqmZgAAD6G6ig (envelope-from ) for ; Tue, 25 Aug 2026 12:06:44 +0000 Message-ID: <9bfc5a0f-45c2-406b-8486-18297aa0054d@suse.de> Date: Tue, 25 Aug 2026 14:06:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/build] Rename gdb/gdb-gdb.py.in to gdb/gdb-gdb.py From: Tom de Vries To: gdb-patches@sourceware.org References: <20260813051720.581528-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20260813051720.581528-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,imap1.dmz-prg2.suse.org:helo] X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/13/26 7:17 AM, Tom de Vries wrote: > Currently, $build/gdb/gdb-gdb.py is generated from $src/gdb/gdb-gdb.py.in, but > there's no real need for it: they are identical. > > Fix this by: > - renaming gdb/gdb-gdb.py.in to gdb/gdb-gdb.py > - using AC_CONFIG_LINKS to get $build/gdb/gdb-gdb.py > > Because pre-commit type classification does not consider gdb/gdb-gdb.py.in a > python file: > ... > $ identify-cli gdb/gdb-gdb.py.in > ["file", "non-executable", "text"] > ... > .pre-commit-config.yaml has a types_or override to stop pre-commit from > ignoring the file. Unfortunately, that never worked for flake8, which needed > a types override instead [1]. > > Update .pre-commit-config.yaml to reflect the new situation: > - drop the files match for gdb/gdb-gdb.py.in > - drop the types_or override that's no longer necessary > > Tested on x86_64-linux, by doing a clean build and testing gdb.gdb/*.exp. I've checked that after running "src-release.sh gdb": - without this patch the tarball contains gdb/gdb-gdb.py.in - with this patch the tarball contains gdb/gdb-gdb.py Also I double-checked that the relevant pre-commit checks succeed: ... $ pre-commit run --file gdb/gdb-gdb.py black.............................................................Passed flake8............................................................Passed isort.............................................................Passed codespell.........................................................Passed tclint........................................(no files to check)Skipped yamllint......................................(no files to check)Skipped check-include-guards..........................(no files to check)Skipped check-gnu-style...............................(no files to check)Skipped - hook id: check-gnu-style check-whitespace..................................................Passed pre-commit-setup..................................................Passed check-file-mode...................................................Passed ... I'm pushing this shortly. Thanks, - Tom > > Suggested-By: Simon Marchi [1] > > [1] https://sourceware.org/pipermail/gdb-patches/2026-August/229394.html > --- > .pre-commit-config.yaml | 9 +-------- > gdb/Makefile.in | 7 ++----- > gdb/configure | 6 ++++-- > gdb/configure.ac | 3 ++- > gdb/{gdb-gdb.py.in => gdb-gdb.py} | 0 > gdb/testsuite/gdb.gdb/python-helper.exp | 8 +++++++- > 6 files changed, 16 insertions(+), 17 deletions(-) > rename gdb/{gdb-gdb.py.in => gdb-gdb.py} (100%) > > diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml > index 3cccec45ef7..bd392a57514 100644 > --- a/.pre-commit-config.yaml > +++ b/.pre-commit-config.yaml > @@ -48,32 +48,25 @@ default_stages: [pre-commit] > repos: > # Python hooks. Run these for (in glob notation): > # > - # - gdb/gdb-gdb.py.in > # - gdb/*.py > # - gdb/python/**/*.py > # - gdb/testsuite/*.py > # > - # Because gdb/gdb-gdb.py.in is not classified as python, we use > - # 'types_or: [file]' to override the default type for these hooks. > - # > - repo: https://github.com/psf/black-pre-commit-mirror > rev: 26.5.1 > hooks: > - id: black > - types_or: &gdb_python_types [file] > - files: &gdb_python_files '^gdb/.*\.py(\.in)?$' > + files: &gdb_python_files '^gdb/.*\.py$' > - repo: https://github.com/pycqa/flake8 > rev: 7.3.0 > hooks: > - id: flake8 > - types_or: *gdb_python_types > files: *gdb_python_files > args: [--config, gdb/setup.cfg] > - repo: https://github.com/pycqa/isort > rev: 9.0.0b1 > hooks: > - id: isort > - types_or: *gdb_python_types > files: *gdb_python_files > # Isort's .pre-commit-hooks.yaml sets stages, overriding default_stages, > # so this hook needs an explicit setting. > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 57f384170ab..2e2c4e20797 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -2088,7 +2088,7 @@ generated_files = \ > # Flags needed to compile Python code > PYTHON_CFLAGS = @PYTHON_CFLAGS@ > > -all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb gcore gstack gdb-add-index > +all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.gdb gcore gstack gdb-add-index > @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=$(SUBDIRS)" subdir_do > > # Rule for compiling .c files in the top-level gdb directory. > @@ -2425,7 +2425,7 @@ clean mostlyclean: $(CONFIG_CLEAN) > distclean: clean > @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do > rm -f nm.h config.status config.h stamp-h b jit-reader.h gcore gstack gstack.in stamp-nmh > - rm -f gdb-gdb.py gdb-gdb.gdb > + rm -f gdb-gdb.gdb > rm -f y.output yacc.acts yacc.tmp y.tab.h > rm -f config.log config.cache > rm -f config.lt libtool > @@ -2494,9 +2494,6 @@ gstack gcore gdb-add-index: % : %.in version.c > sed -e "s,@VERSION@,$$vv," $< > $@ > @chmod +x $@ > > -gdb-gdb.py: $(srcdir)/gdb-gdb.py.in config.status > - $(ECHO_GEN) $(SHELL) config.status $(SILENT_FLAG) $@ > - > gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in config.status > $(ECHO_GEN) $(SHELL) config.status $(SILENT_FLAG) $@ > > diff --git a/gdb/configure b/gdb/configure > index 303d6ea011c..c95499df3f8 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -33715,7 +33715,9 @@ ac_config_files="$ac_config_files gstack.in:gstack-1.in" > > ac_config_files="$ac_config_files gdb-add-index.in:contrib/gdb-add-index.sh" > > -ac_config_files="$ac_config_files Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile" > +ac_config_files="$ac_config_files Makefile gdb-gdb.gdb doc/Makefile data-directory/Makefile" > + > +ac_config_links="$ac_config_links gdb-gdb.py:gdb-gdb.py" > > > cat >confcache <<\_ACEOF > @@ -34815,9 +34817,9 @@ do > "gdb-add-index.in") CONFIG_FILES="$CONFIG_FILES gdb-add-index.in:contrib/gdb-add-index.sh" ;; > "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; > "gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;; > - "gdb-gdb.py") CONFIG_FILES="$CONFIG_FILES gdb-gdb.py" ;; > "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; > "data-directory/Makefile") CONFIG_FILES="$CONFIG_FILES data-directory/Makefile" ;; > + "gdb-gdb.py") CONFIG_LINKS="$CONFIG_LINKS gdb-gdb.py:gdb-gdb.py" ;; > > *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; > esac > diff --git a/gdb/configure.ac b/gdb/configure.ac > index e55a733fba7..7ad12702786 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -2403,6 +2403,7 @@ GDB_AC_TRANSFORM([gcore], [GCORE_TRANSFORM_NAME]) > AC_CONFIG_FILES([gcore.in:gcore-1.in]) > AC_CONFIG_FILES([gstack.in:gstack-1.in]) > AC_CONFIG_FILES([gdb-add-index.in:contrib/gdb-add-index.sh]) > -AC_CONFIG_FILES([Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile]) > +AC_CONFIG_FILES([Makefile gdb-gdb.gdb doc/Makefile data-directory/Makefile]) > +AC_CONFIG_LINKS([gdb-gdb.py:gdb-gdb.py]) > > AC_OUTPUT > diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py > similarity index 100% > rename from gdb/gdb-gdb.py.in > rename to gdb/gdb-gdb.py > diff --git a/gdb/testsuite/gdb.gdb/python-helper.exp b/gdb/testsuite/gdb.gdb/python-helper.exp > index d1cca48cbb8..d84e4816699 100644 > --- a/gdb/testsuite/gdb.gdb/python-helper.exp > +++ b/gdb/testsuite/gdb.gdb/python-helper.exp > @@ -29,10 +29,16 @@ if { [build_executable "failed to build" $testfile $srcfile {debug c++}] } { > return > } > > +proc file_or_link {f} { > + set type [file type $f] > + return [expr {[string eq $type "file"] \ > + || [string eq $type "link"]}] > +} > + > # Find the helper script in the GDB build directory. > set py_helper_script [file dirname $GDB]/gdb-gdb.py > if { ![file readable $py_helper_script] \ > - || [file type $py_helper_script] != "file" } { > + || ![file_or_link $py_helper_script] } { > untested "failed to find gdb-gdb.py helper script" > return > } > > base-commit: f33422af6d81c623871f1407e2fce0794e90739a