Bug 9508 – RDMD doesn't generate new dependency list when a file is changed.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-13T16:41:00Z
Last change time
2013-03-10T14:52:35Z
Assigned to
nobody
Creator
jerro.public
Comments
Comment #0 by jerro.public — 2013-02-13T16:41:03Z
Steps to reproduce:
1. Make a file a.d with this content:
module a;
void foo(){}
void main()
{
foo();
}
2. Run this:
rdmd a
3. Replace the content of a.d with this:
module a;
import b;
void main()
{
foo();
}
and create a file b.d with this content:
module b;
void foo(){}
4. run this:
rdmd --chatty a
The command outputs:
'dmd' '-of/tmp/.rdmd-1000/rdmd-a.d-8707821320FFD4E4D80A6FA8EAD4B975/a' '-od/tmp/.rdmd-1000/rdmd-a.d-8707821320FFD4E4D80A6FA8EAD4B975/objs' '-I.' 'a.d'
/tmp/.rdmd-1000/rdmd-a.d-8707821320FFD4E4D80A6FA8EAD4B975/objs/a.o: In function `_Dmain':
a.d:(.text._Dmain+0x5): undefined reference to `_D1b3fooFZv'
collect2: error: ld returned 1 exit status
--- errorlevel 1
You can see that rdmd didn't ran "dmd -v ..." to get a new dependency list. It used the old list which doesn't contain b.d. That resulted in a linker error. If you now run:
rdmd --force a
it succeeds.
Comment #1 by github-bugzilla — 2013-03-10T14:34:34Z