Jump to page: 1 2
Thread overview
Re: DMD git master stuck at 2.084???
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
Mike Franklin
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
Max Samukha
Sep 26, 2019
Max Samukha
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
Jonathan Marler
Sep 26, 2019
jmh530
Sep 26, 2019
Jonathan Marler
Sep 26, 2019
H. S. Teoh
Sep 26, 2019
Jonathan Marler
Sep 26, 2019
Daniel Kozak
Sep 26, 2019
Seb
Sep 26, 2019
H. S. Teoh
September 25, 2019
On Thu, Sep 26, 2019 at 12:06:09AM +0000, Mike Franklin via Digitalmars-d wrote: [...]
> Which platform are you running building on?

Debian Linux 64-bit.


> I just tested on Arch Linux 64-bit with the following:
> 
> rdmd src/build.d
> 
> And it produced a binary with the following output for `dmd --version`:
> 
> DMD64 D Compiler v2.088.0-240-gaf585f61a
> Copyright (C) 1999-2019 by The D Language Foundation, All Rights
> Reserved written by Walter Bright
[...]

That's totally weird. I just ran 'rdmd src/build.d' and it said "success", but when I run `generated/linux/release/64/dmd --version` it says:

	DMD64 D Compiler v2.084.0-2446-gaf585f61a
	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
	Reserved written by Walter Bright

WAT??

And just in case my git repo is screwed, I checked `git log`, the top commit is: af585f61a10e978f916e896f2d1deac1ee6790e7 dated Sep 26, 2019, which can't possibly be 2.084.

I don't get it.


T

-- 
When solving a problem, take care that you do not become part of the problem.
September 25, 2019
On Wed, Sep 25, 2019 at 05:29:07PM -0700, H. S. Teoh via Digitalmars-d wrote: [...]
> 	DMD64 D Compiler v2.084.0-2446-gaf585f61a
> 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
> 	Reserved written by Walter Bright

OK, it gets stranger. So, I thought perhaps my git repo is somehow corrupted, so I nuked the whole thing and re-cloned from github, then ran `rdmd src/build.d`.  The resulting binary produces even stranger output with --version now:

	DMD64 D Compiler v2.058-20347-gaf585f61a
	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
	Reserved written by Walter Bright

2.058??!  Where did that come from???


T

-- 
Political correctness: socially-sanctioned hypocrisy.
September 26, 2019
On Thursday, 26 September 2019 at 00:29:07 UTC, H. S. Teoh wrote:

> I don't get it.

Neither do I, but what's in your VERSION file at the root of the DMD repository?


September 25, 2019
On Wed, Sep 25, 2019 at 05:40:51PM -0700, H. S. Teoh via Digitalmars-d wrote:
> On Wed, Sep 25, 2019 at 05:29:07PM -0700, H. S. Teoh via Digitalmars-d wrote: [...]
> > 	DMD64 D Compiler v2.084.0-2446-gaf585f61a
> > 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
> > 	Reserved written by Walter Bright
> 
> OK, it gets stranger. So, I thought perhaps my git repo is somehow corrupted, so I nuked the whole thing and re-cloned from github, then ran `rdmd src/build.d`.  The resulting binary produces even stranger output with --version now:
> 
> 	DMD64 D Compiler v2.058-20347-gaf585f61a
> 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
> 	Reserved written by Walter Bright
> 
> 2.058??!  Where did that come from???
[...]

OK, I *think* I solved the mystery... the utterly evil rdmd cache!!! I nuked the repo, did a fresh git clone, and then ran rdmd --force src/build.d, and finally I get a sane binary:

	DMD64 D Compiler v2.088.0-240-gaf585f61a
	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
	Reserved written by Walter Bright

In retrospect, it's probably because I haven't updated my rdmd in years: rdmd --version gives:

	rdmd build 20170608
	Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]...
	Builds (with dependents) and runs a D program.
	Example: rdmd -release myprog --myprogparm 5
	[ ... snipped ... ]

I've no idea *what* was in the old rdmd cache... cached copies of older compilers? Cached copies of build.d?!  Whatever it was, it's truly bizarre.


T

-- 
Perhaps the most widespread illusion is that if we were in power we would behave very differently from those who now hold it---when, in truth, in order to get power we would have to become very much like them. -- Unknown
September 25, 2019
On Thu, Sep 26, 2019 at 12:41:33AM +0000, Mike Franklin via Digitalmars-d wrote:
> On Thursday, 26 September 2019 at 00:29:07 UTC, H. S. Teoh wrote:
> 
> > I don't get it.
> 
> Neither do I, but what's in your VERSION file at the root of the DMD repository?

v2.088.0


T

-- 
If it's green, it's biology, If it stinks, it's chemistry, If it has numbers it's math, If it doesn't work, it's technology.
September 26, 2019
On Thursday, 26 September 2019 at 00:52:48 UTC, H. S. Teoh wrote:
> On Thu, Sep 26, 2019 at 12:41:33AM +0000, Mike Franklin via Digitalmars-d wrote:
>> On Thursday, 26 September 2019 at 00:29:07 UTC, H. S. Teoh wrote:
>> 
>> > I don't get it.
>> 
>> Neither do I, but what's in your VERSION file at the root of the DMD repository?
>
> v2.088.0
>
>
> T

