Pure-D / serve-d

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

Test fails due to linking errors if --build was specified #351

Open the-horo opened 6 months ago

the-horo commented 6 months ago

Running dub test with --build=plain or specifying $DFLAGS leads to linking errors:

$ dub test --build=plain
<snip>
     Linking serve-d-test-unittest
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/happy/.dub/cache/serve-d/~master/build/serve-d-test-unittest-plain-rocVMvrAD7Ih_R6i7neQJw/serve-d-test-unittest.o: in function `_D6served9extension14makeServerInfoFZSQBk3lsp8protocol10ServerInfo':
/home/happy/d/dev/git/the-horo/dlang/serve-d/.dub/packages/silly/1.1.1/silly/silly.d:(.text._D6served9extension14makeServerInfoFZSQBk3lsp8protocol10ServerInfo[_D6served9extension14makeServerInfoFZSQBk3lsp8protocol10ServerInfo]+0x61): undefined reference
to `_D6served4info7VersionyAi'
/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: /home/happy/d/dev/git/the-horo/dlang/serve-d/.dub/packages/silly/1.1.1/silly/silly.d:(.text._D6served9extension14makeServerInfoFZSQBk3lsp8protocol10ServerInfo[_D6served9extension14makeServerInfoFZSQBk3lsp8protocol10ServerInfo]+0x8c): undefined reference to `_D6served4info13VersionSuffixyAa'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Error /usr/bin/dmd failed with exit code 1.

Forcing --build=unittest fixes the issue as well as adding unittests to buildOptions in dub.json for the unittest configuration. I can make a PR for this but I don't know if that' the right way to fix it.