-
-
Notifications
You must be signed in to change notification settings - Fork 699
use git describe for development versions #6935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 2.075.0 | ||
| v2.074.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,25 +466,20 @@ $G/idgen: $D/idgen.d $(HOST_DMD_PATH) | |
| CC=$(HOST_CXX) $(HOST_DMD_RUN) -of$@ $< | ||
| $G/idgen | ||
|
|
||
| ######### | ||
| # STRING_IMPORT_FILES | ||
| # | ||
| # Create (or update) the generated VERSION file. | ||
| # The file is only updated if the VERSION file changes, or, only when RELEASE=1 | ||
| # is not used, when the full version string changes (i.e. when the git hash or | ||
| # the working tree dirty states changes). | ||
| # The full version string have the form VERSION-devel-HASH(-dirty). | ||
| # The "-dirty" part is only present when the repository had uncommitted changes | ||
| # at the moment it was compiled (only files already tracked by git are taken | ||
| # into account, untracked files don't affect the dirty state). | ||
| 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)) | ||
| ######## VERSION | ||
|
|
||
| VERSION := $(shell cat ../VERSION) # default to checked-in VERSION file | ||
| ifneq (1,$(RELEASE)) # unless building a release | ||
| VERSION_GIT := $(shell printf "`$(GIT) describe --dirty`") # use git describe | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| ifneq (,$(VERSION_GIT)) # check for git failures | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CircleCi failure for Phobos stable branches are due to
It looks like this applies to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just try it, e.g. changing describe to describes, it continues to run.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Did you nuke |
||
| VERSION := $(VERSION_GIT) | ||
| endif | ||
| endif | ||
|
|
||
| # only update $G/VERSION when it differs to avoid unnecessary rebuilds | ||
| $(shell test $(VERSION) != "`cat $G/VERSION 2> /dev/null`" \ | ||
| && printf $(VERSION) > $G/VERSION ) | ||
|
|
||
| $(shell test $(SYSCONFDIR) != "`cat $G/SYSCONFDIR.imp 2> /dev/null`" \ | ||
| && printf '$(SYSCONFDIR)' > $G/SYSCONFDIR.imp ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this line do the exact opposite of what the comment says?
In other places in the makefile
ifneq (,$(RELEASE))is used to check if this is a release is build.Wouldn't it make sense to always try
git describeto get the version number? It only returns the tag if the current HEAD is tagged.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's
ifneq (1,$(RELEASE))and I don't want to remove with the ability to overrideVERSIONfor releases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but going on the other use of RELEASE in the makefile it is 1 when building a release.
https://github.com/MartinNowak/dmd/blob/c28e2d8cfebfcc5b2fb8ee4b35bfb661314bc042/src/posix.mak#L178
So
ifneq (1,$(RELEASE))would indicate "Do this when not building a release", which doesn't match the comment. This would mean either the code or the comment is wrong.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says
unless building a release==if not building a release, no problem here.