public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 0/3] Option handling: add documentation URLs
Date: Wed, 15 Nov 2023 17:50:52 -0500	[thread overview]
Message-ID: <af6a1c1329e4da63e691de1a1f48f72a19ac66d7.camel@redhat.com> (raw)
In-Reply-To: <ad6ecf84-8846-167-9ab6-352837214526@codesourcery.com>

On Tue, 2023-11-14 at 00:12 +0000, Joseph Myers wrote:
> On Fri, 10 Nov 2023, David Malcolm wrote:
> 
> > The .opt.urls files it generates become part of the source tree,
> > and
> > would be regenerated by maintainers whenever new options are added.
> > Forgetting to update the files (or not having Python 3 handy)
> > merely
> > means that URLs might be missing or out of date until someone else
> > regenerates them.
> 
> Do I understand correctly that there are no makefile targets to
> regenerate 
> these files; it's up to maintainers to regenerate them manually?
> 
> Advantages:
> 
> * No need to update contrib/gcc_update to handle timestamps for the
> files.
> 
> * No modifications unexpectedly appearing in source trees, if the
> checked 
> in files are out of date and you run a build with the timestamps such
> that 
> the file gets regenerated.

The .opt.urls are generated from the generated HTML.  I think this
needs to be a manually-triggered process, otherwise the optionlist
depends on the generated HTML, and thus the generated HTML would become
a hard early dependency during the build (which I don't think we would
want).

> 
> Disadvantages:
> 
> * You need to know how to do the regeneration manually; "make" is the
> uniform way for generating any file the build system can generate,
> without 
> needing more specific knowledge about that file.

In the patches I posted I merely listed the commands in a comment in
the script, but I'm currently working on adding support for options
from the gdc and gfortran docs, and in doing so found that running the
script with the correct options was a pain.

So to make it easier, I'm currently thinking of adding this convenience
target, so that when a maintainer does decide to regenerate the
.opt.urls, they can simply type "make regenerate-opt-urls" in the gcc
build subdir:

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c3ed960b8f3c..6d24b7b9db34 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3616,6 +3616,12 @@ $(build_htmldir)/gccinstall/index.html: $(TEXI_GCCINSTALL_FILES)
        DESTDIR=$(@D) \
        $(SHELL) $(srcdir)/doc/install.texi2html
 
+# Regenerate the .opt.urls files from the generated html, and from the .opt
+# files.
+.PHONY: regenerate-opt-urls
+regenerate-opt-urls:
+       $(srcdir)/regenerate-opt-urls.py $(build_htmldir) $(shell dirname $(srcdir))
+
 MANFILES = doc/gcov.1 doc/cpp.1 doc/gcc.1 doc/gfdl.7 doc/gpl.7 \
            doc/fsf-funding.7 doc/gcov-tool.1 doc/gcov-dump.1 \
           $(if $(filter yes,@enable_lto@),doc/lto-dump.1)


> 
> Given the recent discussion starting at 
> <https://gcc.gnu.org/pipermail/gcc/2023-November/242835.html> of 
> post-commit CI to detect auto*-generated files that aren't fully up
> to 
> date, maybe it would be appropriate to add a check for .opt.urls
> files 
> being up to date (including making sure that each .opt file does have
> a 
> corresponding .opt.urls file checked in) to that CI?
> 
> Since the Python script has hardcoded information about .opt files
> and 
> corresponding URLs for target options documentation, the patch series
> should update sourcebuild.texi, section "Back End", to identify that 
> script as one of the places to update when adding a new target back
> end.

Thanks, will do.

As mentioned, I'm currently investigating capturing per-language option
URLs (to address Iain's and Marc's comments about D and Ada); if I get
that working, I may need to add a similar note for adding a new
frontend.

Hope the overall approach seems reasonable.
Dave


  reply	other threads:[~2023-11-15 22:50 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 21:42 David Malcolm
2023-11-10 21:42 ` [PATCH 1/3] options: add gcc/regenerate-opt-urls.py David Malcolm
2023-11-10 21:42 ` [PATCH 2/3] Add generated .opt.urls files David Malcolm
2023-11-12 10:56   ` Iain Buclaw
2023-11-13 14:07     ` David Malcolm
2023-11-13 13:11   ` Marc Poulhiès
2023-11-13 14:07     ` David Malcolm
2023-11-13 16:02       ` Marc Poulhiès
2023-12-19 14:47         ` Marc Poulhiès
2023-11-10 21:42 ` [PATCH 3/3] diagnostics: use the .opt.urls files to urlify quoted text David Malcolm
2023-11-14 17:44   ` Arthur Cohen
2023-11-14  0:12 ` [PATCH 0/3] Option handling: add documentation URLs Joseph Myers
2023-11-15 22:50   ` David Malcolm [this message]
2023-11-15 23:40     ` Joseph Myers
2023-11-16 14:28       ` [PATCH 0/4] v2 of " David Malcolm
2023-11-16 14:28         ` [PATCH 1/4] options: add gcc/regenerate-opt-urls.py David Malcolm
2023-11-16 14:28         ` [PATCH 2/4] Add generated .opt.urls files David Malcolm
2023-11-16 14:28         ` [PATCH 3/4] opts: add logic to generate options-urls.cc David Malcolm
2023-11-16 14:28         ` [PATCH 4/4] options: wire up options-urls.cc into gcc_urlifier David Malcolm
2023-11-21  1:09         ` [PATCH 0/4] v2 of Option handling: add documentation URLs Hans-Peter Nilsson
2023-11-21 13:57           ` David Malcolm
2023-11-21 14:12             ` Tobias Burnus
2023-11-21 15:23               ` David Malcolm
2023-11-21 23:43               ` Joseph Myers
2023-12-08 23:35                 ` David Malcolm
2023-12-10 23:35                   ` Mark Wielaard
2023-12-14 15:01                     ` [PATCH 0/4] v3 of: " David Malcolm
2023-12-14 15:01                       ` [PATCH 1/4; v3] options: add gcc/regenerate-opt-urls.py David Malcolm
2023-12-20  0:24                         ` Joseph Myers
2023-12-14 15:01                       ` [PATCH 2/4; v3] Add generated .opt.urls files David Malcolm
2023-12-14 15:01                       ` [PATCH 3/4; v2] opts: add logic to generate options-urls.cc David Malcolm
2023-12-14 15:01                       ` [PATCH 4/4; v2] options: wire up options-urls.cc into gcc_urlifier David Malcolm
2023-12-15  0:59                       ` [PATCH 0/4] v3 of: Option handling: add documentation URLs Mark Wielaard
2023-12-15 14:47                         ` David Malcolm
2024-01-04 14:57                         ` CI for "Option handling: add documentation URLs" David Malcolm
2024-02-18 22:58                           ` Mark Wielaard
2024-02-19 11:38                             ` Mark Wielaard
2024-02-22  3:57                             ` YunQiang Su
2024-02-24 17:42                               ` Mark Wielaard
2024-03-03 20:04                                 ` Mark Wielaard
2024-03-04 13:48                                   ` David Malcolm
2024-03-05 12:06                                     ` Mark Wielaard
2024-03-05 13:34                                       ` David Malcolm
2024-03-05 20:24                                         ` Mark Wielaard
2024-03-15  7:33                                           ` YunQiang Su
2024-03-15 10:06                                             ` Mark Wielaard
2023-12-20  0:28                       ` [PATCH 0/4] v3 of: Option handling: add documentation URLs 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=af6a1c1329e4da63e691de1a1f48f72a19ac66d7.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /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).