dmd git master version

H. S. Teoh hsteoh at qfbox.info
Mon Oct 17 18:29:54 UTC 2022


On Thu, Oct 13, 2022 at 11:31:17AM -0400, Steven Schveighoffer via Digitalmars-d wrote:
> On 10/13/22 11:19 AM, H. S. Teoh wrote:
> > On Thu, Oct 13, 2022 at 10:51:25AM -0400, Steven Schveighoffer via Digitalmars-d wrote:
[...]
> > > The build should double check the VERSION file against the tag,
> > > and give an error when it doesn't match.
> > 
> > +1.
> 
> Looking at this monstrosity, I can't really understand why it's not
> writing the VERSION file anyway:
> 
> https://github.com/dlang/dmd/blob/61d7d56a0b82e049f45758bf3b4449fddda2cf96/compiler/src/build.d#L407-L446
> 
> Doesn't it seem like it compares the git tag to the text inside
> VERSION, and update VERSION if it's not the same?
[...]

Hmm.  It doesn't. `contents` is memoized to be either the current git
tag, or the contents of VERSION.  If the git tag doesn't match, then the
contents of VERSION is used instead.  The VERSION build rule then checks
of the contents of VERSION matches `contents` (which at this point, if
there wasn't a git tag, `contents` == the contents of VERSION). Only if
the two differ does VERSION get updated.

So if there is no git tag, VERSION doesn't get updated.


T

-- 
Computers aren't intelligent; they only think they are.


More information about the Digitalmars-d mailing list