Bug 23454 – DMD CLI bug when using -I

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-11-03T12:22:06Z
Last change time
2022-11-04T12:54:47Z
Assigned to
No Owner
Creator
Marcelo Silva Nascimento Mancini

Comments

Comment #0 by msnmancini — 2022-11-03T12:22:06Z
I remember having this bug for quite some time, but I discovered an interesting issue. `dmd app.d -I.` causes an `Error: unrecognized file extension `. Same thing on `dmd app.d -I=.`. This error occurs ONLY in Powershell. The Command Prompt does not get this error. I have a faint feeling that this error has already occurred with me ldc2.
Comment #1 by razvan.nitu1305 — 2022-11-04T12:36:11Z
Hmm, it seems that powershell, for some reason, splits the dot from what is preceeding it so when it calls dmd it sees -I and . as 2 separate arguments. Unforuntately, this is not something that can be fixed inside the compiler, but in powershell. For more information, see https://stackoverflow.com/questions/25979247/why-powershell-splits-arguments-at-dots-in-some-cases
Comment #2 by msnmancini — 2022-11-04T12:52:31Z
Do you think that having a mention about this somewhere would be valid?
Comment #3 by razvan.nitu1305 — 2022-11-04T12:54:47Z
I don't think it's the job of the compiler spec to document the various quirks of different CLI implementations.