From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WAw5FYhTfWp4ECIAWB0awg (envelope-from ) for ; Thu, 13 Aug 2026 01:18:00 -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=cQeJDICN; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0CyJfq5W; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=yNNnTP/C; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ErmLYp6j; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 43B281E033; Thu, 13 Aug 2026 01:18:00 -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.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 2BF511E033 for ; Thu, 13 Aug 2026 01:17:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7407A4BA7984 for ; Thu, 13 Aug 2026 05:17:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7407A4BA7984 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=cQeJDICN; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0CyJfq5W; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=yNNnTP/C; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ErmLYp6j Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id B163F4BA23F9 for ; Thu, 13 Aug 2026 05:17:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B163F4BA23F9 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 B163F4BA23F9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786598250; cv=none; b=GTG3HgvLg30xaxXnYpFgesUgAybpaMWtmJlRiheDJgKUlbe2wX+0MhufRi9HN9aP6SPXcSXq/K3gsKzMljFMW3YKPeOm7jEf9xPCUciE7BeQQsM9rLqcXbzh2PevTAOAjp/8LXBcSIH3PbAE0Yxneu8zO1Sc5se6e/LrMK4UOIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786598250; c=relaxed/simple; bh=onePXZNRvbw9zrLX0PscudhwbQTMNOba54yOve3dOUk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=EotsC2DRbxOkdKfSTFNw7FsE3eUS4/mAi5q3c8JSNf9/PoQNoHQ11RhbHHEGp6TYSPbVT+z8SBTZ040Luac+luXxKZqyc/apoZe5slVNfnSYGJ5X33DSzflMy8/2GdFJtJFsUhB/YxyohufR3YEuk1Wpw8RxkZDbC0GFukaVxY4= 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=cQeJDICN; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0CyJfq5W; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=yNNnTP/C; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ErmLYp6j DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B163F4BA23F9 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 1ED303E54 for ; Thu, 13 Aug 2026 05:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1786598245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xtRMIVaYQ15/f5eugyMKAna0Iqy1N6dCG3EklsB40eM=; b=cQeJDICNC7X6/LsytUVFMAUrPCuF2eqgXz56zh4sil1G97ewJcKBgnU8aVqLBwRq2Ttscq RjMLDIWzAiJJeFlObgjkyYXRDM+/0l3g2rdbs9RYQqC6tctTWtvwUN6zKT8gElA+dIx4no vffbC6CNfwA7zzcWTEZPpyWB2/sQwkY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1786598245; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xtRMIVaYQ15/f5eugyMKAna0Iqy1N6dCG3EklsB40eM=; b=0CyJfq5WTVZuHd9mEcd7QGQ5luHBP6W3N8+0ay2bfwnJVrn6Kkw/TthfG6vK5xi6vHA9vT DQAzu9JkvPE/ERBA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="yNNnTP/C"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ErmLYp6j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1786598241; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xtRMIVaYQ15/f5eugyMKAna0Iqy1N6dCG3EklsB40eM=; b=yNNnTP/CAMKlLK+LkOXqXYjRdfNHacLgz3F6+bZ1gGuGTVMlP9lm8Vts+nRGp1zRyhwywb HFPX80rtv4KOx9buus5zhH0/2ukex92B6oZ4ble6JCUpG6mUjc5BR4xrA0A47US8MPpJgE DFabTZyeW76i04z1o8oVy93wiOKx4wo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1786598241; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xtRMIVaYQ15/f5eugyMKAna0Iqy1N6dCG3EklsB40eM=; b=ErmLYp6jF93EJttlZSPl9U1ir8b902svR1HNbOpY2UA6etx6VEs5gu9EjK5thNDauIGtDc ds6eypDPJFn5p+CA== 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 08A1977C4F for ; Thu, 13 Aug 2026 05:17:21 +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 JYi5AGFTfWqGTwAAD6G6ig (envelope-from ) for ; Thu, 13 Aug 2026 05:17:21 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/build] Rename gdb/gdb-gdb.py.in to gdb/gdb-gdb.py Date: Thu, 13 Aug 2026 07:17:20 +0200 Message-ID: <20260813051720.581528-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:dkim] X-Rspamd-Queue-Id: 1ED303E54 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action 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 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. 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 -- 2.51.0