Bug 18477 – -run isn't DRY and leads to unexpected errors

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-20T18:45:51Z
Last change time
2024-12-13T18:57:12Z
Assigned to
No Owner
Creator
Seb
Moved to GitHub: dmd#19392 →

Comments

Comment #0 by greensunny12 — 2018-02-20T18:45:51Z
For -run the order matters which is very un-intuitive and violates DRY. --- cat << EOF > test.d import std.stdio; void main() { writeln("Hello D", __FILE__); import bar; foo(); } EOF cat << EOF > bar.d void foo(){} EOF ---- > dmd -run test.d bar.d test.o:test.d:function _Dmain: error: undefined reference to '_D3bar3fooFZv' collect2: error: ld returned 1 exit status Error: linker exited with status 1 > dmd bar.d -run test.d Hello Dtest.d See also: https://issues.dlang.org/show_bug.cgi?id=18476
Comment #1 by timothee.cour2 — 2018-02-20T19:26:18Z
or using har syntax (https://github.com/marler8997/har): ```har --- test.d import std.stdio; void main() { writeln("Hello D", __FILE__); import bar; foo(); } --- bar.d void foo(){} ``` another issue is -run disallows things like: `dmd **/*.d -run` and leads to complex workarounds
Comment #2 by greensunny12 — 2018-03-29T03:02:12Z
Comment #3 by robert.schadek — 2024-12-13T18:57:12Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19392 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB