www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - A new and exciting way in which DMD fails to build for me

reply "Meta" <jared771 gmail.com> writes:
I'm trying to build to build DMD and I've encountered a very 
strange problem. When I run `make -fwin32.mak`, there are errors 
when it tries to compile id.c:

id.c(298) : Error: 'idPool' is not a member of 'Lexer'
...etc.

Sure enough, when I look in id.c, there are a bunch of these:

stringof = Lexer::idPool("stringof");

But Lexer does not have an `idPool` member. I then looked in 
idgen.c for the offending line that must be wrongly inserting 
"Lexer" instead of "Identifier", but everything looks okay. 
Specifically this block:

for (i = 0; i < sizeof(msgtable) / sizeof(msgtable[0]); i++)
{   const char *id = msgtable[i].ident;
     const char *p = msgtable[i].name;

     if (!p)
         p = id;
     fprintf(fp,"    %s = Identifier::idPool(\"%s\");\n", id, p);
}

Looks like it should print the correct line to id.c. I can 
confirm this by running idgen.exe manually; it produces the 
correct file.

However, when I try deleting all the relevant files to make sure 
there is nothing old hanging around, then run make again, the 
same incorrect id.c is generated. This seems bizarre to me; what 
exactly is going on here?
Jan 20 2015
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 20:14:42 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 I'm trying to build to build DMD and I've encountered a very=20
 strange problem. When I run `make -fwin32.mak`, there are errors=20
 when it tries to compile id.c:
=20
 id.c(298) : Error: 'idPool' is not a member of 'Lexer'
 ...etc.
=20
 Sure enough, when I look in id.c, there are a bunch of these:
=20
 stringof =3D Lexer::idPool("stringof");
=20
 But Lexer does not have an `idPool` member. I then looked in=20
 idgen.c for the offending line that must be wrongly inserting=20
 "Lexer" instead of "Identifier", but everything looks okay.=20
 Specifically this block:
=20
 for (i =3D 0; i < sizeof(msgtable) / sizeof(msgtable[0]); i++)
 {   const char *id =3D msgtable[i].ident;
      const char *p =3D msgtable[i].name;
=20
      if (!p)
          p =3D id;
      fprintf(fp,"    %s =3D Identifier::idPool(\"%s\");\n", id, p);
 }
=20
 Looks like it should print the correct line to id.c. I can=20
 confirm this by running idgen.exe manually; it produces the=20
 correct file.
=20
 However, when I try deleting all the relevant files to make sure=20
 there is nothing old hanging around, then run make again, the=20
 same incorrect id.c is generated. This seems bizarre to me; what=20
 exactly is going on here?
what is that "id.c" at all? i can't find such file in dmd git repo...
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 20:19:19 UTC, ketmar via 
Digitalmars-d wrote:
 On Tue, 20 Jan 2015 20:14:42 +0000
 Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 I'm trying to build to build DMD and I've encountered a very 
 strange problem. When I run `make -fwin32.mak`, there are 
 errors when it tries to compile id.c:
 
 id.c(298) : Error: 'idPool' is not a member of 'Lexer'
 ...etc.
 
 Sure enough, when I look in id.c, there are a bunch of these:
 
 stringof = Lexer::idPool("stringof");
 
 But Lexer does not have an `idPool` member. I then looked in 
 idgen.c for the offending line that must be wrongly inserting 
 "Lexer" instead of "Identifier", but everything looks okay. 
 Specifically this block:
 
 for (i = 0; i < sizeof(msgtable) / sizeof(msgtable[0]); i++)
 {   const char *id = msgtable[i].ident;
      const char *p = msgtable[i].name;
 
      if (!p)
          p = id;
      fprintf(fp,"    %s = Identifier::idPool(\"%s\");\n", id, 
 p);
 }
 
 Looks like it should print the correct line to id.c. I can 
 confirm this by running idgen.exe manually; it produces the 
 correct file.
 
 However, when I try deleting all the relevant files to make 
 sure there is nothing old hanging around, then run make again, 
 the same incorrect id.c is generated. This seems bizarre to 
 me; what exactly is going on here?
what is that "id.c" at all? i can't find such file in dmd git repo...
It's generated by idgen.exe, which is compiled from idgen.c. I'm not sure why, exactly.
Jan 20 2015
next sibling parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 20:22:59 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 what is that "id.c" at all? i can't find such file in dmd git=20
 repo...
