Bug 6592 – di header file created even if errors occur
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-09-02T00:59:07Z
Last change time
2019-12-12T23:19:08Z
Keywords
bootcamp, pull
Assigned to
No Owner
Creator
Rainer Schuetze
Comments
Comment #0 by r.sagitario — 2011-09-02T00:59:07Z
Generating a di file from
---
module test;
import std.foo;
---
via "dmd -H -o- test.d" generates errors:
test.d(2): Error: module foo is in file 'std\foo.d' which cannot be read
but still creates the test.di file
---
// D import file generated from 'test.d'
module test;
import std.foo;
---
This can confuse the hell out of any make like build tool.
BTW: that is also the reason why building druntime works on windows if run twice, it reports an error only the first time (this uses posix.mak on windows, the win32.mak just misses un.di from the list of imports):
../dmd/src/dmd -m32 -c -d -o- -Isrc -Iimport -Hfimport/core/sys/posix/sys/un.di
src/core/sys/posix/sys/un.d
DMD v2.055 DEBUG
src\core\sys\posix\sys\un.d(17): Error: import sa_family_t not found
src\core\sys\posix\sys\un.d(17): Error: alias core.sys.posix.sys.un.sa_family_t
recursive alias declaration
Comment #1 by andrej.mitrovich — 2013-02-09T05:50:20Z
The same is true for object files, although Walter said he wants them around to be able to inspect the output. Maybe this applies to .di files as well.
(personally I disagree with such a viewpoint, if something crashed or emitted an error the compiler source should be inspected, not its corrupted output).
Comment #2 by dlang-bot — 2019-12-12T08:34:23Z
@cristiancreteanu updated dlang/dmd pull request #10635 "Issue6592 - di header file created even if errors occur" fixing this issue:
- Fix Issue 6592 - di header file created even if errors occur
https://github.com/dlang/dmd/pull/10635
Comment #3 by dlang-bot — 2019-12-12T23:19:08Z
dlang/dmd pull request #10635 "Issue6592 - di header file created even if errors occur" was merged into master:
- 4f83b1888b209f7963fa7a778739656662e81df0 by Cristian Creteanu:
Fix Issue 6592 - di header file created even if errors occur
https://github.com/dlang/dmd/pull/10635