code-d icon indicating copy to clipboard operation
code-d copied to clipboard

Fails to install/run on first try clean system - m1 osx.

Open aliak00 opened this issue 3 years ago • 8 comments

Hey! Just tried to install the vscode extension, on am m1 mac (so no dmd - but do have ldc and dub)

Anyway, when I open a D file I get a serve-d related message asking if I would like to compile it. And then this happens:

Installing into ~/.vscode/extensions/webfreak.code-d-0.23.2/bin
Removing old version
Removed old version
> git clone --recursive https://github.com/Pure-D/serve-d.git serve-d
Cloning into 'serve-d'...
> git checkout v0.7.4
Note: switching to 'v0.7.4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at e1fcbb8 bump to 0.7.4
> /opt/homebrew/bin/dub upgrade
Upgrading project in ~/.vscode/extensions/webfreak.code-d-0.23.2/bin/serve-d
> /opt/homebrew/bin/dub build --compiler=ldc2

## Warning for package serve-d, configuration unittest-optimized ##

The following compiler flags have been specified in the package description
file. They are handled by DUB and direct use in packages is discouraged.
Alternatively, you can set the DFLAGS environment variable to pass custom flags
to the compiler, or use one of the suggestions below:

debugInfo: Call DUB with --build=debug
optimize: Call DUB with --build=release
unittests: Call DUB with --build=unittest

Invalid source/import path: ~.dub/packages/dfmt-0.14.1/dfmt/bin
Invalid source/import path: ~/.dub/packages/dscanner-0.11.1/dscanner/bin
Invalid source/import path: ~/.dub/packages/dcd-0.13.6/dcd/bin
Running pre-generate commands for dfmt...
/bin/sh: rdmd: command not found
Command failed with exit code 127: rdmd "~/.dub/packages/dfmt-0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

Is it that I have to install rdmd manually or something?

aliak00 avatar Jan 22 '22 21:01 aliak00

(I did uninstall and re-install - hence probably why the:

Removing old version
Removed old version

? 🤷

aliak00 avatar Jan 22 '22 21:01 aliak00

looks like it's trying to compile from source (because no prebuilt executables for arm mac) and rdmd is not installed (required dependency by dfmt)

WebFreak001 avatar Jan 22 '22 22:01 WebFreak001

Right, so to get it running I should compile some version of rdmd first and put it in my path?

Is that something that should be handled by the installation of the vscode plugin? Or is it expected that you are supposed to have rdmd?

aliak00 avatar Jan 22 '22 23:01 aliak00

rdmd comes with dmd and ldc if you install it directly from them, so DUB packages may depend on it to do some pre-build work, but package managers often separate it so that you need to install it individually, which is reasonable as well.

Since the introduction of -i and -run I think we can just replace the rdmd usage with $DC in dfmt and dscanner though.

WebFreak001 avatar Jan 23 '22 10:01 WebFreak001

ah, i installed ldc and dub from brew. Did not get an rdmd installation though there :(

image

Guess maybe the official installation might do rdmd - but i prefer brew so then guess I have to create a system for a custom bin folder I can control and rdmd in there.

aliak00 avatar Jan 24 '22 12:01 aliak00

(feel free to close ze issue if there's nothing else here!) 🙂

aliak00 avatar Jan 24 '22 12:01 aliak00

dfmt: https://github.com/dlang-community/dfmt/issues/472 D-Scanner: https://github.com/dlang-community/D-Scanner/issues/821

WebFreak001 avatar Jan 24 '22 14:01 WebFreak001

the changes required an update in dub which is now included with DMD 2.100 and the changes have been merged with dfmt and D-Scanner. Currently you still need them on the master branch, which you can try out now by cloning them and calling dub add-local <dir> on both of them and then building serve-d. (and then call dub remove-local <dir> on both of them again to unregister them globally)

WebFreak001 avatar Jun 13 '22 14:06 WebFreak001