Skip to content

drop support for dub filename for files that don't exist #2681

Closed
@WebFreak001

Description

@WebFreak001

Currently if we have a hello.d in the current working directory we can run dub hello to invoke the hello.d file.

However this only works if a hello.d file exists and if no hello file exists.

As soon as you use dub build --single hello.d on POSIX, the dub hello command will stop working with Error Invalid UTF-8 sequence (at index 1), since it generated the file hello which is an executable file.

This was added in #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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions