public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Gerald Pfeifer <gerald@pfeifer.com>
Cc: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] update_web_docs_svn: support the JIT docs (PR jit/64257)
Date: Thu, 01 Jan 2015 00:00:00 -0000	[thread overview]
Message-ID: <1422290574.1463.38.camel@surprise> (raw)
In-Reply-To: <alpine.LSU.2.11.1501261235560.2527@tuna.site>

[-- Attachment #1: Type: text/plain, Size: 3055 bytes --]

On Mon, 2015-01-26 at 12:43 +0100, Gerald Pfeifer wrote:
> On Friday 2015-01-23 17:44, David Malcolm wrote:
> > The following patch builds and installs the JIT documentation for
> > the website (just HTML for now).
> > 
> > It's tricky to test (I don't have a copy of /www/gcc/bin/preprocess),
> > but I was able to use this to generate sane-looking documentation,
> > both for the .texi files, and for the JIT documentation.
> You can easily get the preprocess script by checking out wwwdocs,
> cf. https://gcc.gnu.org/about.html.

Thanks.

> That still will require MetaHTML which, sadly, became an abandoned
> FSF project, and will require a hack or two to build, so let's just
> go with your patch.
> 
> A few notes, though:
> 
> > maintainer-scripts/ChangeLog:
> > 	PR jit/64257
> > 	* update_web_docs_svn: Don't delete gcc/jit/docs,
> > 	since the jit docs are not .tex files (Makefile, .rst and
> > 	.png).	Special-case the building of the JIT docs (using
> > 	sphinx-build).  Special-case copying them up (since they
> > 	contain .css, .js and .png files in addition to .html, and
> > 	have nested subdirectories).
> 
> The "since" should be part of the code, not the ChangeLog.

Fair point; I've moved both of these to comments in the file.

> > diff --git a/maintainer-scripts/update_web_docs_svn b/maintainer-scripts/update_web_docs_svn
> > index c661220..c7eb890 100755
> > --- a/maintainer-scripts/update_web_docs_svn
> > +++ b/maintainer-scripts/update_web_docs_svn
> > +# The JIT is a special-case, using sphinx rather than texinfo.
> 
> special case

Fixed.

> > +# The jit Makefile uses "sphinx-build", which is packaged in
> > +# Fedora and EPEL 6 within "python-sphinx".
> 
> JIT (above) vs jit (here)?

I now use lowercase "jit" throughout.

> How about saying "...packaged in "python-sphinx" in Fedora and
> EPEL 6 and in "python-Sphinx" in openSUSE"?

Added.

> > +# Again, the jit is a special case, with nested subdirectories
> > +# below "jit", and with some non-HTML files (.png images from us,
> > +# plus .js and .css supplied by sphinx).
> > +for file in $(find jit \
> > +                -name "*.html" -o -name "*.css" \
> > +                -o -name "*.js" -o -name "*.png"); do
> 
> This looks like a Bash-ism.  Can you use backticks of something
> like 
> 
>   find ... | while read file; ...
> 
> ?

Done.

(Your proposal is superior since it avoids potentially long command
lines; but out of interest, why specifically avoid bash here?)

> > +    cp $file $DOCSDIR/$file
> 
> Just "cp $file $DOCSDIR/" ?  This one may be a better of style,
> but is easier to tweak in case we need to quote later on, for
> example.

The jit documentation has a nested directory structure (e.g. there are 7
instances of an "index.html" within them), "$file" actually will contain
a path to a file, so we do need to have $file on the right-hand side of
the cp command.

I've added a comment to clarify that.

I'm attaching a revised patch which I hope addresses these issues;
tested (crudely) as before.

How does this look?

Thanks
Dave

