Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Build fails with syntax error on git.rc #14

Closed
mcknz opened this issue May 30, 2012 · 15 comments
Closed

Build fails with syntax error on git.rc #14

mcknz opened this issue May 30, 2012 · 15 comments

Comments

@mcknz
Copy link

mcknz commented May 30, 2012

Appears to be related to issue #10 bd81699 -- not sure what the issue is, but I just commented out lines 2 and 3 and it built fine on Windows 8 x64.

@sschuberth
Copy link

Please copy & paste the exact error message here, and comment on whether you're using GCC or MSVC to compile (we are aware that the latter is currently broken with respect to adding the version information to the RC file; patches welcome).

@mcknz
Copy link
Author

mcknz commented May 30, 2012

I'm getting the following when running msysGit-netinstall-1.7.10-preview20120409:

    CC xdiff/xhistogram.o
    AR xdiff/lib.a
    RC git.res
C:\msysgit\mingw\bin\windres.exe: git.rc:2: syntax error
make: *** [git.res] Error 1

When I remove these lines from git.rc and run msys.bat, the build completes:

//FILEVERSION     MAJOR,MINOR,PATCH,0
//PRODUCTVERSION  MAJOR,MINOR,PATCH,0

I can submit a patch with those lines removed but not sure if that completely solves the problem. Are those just MSVC artifacts?

@dscho
Copy link
Member

dscho commented May 30, 2012

@mcknz no. Something else is going on on your side. MAJOR, MINOR and PATCH are expected to be replaced by the make process. You need to dig much deeper, probably using "make V=1".

@mcknz
Copy link
Author

mcknz commented May 30, 2012

thanks -- will dig.

@patthoyts
Copy link
Member

Try
$ rm -f git.res && make V=1 git.res
windres -O coff
-DMAJOR=1 -DMINOR=7 -DPATCH=11
-DGIT_VERSION="\"1.7.11.rc0.6836.gdf573d9\"" git.rc -o git.res

@dscho
Copy link
Member

dscho commented May 30, 2012

@mcknz Thanks, very very much appreciated!

@postiffm
Copy link

I'm a newbie, sorry if this is not very relevant.
@patthoyts If -DPATCH=11, the build works. If -DPATCH=11-rc0, the build fails.
I guess PATCH wants an integer?

$ make V=1 git.res
windres -O coff
-DMAJOR=1 -DMINOR=7 -DPATCH=11-rc0
-DGIT_VERSION="\"1.7.11-rc0\"" git.rc -o git.res
C:\msysgit\mingw\bin\windres.exe: git.rc:2: syntax error
make: *** [git.res] Error 1

(I downloaded msysGit-netinstall-1.7.10-preview20120409.exe earlier today; building on Windows 7).

@dscho
Copy link
Member

dscho commented May 31, 2012

@postiffm I think you identified the problem, alright. Could you replace the line in the Makefile

$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst ., ,$(GIT_VERSION))))

with this and test again?

$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst ., ,$(firstword $(subst -, ,$(GIT_VERSION))))))

Thanks!

@dscho
Copy link
Member

dscho commented May 31, 2012

Actually, I take that back... ;-)

I just tested here and the GIT_VERSION is '1.7.11.rc0.6836.gdf573d9' as for you, which $(wordlist ...) should interpret as the (1/7/11) triplet that windres needs.

How did your GIT_VERSION become '1.7.11-rc0' (note the dash)?

@postiffm
Copy link

Hi--I don't know how the '-rc0' got into the GIT_VERSION. All I did was
download the package from google code, run it, and it took off doing its
own bootstrap thing. The build failed at windres and that's when I
contacted you. I will be back at my desk later and can look into it
further. --Matt

On 5/31/2012 2:40 AM, dscho wrote:

Actually, I take that back... ;-)

I just tested here and the GIT_VERSION is '1.7.11.rc0.6836.gdf573d9' as for you, which $(wordlist ...) should interpret as the (1/7/11) triplet that windres needs.

How did your GIT_VERSION become '1.7.11-rc0' (note the dash)?


Reply to this email directly or view it on GitHub:
#14 (comment)

dscho added a commit that referenced this issue May 31, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented May 31, 2012

@postiffm it should be fixed in this commit: e6ada76

Thanks for reporting and working with us to fix the bug!

@dscho dscho closed this as completed May 31, 2012
@postiffm
Copy link

@dscho Thanks. I tested by doing another from-scratch install and it worked.

I noticed during the build process:


Building and Installing Git

GIT_VERSION = 1.7.11-rc0
* new build flags or prefix
CC credential-store.o
* new link flags
CC abspath.o
...

during the build, my GIT-VERSION-FILE has

GIT_VERSION = 1.7.11-rc0

but after the build, it has

$ cat GIT-VERSION-FILE
GIT_VERSION = 1.7.11.rc0.6837.ge6ada76

and

$ git --version
git version 1.7.11-rc0

So is the bug /really/ fixed?

@dscho
Copy link
Member

dscho commented May 31, 2012

@postiffm yep, I think this is due to Git not being installed yet when the initial build is running.

@postiffm
Copy link

Evidently the shell script GIT-VERSION-GEN uses the DEF_VER during the
build process. That variable is initialized to v1.7.11-rc0.

The script doesn't find a 'version' file, and it has no git to run for
the elif clause, so the else prevails. You could possibly put something
like this in the else clause:

VN=$(echo "$DEF_VER" | sed -e 's/-/./g');

to remove the dash from the version number.

Or just change DEF_VER...but I really don't know what I'm talking about
there, so maybe not :-)

--Matt

On 5/31/2012 4:03 PM, dscho wrote:

@postiffm yep, I think this is due to Git not being installed yet when the initial build is running.


Reply to this email directly or view it on GitHub:
#14 (comment)


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1424 / Virus Database: 2425/5036 - Release Date: 05/31/12

@dscho
Copy link
Member

dscho commented May 31, 2012

@postiffm I went the path of less resistance (instead of changing things that we might eventually get into upstream git.git where such small changes are usually met with fiercely clenched fists ;-): I changed the way we munge the version when compiling the resources. (See the link I posted in my closing comment.)

dscho added a commit that referenced this issue Jun 5, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Jun 20, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Oct 2, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Oct 23, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Dec 3, 2012
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Jan 4, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Jan 16, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Feb 1, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue May 26, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue May 29, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this issue Jun 7, 2013
Reported by postiffm as issue #14.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho referenced this issue in dscho/git Nov 7, 2014
Adjust README.md to reflect the new Git for Windows home
t-b added a commit to t-b/git that referenced this issue Nov 27, 2014
Adjust README.md to reflect the new Git for Windows home
dscho referenced this issue in dscho/git Feb 22, 2015
Adjust README.md to reflect the new Git for Windows home
dscho referenced this issue in dscho/git Mar 4, 2015
Add a README.md for GitHub goodness.
dscho referenced this issue in dscho/git Mar 5, 2015
Add a README.md for GitHub goodness.
dscho referenced this issue in dscho/git Mar 6, 2015
Add a README.md for GitHub goodness.
dscho referenced this issue in dscho/git Mar 20, 2015
Add a README.md for GitHub goodness.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants