digitalmars.D - dmd git master version
- H. S. Teoh (9/9) Oct 12 2022 The current official release of dmd is 2.100.2, but when I build from
- Dennis (5/7) Oct 12 2022 Some thinks that come to mind:
- H. S. Teoh (10/18) Oct 12 2022 Yes. I even `git clean -dfx` in the dmd repo and rebuilt, just to make
- Steven Schveighoffer (5/17) Oct 12 2022 That looks like a git version tag + some commit.
- H. S. Teoh (8/21) Oct 12 2022 [...]
- H. S. Teoh (14/16) Oct 12 2022 [...]
- Steven Schveighoffer (6/10) Oct 12 2022 The main benefit is if you build with a non-tagged version, you can know...
- H. S. Teoh (17/28) Oct 12 2022 Including the git commit hash in the version number is generally a good
- Steven Schveighoffer (3/12) Oct 12 2022 Yeah, that is odd.
- norm (20/36) Oct 12 2022 Using git tags is quite common in places where I've worked. CI/CD
- norm (9/51) Oct 12 2022 I should point out too that github, gitlab, bitbucket et. al.
- H. S. Teoh (34/46) Oct 12 2022 [...]
- Steven Schveighoffer (4/9) Oct 13 2022 The build should double check the VERSION file against the tag, and give...
- H. S. Teoh (5/14) Oct 13 2022 +1.
- Steven Schveighoffer (7/19) Oct 13 2022 Looking at this monstrosity, I can't really understand why it's not
- H. S. Teoh (13/27) Oct 17 2022 [...]
- Max Samukha (3/8) Oct 12 2022 It seems you've had this issue before:
- H. S. Teoh (5/15) Oct 13 2022 LOL... history repeats itself. :-P
The current official release of dmd is 2.100.2, but when I build from the git repo, `dmd --version` says: DMD64 D Compiler v2.098.1-10051-g61d7d56a0 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Why is it still reporting 2.098.1? Isn't that like several releases behind already? T -- In order to understand recursion you must first understand recursion.
Oct 12 2022
On Wednesday, 12 October 2022 at 19:04:26 UTC, H. S. Teoh wrote:The current official release of dmd is 2.100.2, but when I build from the git repo, `dmd --version` says:Some thinks that come to mind: - Is your repo up to date with dlang/dmd? - Is the `dmd` command actually executing the dmd you built? - Do you have a locally overridden VERSION file in the root?
Oct 12 2022
On Wed, Oct 12, 2022 at 07:22:57PM +0000, Dennis via Digitalmars-d wrote:On Wednesday, 12 October 2022 at 19:04:26 UTC, H. S. Teoh wrote:Just pulled from github just now.The current official release of dmd is 2.100.2, but when I build from the git repo, `dmd --version` says:Some thinks that come to mind: - Is your repo up to date with dlang/dmd?- Is the `dmd` command actually executing the dmd you built?Yes. I even `git clean -dfx` in the dmd repo and rebuilt, just to make sure.- Do you have a locally overridden VERSION file in the root?The VERSION file says: v2.100.2 Hmm. T -- I see that you JS got Bach.
Oct 12 2022
On 10/12/22 3:04 PM, H. S. Teoh wrote:The current official release of dmd is 2.100.2, but when I build from the git repo, `dmd --version` says: DMD64 D Compiler v2.098.1-10051-g61d7d56a0 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Why is it still reporting 2.098.1? Isn't that like several releases behind already? TThat looks like a git version tag + some commit. When you pull the remote branch in, do you specify --tags? You may not be acquiring all the git tags into your local repo. -Steve
Oct 12 2022
On Wed, Oct 12, 2022 at 04:31:20PM -0400, Steven Schveighoffer via Digitalmars-d wrote:On 10/12/22 3:04 PM, H. S. Teoh wrote:[...]The current official release of dmd is 2.100.2, but when I build from the git repo, `dmd --version` says: DMD64 D Compiler v2.098.1-10051-g61d7d56a0 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Why is it still reporting 2.098.1? Isn't that like several releases behind already?That looks like a git version tag + some commit. When you pull the remote branch in, do you specify --tags? You may not be acquiring all the git tags into your local repo.[...] You mean it acquires the version number from git tags?? That explains a lot. :-D T -- Never criticize a man until you've walked a mile in his shoes. Then when you do criticize him, you'll be a mile away and he won't have his shoes.
Oct 12 2022
On Wed, Oct 12, 2022 at 04:31:20PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...]When you pull the remote branch in, do you specify --tags? You may not be acquiring all the git tags into your local repo.[...] Re-pulled with --tags and rebuilt. Now dmd reports: DMD64 D Compiler v2.100.2 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Now *that* sounds more like it. :-D 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...) T -- What doesn't kill me makes me stranger.
Oct 12 2022
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. 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. -Steve
Oct 12 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: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.)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.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.
Oct 12 2022
On 10/12/22 5:46 PM, H. S. Teoh wrote: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.)Yeah, that is odd. -Steve
Oct 12 2022
On Wednesday, 12 October 2022 at 20:45:43 UTC, H. S. Teoh wrote:On Wed, Oct 12, 2022 at 04:31:20PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...]Using git tags is quite common in places where I've worked. CI/CD is configured to build a release with changelog and release note when it sees a semantic version tag arrive. To create a release pack we simlpy run: ``` $ git tag -a vX.Y.Z -m "Tag release X.Y.Z" && git push origin --tags ``` To get the release information you just ``` $ git describe --long --dirty --match "v*.*.*" v1.2.3-0-gabcd12345 ``` This `v1.2.3-0-gabcd12345` clearly indicates the version, if it is actually a release build, and the commit hash, which for us we find most important. One less dereference we have to do when bugs are reported. But we might be oddballs I guess, we refuse to use merge commits and insist on a linear history :)When you pull the remote branch in, do you specify --tags? You may not be acquiring all the git tags into your local repo.[...] Re-pulled with --tags and rebuilt. Now dmd reports: DMD64 D Compiler v2.100.2 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Now *that* sounds more like it. :-D 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...) T
Oct 12 2022
On Thursday, 13 October 2022 at 03:52:57 UTC, norm wrote:On Wednesday, 12 October 2022 at 20:45:43 UTC, H. S. Teoh wrote:I should point out too that github, gitlab, bitbucket et. al. have the protect tags feature and understand this approach. So a release tag is protected and not fluid, our script also easily do this too with a a simple regex. All other tags are fluid, and largely irrelevant tbh we hardly use tags for anything but releases. and we don't branch a release until we start patch releases, which of course branch at the respective tag.On Wed, Oct 12, 2022 at 04:31:20PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...]Using git tags is quite common in places where I've worked. CI/CD is configured to build a release with changelog and release note when it sees a semantic version tag arrive. To create a release pack we simlpy run: ``` $ git tag -a vX.Y.Z -m "Tag release X.Y.Z" && git push origin --tags ``` To get the release information you just ``` $ git describe --long --dirty --match "v*.*.*" v1.2.3-0-gabcd12345 ``` This `v1.2.3-0-gabcd12345` clearly indicates the version, if it is actually a release build, and the commit hash, which for us we find most important. One less dereference we have to do when bugs are reported. But we might be oddballs I guess, we refuse to use merge commits and insist on a linear history :)[...][...] Re-pulled with --tags and rebuilt. Now dmd reports: DMD64 D Compiler v2.100.2 Copyright (C) 1999-2022 by The D Language Foundation, All Rights Reserved written by Walter Bright Now *that* sounds more like it. :-D 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...) T
Oct 12 2022
On Thu, Oct 13, 2022 at 03:52:57AM +0000, norm via Digitalmars-d wrote:On Wednesday, 12 October 2022 at 20:45:43 UTC, 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...)Using git tags is quite common in places where I've worked. CI/CD is configured to build a release with changelog and release note when it sees a semantic version tag arrive.[...]This `v1.2.3-0-gabcd12345` clearly indicates the version, if it is actually a release build, and the commit hash, which for us we find most important. One less dereference we have to do when bugs are reported.[...] It's not so much the usage of git tags for release versioning that I find odd. It's the fact that dmd 2.100.2 insists that it's 2.098, sets `__VERSION__` to 2098L, and believes that it's 2.098, yet the state of code is clearly already 2.100.2 and the compiler will behave like a 2.100.2 compiler. In my mind, the state of source code defines the meaning behind the version number, and therefore the version number ought to be encoded in the source code, so that the two are consistent. This is particularly so in a D compiler where the version number returned by `__VERSION__` could cause semantic changes in downstream user code (due to static if, etc.). Imagine the hypothetical case where 2.100.2 introduced a breaking syntax change for which user code has to be updated; a user project that wants to be compilable with both versions of the compiler would likely do something like: static if (__VERSION__ <= 2098L) { ... // implement feature using 2.098 syntax } else { ... // implement feature using 2.100.2 syntax } In this case, since the compiler thinks it's 2.098, it will compile the first branch of the static if, but since it's actually a 2.100.2 compiler, it will fail to compile the code that's meant for 2.098. To add to the confusion, it claims that it's a 2.098 compiler, which will surely leave users *really* scratching their heads as to what exactly is going on. :-P T -- People who are more than casually interested in computers should have at least some idea of what the underlying hardware is like. Otherwise the programs they write will be pretty weird. -- D. Knuth
Oct 12 2022
On 10/13/22 12:16 AM, H. S. Teoh wrote:It's not so much the usage of git tags for release versioning that I find odd. It's the fact that dmd 2.100.2 insists that it's 2.098, sets `__VERSION__` to 2098L, and believes that it's 2.098, yet the state of code is clearly already 2.100.2 and the compiler will behave like a 2.100.2 compiler.The build should double check the VERSION file against the tag, and give an error when it doesn't match. -Steve
Oct 13 2022
On Thu, Oct 13, 2022 at 10:51:25AM -0400, Steven Schveighoffer via Digitalmars-d wrote:On 10/13/22 12:16 AM, H. S. Teoh wrote:+1. T -- Without geometry, life would be pointless. -- VSIt's not so much the usage of git tags for release versioning that I find odd. It's the fact that dmd 2.100.2 insists that it's 2.098, sets `__VERSION__` to 2098L, and believes that it's 2.098, yet the state of code is clearly already 2.100.2 and the compiler will behave like a 2.100.2 compiler.The build should double check the VERSION file against the tag, and give an error when it doesn't match.
Oct 13 2022
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: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? -SteveOn 10/13/22 12:16 AM, H. S. Teoh wrote:+1.It's not so much the usage of git tags for release versioning that I find odd. It's the fact that dmd 2.100.2 insists that it's 2.098, sets `__VERSION__` to 2098L, and believes that it's 2.098, yet the state of code is clearly already 2.100.2 and the compiler will behave like a 2.100.2 compiler.The build should double check the VERSION file against the tag, and give an error when it doesn't match.
Oct 13 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:[...] 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.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?The build should double check the VERSION file against the tag, and give an error when it doesn't match.+1.
Oct 17 2022
On Wednesday, 12 October 2022 at 20:45:43 UTC, 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...)It seems you've had this issue before: https://www.digitalmars.com/d/archives/digitalmars/D/DMD_git_master_stuck_ t_2.084_331087.html :D
Oct 12 2022
On Thu, Oct 13, 2022 at 05:02:25AM +0000, Max Samukha via Digitalmars-d wrote:On Wednesday, 12 October 2022 at 20:45:43 UTC, H. S. Teoh wrote:LOL... history repeats itself. :-P T -- First Rule of History: History doesn't repeat itself -- historians merely repeat each other.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...)It seems you've had this issue before: https://www.digitalmars.com/d/archives/digitalmars/D/DMD_git_master_stuck_at_2.084_331087.html :D
Oct 13 2022