| Message ID | 20260107145012.1873167-1-jwakely@redhat.com |
|---|---|
| State | New |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6CF9C4BA2E05 for <patchwork@sourceware.org>; Wed, 7 Jan 2026 14:51:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6CF9C4BA2E05 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JSMK9V0T X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 527304BA2E05 for <gcc-patches@gcc.gnu.org>; Wed, 7 Jan 2026 14:50:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 527304BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 527304BA2E05 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767797417; cv=none; b=CekfL2vP5gW4tupdlK4phbOA1rnv1XBumhMzXHzVdM9CsY8RXuLpQY6koyY0VztVFyqI0inlwhwEp76ySRpQc5EzmiDZjLe4oXNgF1eNtV7UscS8LYke56onZ9AWCyc/JGyaWDWHv+BXvD3nF8waoNHQCssxuRR5JO3txA0vSW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767797417; c=relaxed/simple; bh=fSNQ9hePwz7ki71v4ZkV/E5QkF75IQ0HgJLxvuKJUa8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=N/PcjCm4ohTJx6v0EkUzrJEwIV5mlixSZVcEjxhn2sJ9FfPnsgKs3pUzhO24D5xGIMrtmGHgeksnQuUbl2k50MSQGJkRJz2WE/X5cBl9dpop47Gp15Ly7R8LYUL4Fi7T2H2VM9qkX7HVAIgV0FApjAFtLou0dACv0Ggy7Hy7V68= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 527304BA2E05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767797417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3qEahI6SzQaSankKB6wAoE0LAeap3lZZyqsnWWD1BO4=; b=JSMK9V0ToJd8bf3fMjDMAMacPr8oB9upaFuSl/dTCfnKCFbgHskfid5ew8/Rwcxm0eB0jE 2IESW7ardAGFZYjQersfT0GZEot6fLnnC6LVjq//w884MgPq1MWd1mgtweFDZ+OuQ/HkGJ AJS19Rt4oViLv+Xo5kqPlZxauqXokpg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-f78sjLk6Mj2PMpoVAVbOvQ-1; Wed, 07 Jan 2026 09:50:15 -0500 X-MC-Unique: f78sjLk6Mj2PMpoVAVbOvQ-1 X-Mimecast-MFC-AGG-ID: f78sjLk6Mj2PMpoVAVbOvQ_1767797414 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 82784195423A; Wed, 7 Jan 2026 14:50:14 +0000 (UTC) Received: from zen.kayari.org (unknown [10.42.28.2]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8371219560A7; Wed, 7 Jan 2026 14:50:13 +0000 (UTC) From: Jonathan Wakely <jwakely@redhat.com> To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Subject: [PATCH] libstdc++: Allow new-abi-baseline target to overwrite existing file Date: Wed, 7 Jan 2026 14:46:56 +0000 Message-ID: <20260107145012.1873167-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8B1NhbX3lKuIA6c3R1dRd3mnq_Dv2NSwxvIFtBjip2U_1767797414 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
libstdc++: Allow new-abi-baseline target to overwrite existing file
|
|
Commit Message
Jonathan Wakely
Jan. 7, 2026, 2:46 p.m. UTC
There doesn't seem to be much benefit to writing the symbols to baseline_symbols.txt.new when an existing file is already present. It just adds a manual step for maintainers to move the .txt.new file to replace the .txt one. Overwriting the file directly allows you to use git diff to see what changed immediately, and you can easly use git commands to revert to the original file too. libstdc++-v3/ChangeLog: * testsuite/Makefile.am (new-abi-baseline): Overwrite existing file instead of creating baseline_symbols.txt.new. * testsuite/Makefile.in: Regenerate. --- Does anybody prefer the way it works now? I don't, but I'd like to hear from target maintainers who do most of the work to update the baseline files. Tested x86_64-linux. No doc updates needed as far as I can tell, we don't mention the .new file in the manual, we just say "written to a file under libsrcdir/config/abi/post/target/" libstdc++-v3/testsuite/Makefile.am | 8 +------- libstdc++-v3/testsuite/Makefile.in | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-)
Comments
Hi Jonathan, > There doesn't seem to be much benefit to writing the symbols to > baseline_symbols.txt.new when an existing file is already present. It > just adds a manual step for maintainers to move the .txt.new file to > replace the .txt one. Overwriting the file directly allows you to use > git diff to see what changed immediately, and you can easly use git > commands to revert to the original file too. > > libstdc++-v3/ChangeLog: > > * testsuite/Makefile.am (new-abi-baseline): Overwrite existing > file instead of creating baseline_symbols.txt.new. > * testsuite/Makefile.in: Regenerate. > --- > > Does anybody prefer the way it works now? I don't, but I'd like to hear > from target maintainers who do most of the work to update the baseline > files. I've one concern, though: sometimes you need to remove some changes from the regenerated baselines (don't have an examply handy, but am pretty sure this has happened in the past). If you make updating the baseline too easy, something like this might be missed more easily :-) Apart from that, no objections from me. Rainer
On Wed, 7 Jan 2026 at 15:00, Rainer Orth wrote: > > Hi Jonathan, > > > There doesn't seem to be much benefit to writing the symbols to > > baseline_symbols.txt.new when an existing file is already present. It > > just adds a manual step for maintainers to move the .txt.new file to > > replace the .txt one. Overwriting the file directly allows you to use > > git diff to see what changed immediately, and you can easly use git > > commands to revert to the original file too. > > > > libstdc++-v3/ChangeLog: > > > > * testsuite/Makefile.am (new-abi-baseline): Overwrite existing > > file instead of creating baseline_symbols.txt.new. > > * testsuite/Makefile.in: Regenerate. > > --- > > > > Does anybody prefer the way it works now? I don't, but I'd like to hear > > from target maintainers who do most of the work to update the baseline > > files. > > I've one concern, though: sometimes you need to remove some changes from > the regenerated baselines (don't have an examply handy, but am pretty > sure this has happened in the past). If you make updating the baseline > too easy, something like this might be missed more easily :-) I did consider that, because when I ran it to test the changes, 'git diff' showed the TLS symbols that we don't want to commit to the x86_64-pc-linux-gnu baseline. But I'm not sure if it really makes it too easy? I doubt anybody is copying individual changes from the .new file to the real one, surely they just do 'mv foo.txt.new foo.txt' and then use 'git diff', and in that case, they still need to manually remove some changes. It would only be a problem if people run the make target, then do git commit without checking the diff. But they could already do that today after mv'ing the file. I actually find it easier to remove individual changes using git, because I can do 'git diff add -p' to choose which changes to stage, then 'git restore --staged' to discard the unwanted changes from the working tree. And to do that, the existing file needs to have been overwritten by the new one. > Apart from that, no objections from me. > > Rainer > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University >
Hi Jonathan, >> I've one concern, though: sometimes you need to remove some changes from >> the regenerated baselines (don't have an examply handy, but am pretty >> sure this has happened in the past). If you make updating the baseline >> too easy, something like this might be missed more easily :-) > > I did consider that, because when I ran it to test the changes, 'git > diff' showed the TLS symbols that we don't want to commit to the > x86_64-pc-linux-gnu baseline. > > But I'm not sure if it really makes it too easy? I doubt anybody is > copying individual changes from the .new file to the real one, surely > they just do 'mv foo.txt.new foo.txt' and then use 'git diff', and in > that case, they still need to manually remove some changes. > > It would only be a problem if people run the make target, then do git > commit without checking the diff. But they could already do that today > after mv'ing the file. I'd hope this would be caught during review, though: I believe that even baseline updates need to go through patch review first, right? As I said: it not a serious concern, just something to think about. Rainer
On Wed, 7 Jan 2026 at 15:35, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote: > > Hi Jonathan, > > >> I've one concern, though: sometimes you need to remove some changes from > >> the regenerated baselines (don't have an examply handy, but am pretty > >> sure this has happened in the past). If you make updating the baseline > >> too easy, something like this might be missed more easily :-) > > > > I did consider that, because when I ran it to test the changes, 'git > > diff' showed the TLS symbols that we don't want to commit to the > > x86_64-pc-linux-gnu baseline. > > > > But I'm not sure if it really makes it too easy? I doubt anybody is > > copying individual changes from the .new file to the real one, surely > > they just do 'mv foo.txt.new foo.txt' and then use 'git diff', and in > > that case, they still need to manually remove some changes. > > > > It would only be a problem if people run the make target, then do git > > commit without checking the diff. But they could already do that today > > after mv'ing the file. > > I'd hope this would be caught during review, though: I believe that even > baseline updates need to go through patch review first, right? Right > > As I said: it not a serious concern, just something to think about. > > Rainer > > -- > ----------------------------------------------------------------------------- > Rainer Orth, Center for Biotechnology, Bielefeld University >
I've pushed this to trunk now. On Wed, 7 Jan 2026 at 15:42, Jonathan Wakely <jwakely@redhat.com> wrote: > > On Wed, 7 Jan 2026 at 15:35, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote: > > > > Hi Jonathan, > > > > >> I've one concern, though: sometimes you need to remove some changes from > > >> the regenerated baselines (don't have an examply handy, but am pretty > > >> sure this has happened in the past). If you make updating the baseline > > >> too easy, something like this might be missed more easily :-) > > > > > > I did consider that, because when I ran it to test the changes, 'git > > > diff' showed the TLS symbols that we don't want to commit to the > > > x86_64-pc-linux-gnu baseline. > > > > > > But I'm not sure if it really makes it too easy? I doubt anybody is > > > copying individual changes from the .new file to the real one, surely > > > they just do 'mv foo.txt.new foo.txt' and then use 'git diff', and in > > > that case, they still need to manually remove some changes. > > > > > > It would only be a problem if people run the make target, then do git > > > commit without checking the diff. But they could already do that today > > > after mv'ing the file. > > > > I'd hope this would be caught during review, though: I believe that even > > baseline updates need to go through patch review first, right? > > Right > > > > > As I said: it not a serious concern, just something to think about. > > > > Rainer > > > > -- > > ----------------------------------------------------------------------------- > > Rainer Orth, Center for Biotechnology, Bielefeld University > >
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am index 270b6886df4c..e8b6eb9e8ad4 100644 --- a/libstdc++-v3/testsuite/Makefile.am +++ b/libstdc++-v3/testsuite/Makefile.am @@ -84,13 +84,7 @@ baseline_symbols: new-abi-baseline: -@$(mkinstalldirs) ${baseline_dir}/${baseline_subdir} - -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \ - if test -f $${output}; then \ - output=$${output}.new; \ - t=`echo $${output} | sed 's=.*config/abi/=='`; \ - echo "Baseline file already exists, writing to $${t} instead."; \ - fi; \ - ${extract_symvers} ../src/.libs/libstdc++.so $${output}) + -@${extract_symvers} ../src/.libs/libstdc++.so ${baseline_dir}/${baseline_subdir}/baseline_symbols.txt %/site.exp: site.exp -@test -d $* || mkdir $* diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 65ec4e7fb146..3aed09d10492 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -645,13 +645,7 @@ baseline_symbols: new-abi-baseline: -@$(mkinstalldirs) ${baseline_dir}/${baseline_subdir} - -@(output=${baseline_dir}/${baseline_subdir}/baseline_symbols.txt; \ - if test -f $${output}; then \ - output=$${output}.new; \ - t=`echo $${output} | sed 's=.*config/abi/=='`; \ - echo "Baseline file already exists, writing to $${t} instead."; \ - fi; \ - ${extract_symvers} ../src/.libs/libstdc++.so $${output}) + -@${extract_symvers} ../src/.libs/libstdc++.so ${baseline_dir}/${baseline_subdir}/baseline_symbols.txt %/site.exp: site.exp -@test -d $* || mkdir $*