Thread overview
[Issue 18188] rdmd ignores dependency in 'static this()'
6 days ago
Dragos Carp
6 days ago
Seb
January 03
https://issues.dlang.org/show_bug.cgi?id=18188

Dragos Carp <dragoscarp@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |major

--
6 days ago
https://issues.dlang.org/show_bug.cgi?id=18188

--- Comment #1 from Dragos Carp <dragoscarp@gmail.com> ---
The problem is caused by `dmd -v` output, that is parsed and used by rdmd.

$ dmd -v -o- foo.d
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binary    dmd
version   v2.078.0
config    /etc/dmd.conf
parse     foo
importall foo
import    object        (/usr/include/dmd/druntime/import/object.d)
semantic  foo
entry     main          foo.d
semantic2 foo
semantic3 foo
import    bar   (bar.d)

Calling dmd with -deps option fixes the problem:

$ dmd -v -o- foo.d -deps=/dev/null
predefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD
D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat
binary    dmd
version   v2.078.0
config    /etc/dmd.conf
parse     foo
importall foo
import    object        (/usr/include/dmd/druntime/import/object.d)
semantic  foo
entry     main          foo.d
semantic2 foo
semantic3 foo
import    bar   (bar.d)
import    baz   (baz.d)

Consequently rdmd command also functions when -deps option is added:

$ rdmd --build-only --chatty -deps=/dev/null foo.d
mkdirRecurse /tmp/.rdmd-500
mkdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756
lock /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.lock
mkdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.deps
spawn ["/usr/bin/dmd", "-deps=/dev/null", "-v", "-o-", "foo.d", "-I."]
read /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/rdmd.deps
which /usr/bin/dmd
stat /etc/dmd.conf
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/.built
stat ./foo
stat foo.d
stat foo.d
stat /etc/dmd.conf
stat baz.d
stat bar.d
stat /usr/bin/dmd
stat ./foo
spawn ["/usr/bin/dmd", "-deps=/dev/null", "-of./foo.tmp",
"-od/tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs", "-I.",
"foo.d", "baz.d", "bar.d"]
stat /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
rmdirRecurse /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/objs
mv ./foo.tmp ./foo
touch /tmp/.rdmd-500/rdmd-foo.d-2D7BE73D8EB3145BDB8A563EF51C3756/.built

--
6 days ago
https://issues.dlang.org/show_bug.cgi?id=18188

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #2 from Seb <greensunny12@gmail.com> ---
BTW are you aware of https://github.com/dlang/dmd/pull/7099 and
https://github.com/dlang/tools/pull/271 ?
It could as a side-effect fix your bug.

--