=20 It's generated by idgen.exe, which is compiled from idgen.c. I'm=20 not sure why, exactly.
ah, sorry, i should read your post more carefully. did you deleted all the files in question, i.e. id.c id.h idgen.obj idgen.exe before trying to run make again?
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 20:33:58 UTC, ketmar via 
Digitalmars-d wrote:
 On Tue, 20 Jan 2015 20:22:59 +0000
 Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 what is that "id.c" at all? i can't find such file in dmd 
 git repo...
It's generated by idgen.exe, which is compiled from idgen.c. I'm not sure why, exactly.
ah, sorry, i should read your post more carefully. did you deleted all the files in question, i.e. id.c id.h idgen.obj idgen.exe before trying to run make again?
Yeah, it's strange. I guess it must be make-related, as the incorrect id.c is only generated when I run the makefile, but I don't understand make enough to discern if that's the case.
Jan 20 2015
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 20:37:03 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Tuesday, 20 January 2015 at 20:33:58 UTC, ketmar via=20
 Digitalmars-d wrote:
 On Tue, 20 Jan 2015 20:22:59 +0000
 Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 what is that "id.c" at all? i can't find such file in dmd=20
 git repo...
=20 It's generated by idgen.exe, which is compiled from idgen.c.=20 I'm not sure why, exactly.
ah, sorry, i should read your post more carefully. did you deleted all the files in question, i.e. id.c id.h idgen.obj idgen.exe before trying to run make again?
=20 Yeah, it's strange. I guess it must be make-related, as the=20 incorrect id.c is only generated when I run the makefile, but I=20 don't understand make enough to discern if that's the case.
this may be timestamp-related somehow, 'cause make looks only to timestamps to determine which file(s) should be rebuild. does this occurs if you cloning dmd repo in fresh place? i built windows version of dmd not so long ago and everything was ok.
Jan 20 2015
next sibling parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 20:50:49 UTC, ketmar via 
Digitalmars-d wrote:
 this may be timestamp-related somehow, 'cause make looks only to
 timestamps to determine which file(s) should be rebuild. does 
 this
 occurs if you cloning dmd repo in fresh place? i built windows 
 version
 of dmd not so long ago and everything was ok.
I just made a fresh clone and tried again, same thing happens.
Jan 20 2015
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 21:11:29 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Tuesday, 20 January 2015 at 20:50:49 UTC, ketmar via=20
 Digitalmars-d wrote:
 this may be timestamp-related somehow, 'cause make looks only to
 timestamps to determine which file(s) should be rebuild. does=20
 this
 occurs if you cloning dmd repo in fresh place? i built windows=20
 version
 of dmd not so long ago and everything was ok.
