cisco / ChezScheme

Chez Scheme
Apache License 2.0
6.91k stars 982 forks source link

c/build.zuo should call s/update-revision #747

Closed burgerrg closed 8 months ago

burgerrg commented 8 months ago

The revision file currently generated does not include the second line. Moreover, it fails to work properly if .git is removed. The s/update-revision script is designed to update itself when exported to an archive file. This update will work when .git is removed.

mflatt commented 8 months ago

It would be good to call s/update-revision in some way that works at a vanilla Windows command prompt. The current Zuo script assumes that a ".git" means that git can be expected in the path, so maybe a bash associated with git can be used?

burgerrg commented 8 months ago

Thanks, I had not considered the vanilla Windows case. Perhaps we need a s/update-revision.bat to be used on Windows?

burgerrg commented 8 months ago

Another option is to use the same trick in c/build.zuo that s/update-revision uses, which is to place it in .gitattributes with an export-subst. Let me try that.

burgerrg commented 8 months ago

The loop that looks for a .git folder doesn't handle submodules correctly, since in them .git is a regular file. To see this, create a new repository and add ChezScheme as a submodule.

burgerrg commented 8 months ago

Matthew, removing s/update-revision and putting the logic into c/build.zuo seems to work well on Unix-like systems and Windows. Please see what you think: https://github.com/cisco/ChezScheme/pull/748