public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: gcc-patches@gcc.gnu.org
Cc: Sam James <sam@gentoo.org>
Subject: [PATCH 2/4] maintainer-scripts/gcc_release: create index between snapshots <-> commits
Date: Thu,  2 Nov 2023 08:39:06 +0000	[thread overview]
Message-ID: <20231102084058.1142941-2-sam@gentoo.org> (raw)
In-Reply-To: <20231102084058.1142941-1-sam@gentoo.org>

Create and maintain a known_snapshots.txt index with space-separated format
BRANCH-DATE COMMIT.

For example:
8-20210107 5114ee0676e432493ada968e34071f02fb08114f
8-20210114 f9267925c648f2ccd9e4680b699e581003125bcf
...

This is helpful for bisects and quickly looking up the information from bug
reports.

maintainer-scripts/
	* gcc_release: Create known_snapshots.txt as an index between snapshots
	and commits.

Signed-off-by: Sam James <sam@gentoo.org>
---
Note that there's a few different approaches we can take here. I've gone
for the simpler one of having it still fetch from the remote site and parse
because it's obviously hard for me to test a part which runs on the remote
machine.

We can skip this patch for now if desired. I have mixed feelings about complicating
the contrib/generate_snapshot_index.py script to take an URL / path as I'd ideally
like it to still be easily usable locally.

We could have it be generated locally and then uploaded as well, as another option.

 maintainer-scripts/gcc_release | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/maintainer-scripts/gcc_release b/maintainer-scripts/gcc_release
index 962b8efe99a7..4cd1fa799660 100755
--- a/maintainer-scripts/gcc_release
+++ b/maintainer-scripts/gcc_release
@@ -448,6 +448,9 @@ announce_snapshot() {
   SNAPSHOT_INDEX=${RELEASE}/index.html
 
   changedir "${SNAPSHOTS_DIR}"
+  # Create an index if it doesn't already exist and populate it before we add
+  # the new snapshot.
+  ${PYTHON} ${SOURCE_DIRECTORY}/contrib/generate_snapshot_index.py || error "Failed to generate snapshot index"
   echo \
 "Snapshot gcc-"${RELEASE}" is now available on
   https://gcc.gnu.org/pub/gcc/snapshots/"${RELEASE}"/
@@ -514,6 +517,9 @@ Last modified "${TEXT_DATE}"
   rm -f LATEST-${BRANCH}
   ln -s ${RELEASE} LATEST-${BRANCH}
 
+  # Add the snapshot we just made to the index
+  printf "${RELEASE} ${GITREV}\n" >> known_snapshots.txt
+
   inform "Sending mail"
 
   export QMAILHOST=gcc.gnu.org
@@ -617,6 +623,7 @@ GZIP="${GZIP:-gzip --best}"
 SCP="${SCP:-scp -p}"
 SSH="${SSH:-ssh}"
 TAR="${TAR:-tar}"
+PYTHON="${PYTHON:-python3}"
 
 ########################################################################
 # Command Line Processing
-- 
2.42.0


  reply	other threads:[~2023-11-02  8:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02  8:39 [PATCH 1/4] contrib: add generate_snapshot_index.py Sam James
2023-11-02  8:39 ` Sam James [this message]
2023-11-02  9:07   ` [PATCH 2/4] maintainer-scripts/gcc_release: create index between snapshots <-> commits Jonathan Wakely
2023-11-02 10:18     ` Andreas Schwab
2023-11-02 10:25       ` Jonathan Wakely
2023-11-02 22:18         ` rep.dot.nop
2023-11-02  8:39 ` [PATCH 3/4] maintainer-scripts/gcc_release: use HTTPS for links Sam James
2023-11-02 18:59   ` Joseph Myers
2023-11-02  8:39 ` [PATCH 4/4] maintainer-scripts/gcc_release: cleanup whitespace Sam James
2023-11-02 19:00   ` Joseph Myers
2023-11-10 23:35     ` Sam James
2023-11-14  0:21       ` Joseph Myers

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=20231102084058.1142941-2-sam@gentoo.org \
    --to=sam@gentoo.org \
    --cc=gcc-patches@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).