mattiascibien / dlang-vscode

Support for the D Programming Language for Visual Studio Code
MIT License
38 stars 10 forks source link

Error while building dependencies with DUB #21

Closed ghost closed 7 years ago

ghost commented 7 years ago

VS Code gives this error message while building dependencies for extension.

C:\Users\mcferden\AppData\Roaming\dub\packages\experimental_allocator-2.70.0-b1\experimental_allocator\src\std\experimental\allocator\package.d(322, 13): Error: std.experimental.allocator.common.Ternary at C:\Users\mcferden\AppData\Roaming\dub\packages\experimental_allocator-2.70.0-b1\experimental_allocator\src\std\experimental\allocator\common.d(14, 1) conflicts with std.typecons.Ternary at D:\D\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(7427, 1),C:\Users\mcferden\AppData\Roaming\dub\package

I'm using DMD 2.072.0 and DUB 1.0.0 on Windows OS.

LaurentTreguier commented 7 years ago

I'm afraid this is an upstream issue. DCD and other tools from Hackerpilot have had no nes release in ages and don't seem to be compilable with newer DMD versions. The only solutions I see for now are :

skl131313 commented 7 years ago

Building some of them from master works, i know for dscanner it does. Having some way to set a precompiled binary would be a partial solution. Being able to disable some features would be appreciated as well, I don't use DCD as it just crashes with my project. I just use DScanner to get the symbol names in a single source file which is good enough for me.

LaurentTreguier commented 7 years ago

Specifying prebuilt binaries has been discussed in PR #16 and was added to that PR. This, at least, should be in the next update

MoritzMaxeiner commented 7 years ago

@LaurentTreguier Just tried to get the dev branch version to work (on Linux) to workaround this and everything except syntax hightlighting seems to be broken for me; starting with a completely fresh VSCode installation (no configuration, no extensions):

$ mkdir -p ~/.vscode/extensions
$ git clone https://github.com/dlang-vscode/dlang-vscode ~/.vscode/extensions/dlang-vscode
$ cd ~/.vscode/extensions/dlang-vscode
$ git checkout dev
$ npm install
$ npm run vscode:prepublish
$ ~/Tools/VSCode-linux-x64/bin/code-oss
# Open a folder that contains a dub.json
# Try e.g. Ctrl+P "Dub: Init Package" -> "command 'dlang.dub.init' not found"

Sorry if I missed some obvious step in setting this up.

LaurentTreguier commented 7 years ago

@Calrama there should be npm run postinstall at some point I think... The best way to do a clean install of the extension would probably be to use to vsce tool and use vsce package to create a .vsix file that you could install directly from VSCode. Are you doing a fresh install of your system ? Nothing will work if the dub command is not found, that's for sure

MoritzMaxeiner commented 7 years ago

Just tried out both methods (adding npm run postinstall / using npm install vsce; node_modules/.bin/vsce package and installing the vsix via command pallete ) and they yield the exact same result: On loading any project that should trigger dlang-vscode, the syntax highlighting works, but all the commands yield the same error as shown above (Also, dlang-vscode does not try to install the tools at startup without any configuration).

LaurentTreguier commented 7 years ago

Weird... It's as if VSCode wasn't even activating the extension at all. What distro are you using?

MoritzMaxeiner commented 7 years ago

I'm using Funtoo Linux (a Gentoo derivative). The offending commit for this "nothing happens" is 89c468214f8ce4b6603736f8b22a84a8b45d16c3, (git bisect from 7860bcf04976f03bd85ca8ab229af84919304025 good to https://github.com/dlang-vscode/dlang-vscode/commit/e78066b7938fe6c813df21a62ddbe2ecfad00817 bad), so I'm assuming that some kind of additional step is necessary to get that SDlang dependency installed (in which case: I just love silent failures :) )

UPDATE: Ayup, installing the SDLang extension from the gallery fixes the issue. Kinda chilling, though, that VSCode just tells me zilch about one of my extensions missing a dependency :) In any case, sorry to have bothered you.

LaurentTreguier commented 7 years ago

Don't be sorry, I had forgotten about this. I don't know if I'm doing it wrong, but VSCode doesn't seem to automatically install dependencies... Which is weird, according to their docs it should do it. I'll remove it, maybe we should use an extension pack to bundle the dlang and sdl extensions together instead.

EDIT: actually, VSCode probably only installs dependencies when a extension is installed through the store. When installing it manually, all dependencies will always have to be installed manually too... I'll keep the depedency, but I'll also add instructions to the README for manual installation

MoritzMaxeiner commented 7 years ago

Ok, thanks for the explanation and clearing up the README, hopefully that will spare a future someone a bit of frustration.

michael-fadely commented 7 years ago

Is there any way I can get around this without building my own copy? I've built the tools it uses (e.g dcd client and server) separately and configured the binary paths accordingly, but it's seemingly still attempting to build them on its own instead of running my built binaries (and promptly failing).

(on Linux (Ubuntu 16.10) by the way)

LaurentTreguier commented 7 years ago

@SonicFreak94 Have you set d.tools.enabled.<tool name> to false ? This should prevent the extension from trying to build the named tool

michael-fadely commented 7 years ago

@LaurentTreguier I didn't; I figured that would disable their functionality entirely. Having just tried it, it does just that. To clarify, my goal was to have the tools launch from the configured paths. As it turns out though, I used incorrect relative paths, so my precompiled tools are working now. Disregard x_x

mattiascibien commented 7 years ago

@SonicFreak94 @mcferden I have merged the changes. Would you like to test with the latest master?