[Ur] PATCH: -version flags for urweb compiler

austin seipp as at hacks.yi.org
Tue Aug 2 20:14:11 EDT 2011


Er, there seems to be a slight err in the build when using the
.hg_archival.txt case - as an example case, when I use homebrew, and
build the source repository, it clones it, then archives that and
extracts it to a temporary directory for the build process. So it will
have the archival file as opposed to the actual repository info. But
when building, compilation fails like this:

libtool: install: chmod 644 /usr/local/Cellar/urweb/HEAD/lib/liburweb_static.a
libtool: install: ranlib /usr/local/Cellar/urweb/HEAD/lib/liburweb_static.a
/private/tmp/homebrew-urweb-HEAD-0xB0/libtool: line 5: node:: command not found
/private/tmp/homebrew-urweb-HEAD-0xB0/libtool: line 6: branch::
command not found
/private/tmp/homebrew-urweb-HEAD-0xB0/libtool: line 7: latesttag::
command not found
/private/tmp/homebrew-urweb-HEAD-0xB0/libtool: line 8:
latesttagdistance:: command not found
cat src/prefix.cm src/sources \
	>src/urweb.cm
cat src/prefix.mlb src/sources src/suffix.mlb \
	| sed -e 's/^\(.*\).grm$/\1.mlton.grm.sig:\1.mlton.grm.sml/' -e 'y/:/\n/' \
		-e 's/^\(.*\).lex$/\1.mlton.lex.sml/' \
	>src/urweb.mlb
cp src/urweb.lex src/urweb.mlton.lex
cp src/urweb.grm src/urweb.mlton.grm
mllex src/urweb.mlton.lex
mlyacc src/urweb.mlton.grm
mlyacc src/urweb.mlton.grm
5 reduce/reduce conflicts
2 shift/reduce conflicts
5 reduce/reduce conflicts
2 shift/reduce conflicts

Number of states = 519
Number of distinct rows = 350
Approx. memory size of trans. table = 716800 bytes
mlton -output bin/urweb src/compiler.mlb
Error: src/config.sml 23.22.
  Unclosed string.
Error: src/config.sml 23.22.
  Unclosed string.
Error: src/config.sml 23.22.
  Unclosed string.
Error: src/config.sml 23.22.
  Unclosed string.
compilation aborted: elaborate reported errors
make[1]: *** [bin/urweb] Error 1
make: *** [install-recursive] Error 1


This is because the .hg_archival.txt file looks like:

bash-3.2$ cat .hg_archival.txt
repo: 502c6d622477274934edbdef8cfb59d7f5418b23
node: a479947efbcd12d73f90ba968360cbee03923b93
branch: default
latesttag: null
latesttagdistance: 1521
bash-3.2$

Resulting in src/config.sml looking like this:

val versionNumber  = "20110715 + repo: 502c6d622477274934edbdef8cfb59d7f5418b23
node: a479947efbcd12d73f90ba968360cbee03923b93
branch: default
latesttag: null
latesttagdistance: 1521"
val versionString  = "The Ur/Web compiler, version " ^ versionNumber

resulting in build failure.

The correct fix is to make the version detection something like this:

VERSION="$VERSION + `hg identify || (cat .hg_archival.txt | grep
'node\:') || echo ?`"

On Tue, Aug 2, 2011 at 12:53 PM, austin seipp <as at hacks.yi.org> wrote:
> Awesome, thanks Adam!
>
> On Tue, Aug 2, 2011 at 12:36 PM, Adam Chlipala <adamc at impredicative.com> wrote:
>> austin seipp wrote:
>>>
>>> The compiler has never had a version flag, so attached is a patch that
>>> adds some support for build/compiler versions.
>>>
>>
>> Thanks!  I've pushed a changeset based on yours, but with a different
>> versioning scheme.  I'm including the latest release number in configure.ac,
>> along with code that, if this is marked as a $WORKING_VERSION, queries 'hg
>> identify' to get extra information to append afterward.
>>
>>
>> _______________________________________________
>> Ur mailing list
>> Ur at impredicative.com
>> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>>
>
>
>
> --
> Regards,
> Austin
>



-- 
Regards,
Austin



More information about the Ur mailing list