dmd git master version

H. S. Teoh hsteoh at qfbox.info
Wed Oct 12 21:46:23 UTC 2022


On Wed, Oct 12, 2022 at 05:06:25PM -0400, Steven Schveighoffer via Digitalmars-d wrote:
> On 10/12/22 4:45 PM, H. S. Teoh wrote:
> 
> > Thanks for the tip. (Though I must say, it strikes me as a little
> > odd to key the version number off git tags, which are fluid and
> > arbitrarily-assigned, as opposed to actual source code that reflects
> > the actual functionality behind a particular version number...)
> 
> The main benefit is if you build with a non-tagged version, you can
> know exactly which commit caused your abomination to exist.

Including the git commit hash in the version number is generally a good
idea IMO.  But what strikes me as odd is keying the official release
version number on a git tag -- to the point that even __VERSION__
reports 2098L in spite of the compiler being functionally already
2.100.2.  This leads to potentially "interesting" effects when this
compiler is then used to compile code that checks __VERSION__ with
static if...  (This makes the 2.100.2 compiler insist that it's 2.098,
and even convince itself that it's 2.098, but functionally it's actually
2.100.2.)


> And also, git tags are somewhat fluid, but also pretty rigid, it takes
> a lot to delete them and update the server to the new one.
[...]

But when someone clones your repo and forgets to download the tags, you
end up with confused compilers who think they're a different version
from what they actually are. :-D


T

-- 
Just because you can, doesn't mean you should.


More information about the Digitalmars-d mailing list