From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id DCDF5384AB5E for ; Wed, 24 Apr 2024 09:07:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCDF5384AB5E Authentication-Results: sourceware.org; dmarc=pass (p=none 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 DCDF5384AB5E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713949684; cv=none; b=VfjOOjzsQgz9U+XJHceZUQ1lq9cL41nmPrDXViaEo7nlQDZSpPnkL9r17mhu3D8fXH+fYdwayY3W0gD+i8Szoci8x0uy+Bfmi4xjFBdoGzqyHgsS9475r2rDFdaocbUAzyt/QWdxJ1K6lX25uHsoHqfO3ZudJKydtj+SdwGxndo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713949684; c=relaxed/simple; bh=uf2sgiEbhaen6pp/8eVqwEkJZ9N0KT7urBkHzcHppDQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cHRuM+mkEKy4civQ1oQfNOgju5n8LWYnyE3tBky1gdOcBm0VxEAPShPARB7x8jrTzCdZRGT23tU5QviBCIbLvH9GsOBmtlDMgzBtEYIKvYv74UFyk2Whn6xs2a2W8eQf5hBfTjAKsyukzAGTLGzPw1ChXSIv8DqeEa30Ru83SwU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713949673; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=hYAUmfw1DVz0UTi+Oq9v5KIvx2ZA+p1sJkq1jfqiBMY=; b=ZMK8wzC9AzZTDfC8i/36v7h8F2npRM4a/dosK0WYuQbYLC/VXwecoA1Aw40UL8HnILcumR VwnMVeYBj9AHeyI3/T4CykjFVBQ50wWYKOPF9At+MHKHfgQ3NLJNW8OJUICaMlZK5JYxXh 7hMrhfMAbZW/0AFdra1pnzkdzRDbnBY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-263-Lah0dX-INlqT1UVJLm4njA-1; Wed, 24 Apr 2024 05:07:46 -0400 X-MC-Unique: Lah0dX-INlqT1UVJLm4njA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3DC42811029 for ; Wed, 24 Apr 2024 09:07:44 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8523492BC7; Wed, 24 Apr 2024 09:07:43 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 43O97gai1328958 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 24 Apr 2024 11:07:42 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 43O97fFG1328957; Wed, 24 Apr 2024 11:07:41 +0200 Date: Wed, 24 Apr 2024 11:07:41 +0200 From: Jakub Jelinek To: David Malcolm Cc: Mark Wielaard , gcc-patches@gcc.gnu.org Subject: [PATCH] v2: DOCUMENTATION_ROOT_URL vs. release branches [PR114738] Message-ID: Reply-To: Jakub Jelinek References: <8ddbfe0ab367bd1c7dd8d47fe894028f84ed5fe9.camel@redhat.com> MIME-Version: 1.0 In-Reply-To: <8ddbfe0ab367bd1c7dd8d47fe894028f84ed5fe9.camel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Apr 23, 2024 at 07:07:17PM -0400, David Malcolm wrote: > That sounds like a better approach; thanks. Attached below. Tested by checking ../configure --disable-bootstrap --enable-languages=c --disable-multilib built trunk on void foo (int x) { __builtin_printf ("%ld\n", x); } testcase and looking for the URL in there, then repeating that after changing gcc/BASE-VER to 14.1.0 and again after changing it to 14.1.1 > > Still, what do you think we should do on the release branches > > (recommend to > > developers and check with the post-commit CI)? > > My hope is that the URL suffixes don't change: we shouldn't be adding > new command-line options on the release branches, and I'd hope that > texinfo doesn't change the generated anchors from run to run. Unfortunately that is not the case. *.opt files change all the time on release branches. Sure, not all the changes in there would cause *.urls changes, but many of them would. E.g. looking at 13 branch, r13-7022 r13-7130 r13-7169 r13-7276 r13-7336 r13-7415 r13-7518 r13-7528 r13-7650 r13-7651 r13-7728 r13-7794 r13-8039 r13-8040 r13-8223 r13-8350 r13-8351 r13-8357 r13-8419 r13-8545 commits changed the *.opt files. > > No regeneration of *.urls except before doing a new release > > candidate, > > or a different make goal that would grab html files from the web and > > regenerate against that? > > That sounds overcomplicated. > > If the anchors do change, it's fairly trivial to run "make regenerate- > opt-urls" locally, isn't it? I think the primary question is, do we want the *.urls checking CI on the release branches as well or only on the trunk? Given the xz backdoor, I think checking release branches for the regeneration hiccups (primarily for configure, Makefile etc.) is desirable. And with the patch posted here (or with what I've committed a week ago) on the release branches the default root will be initially identical but after some commits starts diverging. If we can live with some URLs being stale or misplaced until next release in the default case (if people provide their own root it will be always accurate), we don't need to do anything further (except perhaps enable the autoregen CI on 14 branch). 2024-04-24 Jakub Jelinek PR other/114738 * opts.cc (get_option_url): Revert 2024-04-17 changes. * gcc-urlifier.cc: Don't include diagnostic-core.h. (gcc_urlifier::make_doc_url): Revert 2024-04-17 changes. * configure.ac (documentation-root-url): On release branches append gcc-MAJOR.MINOR.0/ to the default DOCUMENTATION_ROOT_URL. * doc/install.texi (--with-documentation-root-url=): Document the change of the default. * configure: Regenerate. --- gcc/opts.cc.jj 2024-04-17 16:17:19.537749951 +0200 +++ gcc/opts.cc 2024-04-24 09:53:01.300399491 +0200 @@ -3761,19 +3761,7 @@ get_option_url (const diagnostic_context { label_text url_suffix = get_option_url_suffix (option_index, lang_mask); if (url_suffix.get ()) - { - char infix[32]; - /* On release branches, append to DOCUMENTATION_ROOT_URL the - subdirectory with documentation of the latest release made - from the branch. */ - if (BUILDING_GCC_MINOR != 0 && BUILDING_GCC_PATCHLEVEL <= 1U) - sprintf (infix, "gcc-%u.%u.0/", - BUILDING_GCC_MAJOR, BUILDING_GCC_MINOR); - else - infix[0] = '\0'; - return concat (DOCUMENTATION_ROOT_URL, infix, url_suffix.get (), - nullptr); - } + return concat (DOCUMENTATION_ROOT_URL, url_suffix.get (), nullptr); } return nullptr; --- gcc/gcc-urlifier.cc.jj 2024-04-17 16:17:19.538749937 +0200 +++ gcc/gcc-urlifier.cc 2024-04-24 09:53:01.299399505 +0200 @@ -26,7 +26,6 @@ along with GCC; see the file COPYING3. #include "gcc-urlifier.h" #include "opts.h" #include "options.h" -#include "diagnostic-core.h" #include "selftest.h" namespace { @@ -209,16 +208,7 @@ gcc_urlifier::make_doc_url (const char * if (!doc_url_suffix) return nullptr; - char infix[32]; - /* On release branches, append to DOCUMENTATION_ROOT_URL the - subdirectory with documentation of the latest release made - from the branch. */ - if (BUILDING_GCC_MINOR != 0 && BUILDING_GCC_PATCHLEVEL <= 1U) - sprintf (infix, "gcc-%u.%u.0/", - BUILDING_GCC_MAJOR, BUILDING_GCC_MINOR); - else - infix[0] = '\0'; - return concat (DOCUMENTATION_ROOT_URL, infix, doc_url_suffix, nullptr); + return concat (DOCUMENTATION_ROOT_URL, doc_url_suffix, nullptr); } } // anonymous namespace --- gcc/configure.ac.jj 2024-04-17 16:09:49.697031449 +0200 +++ gcc/configure.ac 2024-04-24 10:41:01.189687856 +0200 @@ -1088,9 +1088,16 @@ AC_ARG_WITH(documentation-root-url, no) AC_MSG_ERROR([documentation root URL not specified]) ;; */) DOCUMENTATION_ROOT_URL="$withval" ;; *) AC_MSG_ERROR([documentation root URL does not end with /]) ;; - esac], - DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/" -) + esac],[ + docroot_url_suffix= +changequote(,)dnl + case "$gcc_version" in + *.[123456].0) docroot_url_suffix="gcc-$gcc_version/";; + *.[123456].1) docroot_url_suffix="gcc-`echo $gcc_version | sed 's/1$/0/'`/";; + esac +changequote([,])dnl + DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/$docroot_url_suffix" +]) AC_DEFINE_UNQUOTED(DOCUMENTATION_ROOT_URL,"$DOCUMENTATION_ROOT_URL", [Define to the root for documentation URLs.]) --- gcc/doc/install.texi.jj 2024-04-09 08:12:29.384449669 +0200 +++ gcc/doc/install.texi 2024-04-24 10:03:54.856143097 +0200 @@ -764,7 +764,9 @@ The default value refers to the FSF's GC Specify the URL root that contains GCC option documentation. The @var{url} should end with a @code{/} character. -The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/}. +The default value is @uref{https://gcc.gnu.org/onlinedocs/,,https://gcc.gnu.org/onlinedocs/} +on the GCC main development trunk. On release branches, the default +is @code{https://gcc.gnu.org/onlinedocs/gcc-@var{major}.@var{minor}.0/}. @item --with-changes-root-url=@var{url} Specify the URL root that contains information about changes in GCC --- gcc/configure.jj 2024-02-23 18:54:37.914974922 +0100 +++ gcc/configure 2024-04-24 10:41:07.667596458 +0200 @@ -8232,7 +8232,13 @@ if test "${with_documentation_root_url+s *) as_fn_error $? "documentation root URL does not end with /" "$LINENO" 5 ;; esac else - DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/" + + docroot_url_suffix= + case "$gcc_version" in + *.[123456].0) docroot_url_suffix="gcc-$gcc_version/";; + *.[123456].1) docroot_url_suffix="gcc-`echo $gcc_version | sed 's/1$/0/'`/";; + esac + DOCUMENTATION_ROOT_URL="https://gcc.gnu.org/onlinedocs/$docroot_url_suffix" fi @@ -21569,7 +21575,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21572 "configure" +#line 21578 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -21675,7 +21681,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 21678 "configure" +#line 21684 "configure" #include "confdefs.h" #if HAVE_DLFCN_H Jakub