Closed WebFreak001 closed 7 months ago
It's very error prone, I think we should remove it.
Can we deprecate it first @WebFreak001 ?
Actually this is E_WONTFIX. This syntax is intended to work for shell-like approach. So you can put a command in your path and use a D script under the hood.
Currently if we have a
hello.d
in the current working directory we can rundub hello
to invoke the hello.d file.However this only works if a
hello.d
file exists and if nohello
file exists.As soon as you use
dub build --single hello.d
on POSIX, thedub hello
command will stop working withError Invalid UTF-8 sequence (at index 1)
, since it generated the filehello
which is an executable file.This was added in https://github.com/dlang/dub/pull/1605 by @andre2007
I think this is a hurdle when adding custom command support to DUB (e.g. loaded from the registry), so I think we should remove that feature.
However this is somewhat consistent with what the compiler does (except the compiler does not attempt to parse the executable file)
Option 1: remove this feature Option 2: make it only work when using
/
or\
in the path (e.g../hello
) Option 3: keep it as-is (requiring decisions what to has precedence with custom commands when published on the registry)Additionally we need to fix that it doesn't attempt to parse the executable file, but only D source files.