Bug 33549 - makeinfo drops hyphens from srcdir path
Summary: makeinfo drops hyphens from srcdir path
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-25 01:37 UTC by Daniel Richard G.
Modified: 2010-05-04 20:23 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Patch against 4.2.3 (215 bytes, patch)
2008-02-12 19:57 UTC, Daniel Richard G.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Richard G. 2007-09-25 01:37:53 UTC
The source tree in the below build is under /tmp/gcc-4.2.1--x---x----x/. Note how the path contains 1, then 2, then 3, then 4 hyphens.

----BEGIN BUILD LOG EXCERPT----
if [ xinfo = xinfo ]; then \
        makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000 --no-split -I . -I ../../gcc-4.2.1--x---x----x/gcc/doc \
                -I ../../gcc-4.2.1--x---x----x/gcc/doc/include -o doc/gcc.info ../../gcc-4.2.1--x---x----x/gcc/doc/gcc.texi; \
fi
../../gcc-4.2.1--x---x----x/gcc/doc//invoke.texi:1080: @include `../../gcc-4.2.1-x--x---x/gcc/../libiberty/at-file.texi': No such file or directory.
makeinfo: Removing output file `doc/gcc.info' due to errors; use --force to preserve.
make[3]: *** [doc/gcc.info] Error 1
make[3]: Leaving directory `/home/cport/tmp/gcc-build/gcc'
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/home/cport/tmp/gcc-build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/cport/tmp/gcc-build'
make: *** [bootstrap-lean] Error 2
----END BUILD LOG EXCERPT----

Makeinfo is looking for at-file.texi under an incorrect source path: each run of two or more hyphens in the path is shortened by one. I believe this is due to Texinfo's typographic syntax conventions being incorrectly applied to the @value{srcdir} substitution in invoke.texi.
Comment 1 Daniel Richard G. 2008-02-12 19:57:19 UTC
Created attachment 15133 [details]
Patch against 4.2.3

Proposed fix. Set the srcdir variable using @verb{}, to prevent interpretation of special character sequences (i.e. "--") in the path.
Comment 2 jsm-csl@polyomino.org.uk 2008-02-12 20:11:30 UTC
Subject: Re:  makeinfo drops hyphens from srcdir path

I think it's a bug in makeinfo that it does this, and should be fixed 
there.

In any case, patches to this code need testing with dvi or pdf output 
(which needs the latest 4.2 branch or trunk sources to have a recent 
enough texinfo.tex, and may need configuring with an absolute path at 
present).

Comment 3 Daniel Richard G. 2008-02-12 20:46:43 UTC
(In reply to comment #2)
> 
> I think it's a bug in makeinfo that it does this, and should be fixed 
> there.

That was my first thought as well, but consider that the conversion from "--" to "-" (and "---" to "--") makes sense from a typographic standpoint. A "--" is used to indicate an en-dash, which in Info is rendered as a plain hyphen, whereas a "---" is an em-dash, rendered as "--". Changing the Makeinfo behavior would affect the appearance of the final text.

Consider other cases, too: what if the srcdir path contains a "@"?
Comment 4 jsm-csl@polyomino.org.uk 2008-02-12 22:56:28 UTC
Subject: Re:  makeinfo drops hyphens from srcdir path

On Tue, 12 Feb 2008, skunk at iskunk dot org wrote:

> That was my first thought as well, but consider that the conversion from "--"
> to "-" (and "---" to "--") makes sense from a typographic standpoint. A "--" is
> used to indicate an en-dash, which in Info is rendered as a plain hyphen,
> whereas a "---" is an em-dash, rendered as "--". Changing the Makeinfo behavior
> would affect the appearance of the final text.

The Texinfo manual specifies that the @include path is taken literally 
apart from expanding @value references.  The typographical conversions 
need to be done at some later stage of makeinfo processing, not when the 
@set or @value or @include are processed.

> Consider other cases, too: what if the srcdir path contains a "@"?

In Texinfo language terms, the documentation implies that any "@", other 
than in @value{var} constructs, is taken literally in @include.

In GCC or Autoconf terms, I don't think srcdir containing @ is supported.  
Directory names need to consist entirely of safe characters; "--" should 
be a safe sequence, "@" probably isn't (because of Autoconf use if nothing 
else), characters such as :%$ that are significant to the shell or make 
definitely aren't safe.  (Some patches have gone into the latest git 
Autoconf to improve safety with funny characters, but even when GCC moves 
to a newer Autoconf I don't think there's much use supporting them in 
building GCC.)

Comment 5 Daniel Richard G. 2008-02-14 04:59:01 UTC
(In reply to comment #4)

Looks like Karl Berry agrees with you:

    http://lists.gnu.org/archive/html/bug-texinfo/2008-02/msg00014.html

I'd like to confirm a working GCC build with the fixed Texinfo before closing this bug.
Comment 6 Thomas Petazzoni 2010-05-04 11:44:58 UTC
FWIW, I'm still having this bug with gcc 4.3.4 :

/home/test/buildroot/output.arm-internal-br-2010-05-04--10-14-30/toolchain/gcc-4.3.4/gcc/doc//invoke.texi:1244: @include `/home/test/buildroot/output.arm-internal-br-2010-05-04-10-14-30/toolchain/gcc-4.3.4/gcc/../libiberty/at-file.texi': No such file or directory.

Notice how 

 output.arm-internal-br-2010-05-04--10-14-30 (which is the real existing path)

differs from

 output.arm-internal-br-2010-05-04-10-14-30
Comment 7 Daniel Richard G. 2010-05-04 20:23:52 UTC
Thomas, please have a look at your version of makeinfo(1).

I've confirmed that this is not a bug in GCC. Building GCC 4.4.3 with makeinfo 4.7 fails as I originally described, but building on a more recent system with makeinfo 4.13 succeeds.

Marking as invalid accordingly.