dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
238 stars 80 forks source link

"Could not resolve location of module" errors with newest LDC #890

Closed andy-hanson closed 1 year ago

andy-hanson commented 1 year ago

This reproduces with a simple project.

a.d:

module a;
import b : b;
void main() {}

b.d:

module b;
int b = 2;

When I run source ~/dlang/ldc-1.30.0/activate then dub run dscanner -- --styleCheck *.d, I get this (good) output (skipping build output):

Running ../../.dub/packages/dscanner-0.13.0/dscanner/bin/dscanner --styleCheck a.d b.d
b.d(2:5)[warn]: Public declaration 'b' is undocumented.
Program exited with code 1

When I run source ~/dlang/ldc-1.31.0-beta1/activate then dub run dscanner -- --styleCheck *.d, I get this (bad) output (skipping build output):

     Running ../../.dub/packages/dscanner-0.13.0/dscanner/bin/dscanner --styleCheck a.d b.d
2023-02-06T23:20:58.204 [warning] first.d:371:visit Could not locate object.d or object.di
2023-02-06T23:20:58.204 [warning] first.d:547:visit Could not resolve location of module 'immutable(istring)("b")'
2023-02-06T23:20:58.207 [warning] first.d:371:visit Could not locate object.d or object.di
b.d(2:5)[warn]: Public declaration 'b' is undocumented.
Error Program exited with code 1

On a larger project there will be a lot of "Could not resolve" errors, likely one for every import.

WebFreak001 commented 1 year ago

oh std.experimental.logger has changed it seems.

There was a StdLoggerDisableWarning version in the dub.json, I guess it was to hide exactly these warnings?

This functionality seems to have been completely removed from std.logger now though (being able to toggle off individual logging levels)

However I think it makes more sense to print either only error messages or no messages from libdparse/dsymbol anyway. The actual application output that's supposed to be stable is done via stdout/stderr writeln anyway.

Moth-Tolias commented 1 year ago

title should probably be changed since it's a library issue rather than a compiler one.

on my current project this logger spam alone completely blows out my terminal scrollback.

WebFreak001 commented 1 year ago

it's something that changed in phobos / std.experimental.logger - this is usually bundled with compiler versions