Bug 14050 – `dmd -v` lists imports from failed __traits(compiles) blocks

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-26T14:50:00Z
Last change time
2015-06-09T05:14:40Z
Keywords
pull
Assigned to
nobody
Creator
public

Comments

Comment #0 by public — 2015-01-26T14:50:55Z
=== static if (__traits(compiles, { import missing; })) { pragma(msg, "importing missing"); import missing; } else { pragma(msg, "not importing missing"); } /* $ ./dmd/src/dmd -o- -v reduced.d binary ./dmd/src/dmd version v2.067-devel-6b86b12 config ./dmd/src/dmd.conf parse reduced importall reduced import object (/home/dicebot/devel/dlang/druntime/src/object.di) semantic reduced import missing (missing.d) not importing missing semantic2 reduced semantic3 reduced */ === Note the "import missing (missing.d)" line. It makes all build tools that use `dmd -v` output to try to find and compile that module which is, of course, not possible. Marking issue as major because it blocks merging of std.experimental.logger (https://github.com/D-Programming-Language/phobos/pull/1500#issuecomment-71470893)
Comment #1 by k.hara.pg — 2015-01-26T15:42:32Z
https://github.com/D-Programming-Language/dmd/pull/4346 --- -deps has similar issue, but i'm not sure it should be fixed. Compiles OP code with: dmd -deps -o- test Prints: DMD v2.067 DEBUG not importing missing depsImport test (test.d) : private : object (C:\\dmd2\\src\\druntime\\import\\object.di) depsImport test (test.d) : private : missing (???) <---- If it's a problem, please open a new issue.
Comment #2 by github-bugzilla — 2015-01-26T15:43:48Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/451a54b331e9ce49a5cd32fc5ebe7eddd7a8ec18 fix Issue 14050 - `dmd -v` lists imports from failed __traits(compiles) blocks Don't print verbose message if module load fails. https://github.com/D-Programming-Language/dmd/commit/8a04bc489dc9272ccb64f4739d0cf93fd5b08fd7 Merge pull request #4346 from 9rnsr/fix14050 fix Issue 14050 - `dmd -v` lists imports from failed __traits(compiles) blocks
Comment #3 by public — 2015-01-26T16:03:14Z
Thanks, that was lightning quick! > If it's a problem, please open a new issue. Done : https://issues.dlang.org/show_bug.cgi?id=14052