New submission from Dave Malcolm <dmalc...@redhat.com>:

With hg/mercurial 0.9.3, the build of CPython fails with this error:

gcc -pthread -c -fno-strict-aliasing -g -O0 -Wall -Wstrict-prototypes    -I. 
-IInclude -I./Include    -DPy_BUILD_CORE \
              -DHGVERSION="\"`LC_ALL=C hg id -i .`\"" \
              -DHGTAG="\"`LC_ALL=C hg id -t .`\"" \
              -DHGBRANCH="\"`LC_ALL=C hg id -b .`\"" \
              -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
hg identify: option -i not recognized
hg identify: option -t not recognized
hg identify: option -b not recognized
./Modules/getbuildinfo.c: In function ‘Py_GetBuildInfo’:
./Modules/getbuildinfo.c:37: error: missing terminating " character
./Modules/getbuildinfo.c:37: error: expected expression before ‘)’ token
./Modules/getbuildinfo.c:38: error: missing terminating " character
./Modules/getbuildinfo.c:38: error: missing terminating " character
./Modules/getbuildinfo.c:39: error: missing terminating " character
./Modules/getbuildinfo.c:39: error: missing terminating " character
./Modules/getbuildinfo.c:45: error: ‘buildinfo’ undeclared (first use in this 
function)
./Modules/getbuildinfo.c:45: error: (Each undeclared identifier is reported 
only once
./Modules/getbuildinfo.c:45: error: for each function it appears in.)
./Modules/getbuildinfo.c:49: warning: control reaches end of non-void function
./Modules/getbuildinfo.c: In function ‘_Py_hgversion’:
./Modules/getbuildinfo.c:54: error: missing terminating " character
./Modules/getbuildinfo.c:54: warning: ‘return’ with no value, in function 
returning non-void
./Modules/getbuildinfo.c: In function ‘_Py_hgidentifier’:
./Modules/getbuildinfo.c:61: error: missing terminating " character
./Modules/getbuildinfo.c:61: error: expected expression before ‘;’ token
./Modules/getbuildinfo.c:65: error: missing terminating " character
./Modules/getbuildinfo.c:65: error: expected expression before ‘;’ token
make: *** [Modules/getbuildinfo.o] Error 1


What's happening is that "hg id" doesn't recognize the given options, and thus 
the various HG macros get set to insane multi-line strings containing usage 
information, but without quote characters, rather than to empty string literals 
[1].  This means that the post-processed code isn't valid C.

The workaround presumably is to upgrade to a more recent version of mercurial.  
I'm reporting this here in the bug tracker in case anyone else runs into this 
problem.

[1] Adding "-v" to the gcc invocation demonstrates that the values being passed 
are:

-DHGVERSION="hg identify

print information about the working copy

    Print a short summary of the current state of the repo.

    This summary identifies the repository state using one or two parent
    hash identifiers, followed by a "+" if there are uncommitted changes
    in the working directory, followed by a list of tags for this revision.

aliases: id" -DHGTAG="hg identify

print information about the working copy

    Print a short summary of the current state of the repo.

    This summary identifies the repository state using one or two parent
    hash identifiers, followed by a "+" if there are uncommitted changes
    in the working directory, followed by a list of tags for this revision.

aliases: id" -DHGBRANCH="hg identify

print information about the working copy

    Print a short summary of the current state of the repo.

    This summary identifies the repository state using one or two parent
    hash identifiers, followed by a "+" if there are uncommitted changes
    in the working directory, followed by a list of tags for this revision.

aliases: id"

----------
components: Build
messages: 132440
nosy: dmalcolm
priority: low
severity: normal
status: open
title: Build from hg fails with ancient hg version (0.9.3)
type: compile error
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to