Thread overview
[Issue 18188] rdmd ignores dependency in 'static this()'
Jan 03, 2018
Dragos Carp
Jan 10, 2018
Dragos Carp
Jan 11, 2018
Seb
May 10, 2019
Dragos Carp
May 11, 2019
Dragos Carp
January 03, 2018
https://issues.dlang.org/show_bug.cgi?id=18188

Dragos Carp <dragoscarp@gmail.com> changed:

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

--
January 10, 2018
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

--
January 11, 2018
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.

--
May 10, 2019
https://issues.dlang.org/show_bug.cgi?id=18188

--- Comment #3 from Dragos Carp <dragoscarp@gmail.com> ---
the 2 PR didn't fix the issue. The problem is still present in dmd 2.086.

--
May 11, 2019
https://issues.dlang.org/show_bug.cgi?id=18188

Dragos Carp <dragoscarp@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #4 from Dragos Carp <dragoscarp@gmail.com> ---
rdmd will be deprecated.

Instead use:
> dmd -i -run foo.d

--