Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
195 stars 48 forks source link

Install error on macOS aarm64, compilation error. #333

Closed pinver closed 10 months ago

pinver commented 11 months ago

Trying to install on macOS 15.5 on a M2 Mac, VSCode 1.80.2, using the marketplace, it seems there's no prebuilt binary, so the installer suggested a build, and that's the results:

Installing into /Users/pinver/.vscode/extensions/webfreak.code-d-0.23.2/bin
> 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
> /Users/pinver/dlang/dmd-2.104.2/osx/bin/dub upgrade
   Upgrading project in /Users/pinver/.vscode/extensions/webfreak.code-d-0.23.2/bin/serve-d/
    Fetching automem 0.6.9 (getting selected version)
    Fetching silly 1.1.1 (getting selected version)
    Fetching taggedalgebraic 0.11.22 (getting selected version)
    Fetching dub 1.26.1 (getting selected version)
    Fetching emsi_containers 0.8.0 (getting selected version)
    Fetching dcd 0.13.6 (getting selected version)
    Fetching test_allocator 0.3.4 (getting selected version)
    Fetching eventcore 0.9.25 (getting selected version)
    Fetching libasync 0.8.6 (getting selected version)
    Fetching standardpaths 0.8.1 (getting selected version)
    Fetching vibe-d 0.9.6 (getting selected version)
    Fetching diet-complete 0.0.3 (getting selected version)
    Fetching dunit 1.0.16 (getting selected version)
    Fetching eventsystem 1.2.0 (getting selected version)
    Fetching dfmt 0.14.1 (getting selected version)
    Fetching inifiled 1.3.3 (getting selected version)
    Fetching painlesstraits 0.3.0 (getting selected version)
    Fetching vibe-core 2.2.0 (getting selected version)
    Fetching requests 1.1.7 (getting selected version)
    Fetching painlessjson 1.4.0 (getting selected version)
    Fetching workspace-d 3.7.0 (getting selected version)
    Fetching dsymbol 0.11.3 (getting selected version)
    Fetching dscanner 0.11.1 (getting selected version)
    Fetching diet-ng 1.8.1 (getting selected version)
    Fetching openssl 3.3.0 (getting selected version)
    Fetching xdgpaths 0.2.5 (getting selected version)
    Fetching unit-threaded 0.10.8 (getting selected version)
    Fetching libdparse 0.17.0 (getting selected version)
    Fetching openssl-static 1.0.2+3.0.8 (getting selected version)
    Fetching rm-rf 0.1.0 (getting selected version)
    Fetching memutils 1.0.9 (getting selected version)
    Fetching msgpack-d 1.0.1 (getting selected version)
    Fetching stdx-allocator 2.77.5 (getting selected version)
    Fetching libddoc 0.7.4 (getting selected version)
    Fetching cachetools 0.4.1 (getting selected version)
    Fetching mir-linux-kernel 1.0.1 (getting selected version)
    Fetching isfreedesktop 0.1.1 (getting selected version)
             Not upgrading sub package in http
             Not upgrading sub package in lsp
             Not upgrading sub package in serverbase

Note: specify -s to also upgrade sub packages.
> /Users/pinver/dlang/dmd-2.104.2/osx/bin/dub build --compiler=/Users/pinver/dlang/dmd-2.104.2/osx/bin/dmd
     Warning 
     Warning ## Warning for package serve-d, configuration unittest-optimized ##
     Warning 
     Warning The following compiler flags have been specified in the package description
     Warning file. They are handled by DUB and direct use in packages is discouraged.
     Warning Alternatively, you can set the DFLAGS environment variable to pass custom flags
     Warning to the compiler, or use one of the suggestions below:
     Warning 
     Warning debugInfo: Call DUB with --build=debug
     Warning optimize: Call DUB with --build=release
     Warning unittests: Call DUB with --build=unittest
     Warning 
     Warning Invalid source/import path: /Users/pinver/.dub/packages/dfmt/0.14.1/dfmt/bin
     Warning Invalid source/import path: /Users/pinver/.dub/packages/dscanner/0.11.1/dscanner/bin
     Warning Invalid source/import path: /Users/pinver/.dub/packages/dcd/0.13.6/dcd/bin
     Pre-gen Running commands for dfmt
/bin/sh: rdmd: command not found
Error Command failed with exit code 127: rdmd "/Users/pinver/.dub/packages/dfmt/0.14.1/dfmt/dubhash.d"
Failed to install serve-d (Error code 2)

Note: rdmd is present alongside dmd in the bin directory.

redthing1 commented 10 months ago

Are you sure rdmd is in your path? On my system:

❯ where rdmd
/usr/local/bin/rdmd

Try this command.

pinver commented 10 months ago

Ok, that was the problem: I forgot that serve-d is able to autodetect the $HOME/dlang installations, but dub is not able to find common build tools that are located in its own directory (sigh).

That solved this specific problem, but resulted in another compilation error (I will open another issue for that if not already present)