dmd build script reads the version from the most recent local tag reachable from the head, and you probably did't fetch all of the recent tags from upstream. 'git fetch/pull --tags' should fix that.
September 26, 2019
On Thursday, 26 September 2019 at 05:52:40 UTC, Max Samukha wrote:

> dmd build script reads the version from the most recent local tag reachable from the head, and you probably did't fetch all of the recent tags from upstream. 'git fetch/pull --tags' should fix that.

typo: did't -> didn't


September 26, 2019
On Thursday, 26 September 2019 at 00:49:49 UTC, H. S. Teoh wrote:
> On Wed, Sep 25, 2019 at 05:40:51PM -0700, H. S. Teoh via Digitalmars-d wrote:
>> On Wed, Sep 25, 2019 at 05:29:07PM -0700, H. S. Teoh via Digitalmars-d wrote: [...]
>> > 	DMD64 D Compiler v2.084.0-2446-gaf585f61a
>> > 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
>> > 	Reserved written by Walter Bright
>> 
>> OK, it gets stranger. So, I thought perhaps my git repo is somehow corrupted, so I nuked the whole thing and re-cloned from github, then ran `rdmd src/build.d`.  The resulting binary produces even stranger output with --version now:
>> 
>> 	DMD64 D Compiler v2.058-20347-gaf585f61a
>> 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
>> 	Reserved written by Walter Bright
>> 
>> 2.058??!  Where did that come from???
> [...]
>
> OK, I *think* I solved the mystery... the utterly evil rdmd cache!!! I nuked the repo, did a fresh git clone, and then ran rdmd --force src/build.d, and finally I get a sane binary:
>
> 	DMD64 D Compiler v2.088.0-240-gaf585f61a
> 	Copyright (C) 1999-2019 by The D Language Foundation, All Rights
> 	Reserved written by Walter Bright
>
> In retrospect, it's probably because I haven't updated my rdmd in years: rdmd --version gives:
>
> 	rdmd build 20170608
> 	Usage: rdmd [RDMD AND DMD OPTIONS]... program [PROGRAM OPTIONS]...
> 	Builds (with dependents) and runs a D program.
> 	Example: rdmd -release myprog --myprogparm 5
> 	[ ... snipped ... ]
>
> I've no idea *what* was in the old rdmd cache... cached copies of older compilers? Cached copies of build.d?!  Whatever it was, it's truly bizarre.
>
>
> T

VERSION is indeed generated from source code inside `build.d`, so if your cached binary of `build.d` was indeed be used then this would explain it.

https://github.com/dlang/dmd/blob/master/src/build.d#L278

When I forked rdmd to make rund, I had to fix a fair amount bugs when it came to calculating the hash for the cache location.  Bugs that would cause this sort of problem.  How rdmd should work is that if the source code changes then it should re-compile no matter what.  It uses the timestamp for this though, so if the timestamp of build.d somehow never changed or got older than it would never update the cached binary of it.

Next time this happens try adding the --chatty argument to rdmd and maybe you'll find out why the cache wasn't working right.  You may or may not get the answer with rdmd but with rund you'll always see a line that says:

COMPILE(YES or NO): REASON

i.e.

COMPILE(YES) updated file 'src/build.d'

If you use rdmd alot, consider using my rund fork https://github.com/dragon-lang/rund as it runs about twice as fast.  It makes my workflow snappier, has fixed a good amount of bugs, adds a new feature for adding compiler options in the main source file and has better logging of what it's doing.

September 26, 2019
On Thu, Sep 26, 2019 at 05:52:40AM +0000, Max Samukha via Digitalmars-d wrote: [...]
> dmd build script reads the version from the most recent local tag reachable from the head, and you probably did't fetch all of the recent tags from upstream. 'git fetch/pull --tags' should fix that.

I tried this on a copy of a "bad" dmd repo I had left, and I still get a messed up dmd.  Turns out, build.d apparently also uses some kind of caching / timestamping system to determine when to build something, so I had to delete the generated/ directory and rerun it before it did the right thing.

I wish build.d would use content hashing for checking if a source file has changed, rather than timestamping, or worse, apparently just the existence of the target.


T

-- 
Lottery: tax on the stupid. -- Slashdotter
September 26, 2019
On Thu, Sep 26, 2019 at 04:46:49AM -0700, H. S. Teoh via Digitalmars-d wrote:
> On Thu, Sep 26, 2019 at 05:52:40AM +0000, Max Samukha via Digitalmars-d wrote: [...]
> > dmd build script reads the version from the most recent local tag reachable from the head, and you probably did't fetch all of the recent tags from upstream. 'git fetch/pull --tags' should fix that.
[...]
> I wish build.d would use content hashing for checking if a source file has changed, rather than timestamping, or worse, apparently just the existence of the target.
[...]

Mystery solved: the problem was caused by missing tags, *and* the fact that build.d doesn't rebuild when git tags change.


T

-- 
Almost all proofs have bugs, but almost all theorems are true. -- Paul Pedersen
« First   ‹ Prev
1 2