=20 I just made a fresh clone and tried again, same thing happens.
hm. were from it got that "id.c" at all? isn't there old "idgen.exe" lying somewhere in your %PATH%? win32.mak runs just "idgen", so sometimes when something is gone haywire it may call "idgen.exe" from some other place. i don't know why it uses simple "idgen" instead of ".\\idgen.exe". you can try to fix that like in make (it's around "id.h id.c : idgen.c" rule) and see if that changes anything.
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 21:37:08 UTC, ketmar via 
Digitalmars-d wrote:
 On Tue, 20 Jan 2015 21:11:29 +0000
 Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Tuesday, 20 January 2015 at 20:50:49 UTC, ketmar via 
 Digitalmars-d wrote:
 this may be timestamp-related somehow, 'cause make looks 
 only to
 timestamps to determine which file(s) should be rebuild. 
 does this
 occurs if you cloning dmd repo in fresh place? i built 
 windows version
 of dmd not so long ago and everything was ok.
I just made a fresh clone and tried again, same thing happens.
hm. were from it got that "id.c" at all? isn't there old "idgen.exe" lying somewhere in your %PATH%? win32.mak runs just "idgen", so sometimes when something is gone haywire it may call "idgen.exe" from some other place. i don't know why it uses simple "idgen" instead of ".\\idgen.exe". you can try to fix that like in make (it's around "id.h id.c : idgen.c" rule) and see if that changes anything.
The only things in my path when I run make are: C:\D\dmd2\windows\bin C:\Program Files (x86)\Git\cmd C:\D\dm\bin Also, when I open a new shell window and type "where idgen.exe", it points to the one in the DMD folder. I'll try editing the makefile, however, and see if that works.
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 21:57:56 UTC, Meta wrote:
 The only things in my path when I run make are:

 C:\D\dmd2\windows\bin
 C:\Program Files (x86)\Git\cmd
 C:\D\dm\bin

 Also, when I open a new shell window and type "where 
 idgen.exe", it points to the one in the DMD folder. I'll try 
 editing the makefile, however, and see if that works.
And of course that did fix it. Where in the world would it be finding another idgen.exe?
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 22:03:27 UTC, Meta wrote:
 On Tuesday, 20 January 2015 at 21:57:56 UTC, Meta wrote:
 The only things in my path when I run make are:

 C:\D\dmd2\windows\bin
 C:\Program Files (x86)\Git\cmd
 C:\D\dm\bin

 Also, when I open a new shell window and type "where 
 idgen.exe", it points to the one in the DMD folder. I'll try 
 editing the makefile, however, and see if that works.
And of course that did fix it. Where in the world would it be finding another idgen.exe?
Never mind, there actually *is* another idgen in my path, even when it only includes the aforementioned locations. A rogue idgen.exe somehow snuck into the D:\dmd2\windows\bin folder, probably because the guide on the wiki suggests to do `copy *.exe <bin folder>`, and idgen gets copied along with a newly built DMD. It'll work fine the first time, but will fail all subsequent times. That's pretty evil, actually. That should be changed on the wiki, and maybe I'll make a PR for the makefile so it will use the local idgen.
Jan 20 2015
parent reply ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 22:15:43 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Tuesday, 20 January 2015 at 22:03:27 UTC, Meta wrote:
 On Tuesday, 20 January 2015 at 21:57:56 UTC, Meta wrote:
 The only things in my path when I run make are:

 C:\D\dmd2\windows\bin
 C:\Program Files (x86)\Git\cmd
 C:\D\dm\bin

 Also, when I open a new shell window and type "where=20
 idgen.exe", it points to the one in the DMD folder. I'll try=20
 editing the makefile, however, and see if that works.
And of course that did fix it. Where in the world would it be=20 finding another idgen.exe?
=20 Never mind, there actually *is* another idgen in my path, even=20 when it only includes the aforementioned locations. A rogue=20 idgen.exe somehow snuck into the D:\dmd2\windows\bin folder,=20 probably because the guide on the wiki suggests to do `copy *.exe=20 <bin folder>`, and idgen gets copied along with a newly built=20 DMD. It'll work fine the first time, but will fail all subsequent=20 times. That's pretty evil, actually. That should be changed on=20 the wiki, and maybe I'll make a PR for the makefile so it will=20 use the local idgen.
if you'll make a PR, it would be good to change other invocations too: "optabgen" and "impcnvgen".
Jan 20 2015
parent reply "Meta" <jared771 gmail.com> writes:
On Tuesday, 20 January 2015 at 22:25:18 UTC, ketmar via 
Digitalmars-d wrote:
 if you'll make a PR, it would be good to change other 
 invocations too:
 "optabgen" and "impcnvgen".
I have; the PR is here if any driveby readers want to merge it: https://github.com/D-Programming-Language/dmd/pull/4322
Jan 20 2015
parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 22:30:16 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 On Tuesday, 20 January 2015 at 22:25:18 UTC, ketmar via=20
 Digitalmars-d wrote:
 if you'll make a PR, it would be good to change other=20
 invocations too:
 "optabgen" and "impcnvgen".
=20 I have; the PR is here if any driveby readers want to merge it: =20 https://github.com/D-Programming-Language/dmd/pull/4322
heh, and it's already merged. that was really fast! ;-)
Jan 20 2015
prev sibling parent "eles" <eles eles.com> writes:
On Tuesday, 20 January 2015 at 20:50:49 UTC, ketmar via 
Digitalmars-d wrote:
 On Tue, 20 Jan 2015 20:37:03 +0000
 Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:
 this may be timestamp-related somehow, 'cause make looks only to
 timestamps to determine which file(s) should be rebuild. does
that's why everybody loves make so much that they invented scons...
Jan 20 2015
prev sibling parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 20 Jan 2015 20:22:59 +0000
Meta via Digitalmars-d <digitalmars-d puremagic.com> wrote:

ah, and "id.obj", of course. ;-)
Jan 20 2015