CyberShadow / Digger

A tool to build D and bisect old D versions
Other
57 stars 9 forks source link

Digger uses last release tag for --version output when building `master + ...` #40

Closed AndrejMitrovic closed 8 years ago

AndrejMitrovic commented 8 years ago

Example:

$ digger build "master + dmd#6081"
$ C:\dev\digger-2.4-win32\result\bin\dmd.exe --version

DMD32 D Compiler v2.072.0

This is in contrast to building manually (at least on Linux):

$ /mnt/c/dev/digger-2.4-linux-64 $ ../../dev/d/dmd/src/dmd --version
$ DMD64 D Compiler v2.072.0-devel-313211c

Having the commit listed for non-release builds is useful to quickly determine which DMD is being currently invoked.

CyberShadow commented 8 years ago

I'm not sure what's going on here because Digger simply invokes make.

AndrejMitrovic commented 8 years ago

Right, it's not a digger issue sorry. It's a makefile issue (surprise!). :D

posix.mak:

VERSION := $(shell cat ../VERSION)
ifneq (1,$(RELEASE))
VERSION_GIT := $(shell printf "`$(GIT) rev-parse --short HEAD`"; \
       test -n "`$(GIT) status --porcelain -uno`" && printf -- -dirty)
VERSION := $(addsuffix -devel$(if $(VERSION_GIT),-$(VERSION_GIT)),$(VERSION))
endif
$(shell test \"$(VERSION)\" != "`cat verstr.h 2> /dev/null`" \
        && printf \"$(VERSION)\" > verstr.h )
$(shell test $(SYSCONFDIR) != "`cat SYSCONFDIR.imp 2> /dev/null`" \
        && printf '$(SYSCONFDIR)' > SYSCONFDIR.imp )

win32.mak:

verstr.h : ..\VERSION
    echo "$(..\VERSION)" >verstr.h
CyberShadow commented 8 years ago

Right, the build tag seems to be a Linux-Makefile-specific feature :)