Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rdmd does not discover all dependencies #423

Open
dlang-bugzilla-migration opened this issue Jan 9, 2021 · 0 comments
Open

rdmd does not discover all dependencies #423

dlang-bugzilla-migration opened this issue Jan 9, 2021 · 0 comments
Labels
Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense

Comments

@dlang-bugzilla-migration

Transferred from: https://issues.dlang.org/show_bug.cgi?id=18079

User @marler8997 reported (2017-Dec-14 16:25:16):

Related to (https://issues.dlang.org/show_bug.cgi?id=8858). That bug was created because dmd would not discover all the imported modules when compiling a single file. However, this was closed as a "non issue" because the compiler is not "supposed" to discover all dependencies when compiling a single module. If an application wants to discover all imported modules, then they can use the "-deps" flag to force the compiler to do so.

rdmd currently uses this "import discovery" to obtain a list of all the modules it needs to compile. However, rdmd does not use the "-deps" flag when discovering dependencies which means that in some cases it will be missing modules to compile, i.e.

main.d

import foo;
void main() { printx(); }

foo.d

module foo;
void printx() { import std.stdio; import bar : x; writefln("x is %s", x); }

bar.d

module bar;
int x = 42;

rdmd main.d

this could be fixed by modifying rdmd to use the "-deps" flag, however, this has a significant performance cost. Another solution proposed is to integrate the "compile imports" feature (dlang/dmd#7099) and modify rdmd to use that feature instead (#271).

User @marler8997 responded (2018-Jan-10 03:06:04):

This bug should be fixed with this PR.

#271

User @marler8997 responded (2018-Jan-16 17:39:51):

#271

User @marler8997 responded (2018-Jan-20 02:04:42):

#271 was reverted

@dlang-bugzilla-migration dlang-bugzilla-migration added Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd labels Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio.3.Normal A bug that is neither a blocker nor a regression T.RDMD Issues that apply only to rdmd Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense
Projects
None yet
Development

No branches or pull requests

1 participant