Pure-D / workspace-d

CLI deprecated, API + functionality moved into https://github.com/Pure-D/serve-d
MIT License
75 stars 15 forks source link

DCD is outdated. (target=0.13.0, installed=vdcd), when dub fetch dcd #111

Closed kubo39 closed 3 years ago

kubo39 commented 3 years ago

Hi,

I've encounted this with lsp-mode(emacs).

(dmd-2.096.0)$ dmd --version
DMD64 D Compiler v2.096.0
Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright
(dmd-2.096.0)$ dub --version
DUB version 1.25.0, built on Mar 11 2021
(dmd-2.096.0)$ ~/.dub/packages/dcd-0.13.1/dcd/bin/dcd-server --version # installed via `dub fetch`
vdcd

The problem is that workspace-d assumes locally-compiled binary name is "vbin".

Also I found how dcd geneates its version:

void main()
{
    auto dir = environment.get("DUB_PACKAGE_DIR");
    auto hashFile = dir.buildPath("..", "bin", "dubhash.txt");
    auto gitVer = executeShell("git -C " ~ dir ~ " describe --tags");
    auto ver = (gitVer.status == 0 ? gitVer.output.strip
            : "v" ~ dir.dirName.baseName.findSplitAfter(
                environment.get("DUB_ROOT_PACKAGE") ~ "-")[1]).ifThrown("0.0.0")
        .chain(newline).to!string.strip;
    dir.buildPath("..", "bin").mkdirRecurse;
    if (!hashFile.exists || ver != hashFile.readText.strip)
        hashFile.write(ver);
}

Is it good idea that workspace-d accepts "vdcd" too?

WebFreak001 commented 3 years ago

which serve-d version did you use? vbin has been allowed for a while

kubo39 commented 3 years ago

which serve-d version did you use?

(dmd-2.096.0)$ pwd
/home/kubo39/dev/dlang/serve-d
(dmd-2.096.0)$ git rev-parse HEAD
6d5b94bd48fc271a20aa8a516f60795d4c85c6e7