d-language-server / dls

A Language Server implementation for D
http://dls.dub.pm
106 stars 15 forks source link

DLS doesn't pass the Dlang project tester anymore #15

Closed ghost closed 5 years ago

ghost commented 5 years ago

When it's tested with DMD ~master (buildkite) we got this log:


dls 0.16.0: building configuration "dls-test-library"...
--
  | Linking...
  | .dub/build/dls-test-library-debug-linux.posix-x86_64-dmd_2083-9565891A049306D0F0F224530B8197C2/dls-test-library.o:source/dls/util/uri.d:_D32TypeInfo_E3dls4util9constants2Tr6__initZ: error: undefined reference to '_D3dls4util9constants2Tr6__initZ'
  | collect2: error: ld returned 1 exit status
  | Error: linker exited with status 1
  | dmd failed with exit code 1.
  | 🚨 Error: The command exited with status 2

(linking error due to undefined reference)

LaurentTreguier commented 5 years ago

Oh. From the current release and onwards, I am using LDC to build binaries on all platforms, so I removed a workaround for this problem... I don't know how this happens. The workaround is simply to put the build command twice. For some reason the second time around it builds fine. The undefined reference refers to a module that is dynamically generated in a preGenerateCommand, that's the only clue I have about why this happens. I'll put back the workaround when I get back on my machine for now.

ghost commented 5 years ago

That's because of the command. The project properties (e.g what's interesting here is the list of source in this case) are already defined when the description is loaded i think. I'm almost sure i've heard before of a similar issue encountered by someone else.

ghost commented 5 years ago

solution would be to generate locally by hand and include the auto generated file in your repo then.

ghost commented 5 years ago

we do that for DCD too (constant completions for traits), the module is regenerated by hand.

LaurentTreguier commented 5 years ago

I looked up what other people might be doing for that, and saw this: git update-index --assume-unchanged. With this I can add an empty file to the repo, and its changes should be ignored at all time.

LaurentTreguier commented 5 years ago

Apparently it's fixed my Travis build with dmd-beta, so it seems to be working

LaurentTreguier commented 5 years ago

Actually git still nags me about the changes when the file is filled... But I'll see about that later.

ghost commented 5 years ago

Yes, i can confirm it's good now, just relaunched a buildkite job and it's green. Thanks.