[-- Attachment #2: update_web_docs_svn-support-the-JIT-documention-v2.patch --]
[-- Type: text/x-patch, Size: 2741 bytes --]

From 7f7e15881981228e51b347f23df6e3106ddd68ea Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 23 Jan 2015 17:26:57 -0500
Subject: [PATCH] update_web_docs_svn: support the JIT documentation

maintainer-scripts/ChangeLog:
	* update_web_docs_svn: Don't delete gcc/jit/docs or
	gcc/jit/jit-common.h, gcc/jit/notes.txt. Special case the
	building of the jit docs (using sphinx-build).  Special case
	copying them up.
---
 maintainer-scripts/update_web_docs_svn | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/maintainer-scripts/update_web_docs_svn b/maintainer-scripts/update_web_docs_svn
index c661220..ac3bae6 100755
--- a/maintainer-scripts/update_web_docs_svn
+++ b/maintainer-scripts/update_web_docs_svn
@@ -111,11 +111,18 @@ fi
 # generator programs with the installed library, not the new one and
 # (b) to avoid packaging all the sources instead of only documentation
 # sources.
+# Note that we have to preserve gcc/jit/docs since the jit docs are
+# not .texi files (Makefile, .rst and .png), and the jit docs use
+# include directives to pull in content from jit/jit-common.h and
+# jit/notes.txt, so we have to preserve those also.
 find gcc -type f \( -name '*.texi' \
   -o -path gcc/gcc/doc/install.texi2html \
   -o -path gcc/gcc/doc/include/texinfo.tex \
   -o -path gcc/gcc/BASE-VER \
   -o -path gcc/gcc/DEV-PHASE \
+  -o -path "gcc/gcc/jit/docs/*" \
+  -o -path "gcc/gcc/jit/jit-common.h" \
+  -o -path "gcc/gcc/jit/notes.txt" \
   -o -print0 \) | xargs -0 rm -f
 
 # Build a tarball of the sources.
@@ -158,6 +165,16 @@ for file in $MANUALS; do
   fi
 done
 
+# The jit is a special-case, using sphinx rather than texinfo.
+# The jit Makefile uses "sphinx-build".  This is packaged in
+# Fedora and EPEL 6 within "python-sphinx", and in openSUSE
+# within "python-Sphinx".
+pushd gcc/gcc/jit/docs
+make html
+popd
+cp -a gcc/gcc/jit/docs/_build/html jit
+mkdir -p $DOCSDIR/jit
+
 # Work around makeinfo generated file names and references with
 # "_002d" instead of "-".
 find . -name '*.html' | while read f; do
@@ -204,6 +221,19 @@ for file in */*.html *.ps *.pdf *.tar; do
   fi
 done
 
+# Again, the jit is a special case, with nested subdirectories
+# below "jit", and with some non-HTML files (.png images from us,
+# plus .css and .js supplied by sphinx).
+find jit \
+    -name "*.html" -o -name "*.png" \
+    -o -name "*.css" -o -name "*.js" |
+  while read file ; do
+    # Note that $file here will contain path fragments beginning
+    # with "jit/", e.g. "jit/cp/topics/functions.html"
+    mkdir -p $(dirname $DOCSDIR/$file)
+    cp $file $DOCSDIR/$file
+  done
+
 cd $DOCSDIR
 
 # Finally, generate the installation documentation
-- 
1.8.5.3


  parent reply	other threads:[~2015-01-26 17:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-01  0:00 David Malcolm
2015-01-01  0:00 ` Gerald Pfeifer
2015-01-01  0:00   ` Mike Stump
2015-01-01  0:00   ` David Malcolm [this message]
2015-01-01  0:00     ` Jeff Law
2015-01-01  0:00       ` David Malcolm
2015-01-01  0:00         ` [PING, www] " David Malcolm
2015-01-01  0:00           ` Gerald Pfeifer
2015-01-01  0:00             ` [PATCH] More fixes for update_web_docs_svn for jit " David Malcolm
2015-01-01  0:00               ` Gerald Pfeifer
2015-01-01  0:00                 ` David Malcolm
2015-01-01  0:00                   ` Gerald Pfeifer
2015-01-01  0:00                     ` David Malcolm
2015-01-01  0:00                       ` [PATCH] maintainer-scripts: Fix 404s in "Show Source" in jit docs David Malcolm
2015-01-01  0:00                         ` Gerald Pfeifer
2015-01-01  0:00                       ` [PATCH] More fixes for update_web_docs_svn for jit docs (PR jit/64257) David Malcolm
2019-01-01  0:00                       ` Gerald Pfeifer
2015-01-01  0:00               ` Andrew Pinski

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=1422290574.1463.38.camel@surprise \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gerald@pfeifer.com \
    --cc=jit@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).