From: sfeam <sf...@us...> - 2018-01-30 06:13:41
|
On Monday, 29 January 2018 21:46:20 Dima Kogan wrote: > sfeam via gnuplot-beta <gnu...@li...> writes: > > > Shige Takeno points out (Bug #2016) that ./prepare; ./configure; make > > is currently not working if you start with a git snapshot downloaded > > from SourceForge. That's because the snapshot is a *.zip file that > > doesn't include the git metadata, so the attempt to create > > timestamp.h by querying git cannot work. > > > > I wonder if we have control over the script on sf.net that creates > > a snapshot? Maybe that script could generate timestamp.h on the fly? > > > > Another possibility is to assume that anyone downloading a snapshot > > will unpack it immediately, in which case the timestamp can be the > > creation date of the top level source directory. > > I want to say we're doing something we shouldn't be doing, but I can't > quite figure out what's happening. The bug report is here: > https://sourceforge.net/p/gnuplot/bugs/2016/ > > The reporter says he sees this barf: > > cut: ../.git/HEAD: No such file or directory > make: *** No rule to make target ../.git/', needed bytimestamp.h'. Stop. > > The timestamp.h rule I see is this: > > timestamp.h: $(top_srcdir)/ChangeLog Makefile > @echo Making $@ > @echo "#ifndef GNUPLOT_TIMEBASE_H_INCLUDED" >$@t > @echo "#define GNUPLOT_TIMEBASE_H_INCLUDED" >>$@t > @head -1 $< | sed -e 's,\(^[0-9-]* \).*$$,const char gnuplot_date[] = "\1";,' >>$@t > @echo "#endif /* GNUPLOT_TIMEBASE_H_INCLUDED */" >> $@t > @if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi I get the same failure here. But I see a different Makefile ruleset BUILT_SOURCES = timestamp.h git_current := $(shell cut -c6- $(top_srcdir)/.git/HEAD) timestamp.h: $(top_srcdir)/.git/${git_current} Makefile @echo Making $@ @echo "#ifndef GNUPLOT_TIMEBASE_H_INCLUDED" >$@t @echo "#define GNUPLOT_TIMEBASE_H_INCLUDED" >>$@t @echo "const char gnuplot_date[] = \"`git log -1 --format=%ci | cut -b-11`\";" >>$@t @echo "#endif /* GNUPLOT_TIMEBASE_H_INCLUDED */" >> $@t @if cmp -s $@ $@t; then rm -f $@t; else mv $@t $@; fi > > What is invoking cut and touching git? I don't see it. Your Makefile seems to be from last year sometime. We used to generate timestamp.h from ChangeLog, but git and ChangeLog do not play nicely together so Bastian modified it to query the git metadata: %%%%%%%%%%%% commit dd0c5adaa6386470b207838b4296491bb0b15ac3 Author: Bastian Maerkisch <bma...@we...> Date: Tue Dec 26 11:10:52 2017 +0100 Generate timestamp from last git commit date Generation of the timestamp relied on the latest date in the ChangeLog. This may no longer be correct. Instead, we now query git for the last commit date. Only works for development builds from a git checkout, but for release builds the date is hard-coded in src/version.c. %%%%%%%%%%%% Unfortunately the new mechanism covers building from git and building from a release tarball but not building from an auto-generated snapshot. Ethan |