jwilm/racerd

Compilation error

micbou opened this issue · 9 comments

I tried your PR ycm-core/ycmd#268 on Windows but I get the following error when compiling racerd:

Compiling syntex_syntax v0.20.0
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774:29: 774:40 error: use of undeclared type name `libc::DWORD` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774     const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
                                                                                                                                                                 ^~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774:29: 774:40 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774:53: 774:64 error: use of undeclared type name `libc::DWORD` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774     const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
                                                                                                                                                                                         ^~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:774:53: 774:64 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776:32: 776:43 error: use of undeclared type name `libc::DWORD` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776         fn GetStdHandle(which: libc::DWORD) -> libc::HANDLE;
                                                                                                                                                                    ^~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776:32: 776:43 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776:48: 776:60 error: use of undeclared type name `libc::HANDLE` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776         fn GetStdHandle(which: libc::DWORD) -> libc::HANDLE;
                                                                                                                                                                                    ^~~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:776:48: 776:60 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:777:43: 777:55 error: use of undeclared type name `libc::HANDLE` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:777         fn GetConsoleMode(hConsoleHandle: libc::HANDLE,
                                                                                                                                                                               ^~~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:777:43: 777:55 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778:35: 778:48 error: use of undeclared type name `libc::LPDWORD` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778                           lpMode: libc::LPDWORD) -> libc::BOOL;
                                                                                                                                                                       ^~~~~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778:35: 778:48 help: run `rustc --explain E0412` to see a detailed explanation
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778:53: 778:63 error: use of undeclared type name `libc::BOOL` [E0412]
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778                           lpMode: libc::LPDWORD) -> libc::BOOL;
                                                                                                                                                                                         ^~~~~~~~~~
C:/Users/micbou/.multirust/toolchains/beta/cargo\registry\src\github.com-0a35038f75765ae4\syntex_syntax-0.20.0\src\diagnostic.rs:778:53: 778:63 help: run `rustc --explain E0412` to see a detailed explanation
error: aborting due to 7 previous errors
Could not compile `syntex_syntax`.

I think you need to update the racer dependency because syntex_syntax compiles fine when using the official racer repository.

jwilm commented

Thanks for trying it! I thought I had this fixed on my branch of racer but apparently not. The same issue gave me grief on Mac.

I'll post back here when I think it's fixed 😄.

jwilm commented

I just updated racerd with the latest racer; the Rust ycmd branch was updated accordingly. Could you please give this another shot?

Thanks, @micbou!

I am now able to compile syntex_syntax but I am getting a new compilation error:

   Compiling matches v0.1.2
   Compiling winapi-build v0.1.1
   Compiling pkg-config v0.3.6
   Compiling traitobject v0.0.3
   Compiling vec_map v0.4.0
   Compiling libc v0.2.2
   Compiling typeable v0.1.2
   Compiling bitflags v0.3.3
   Compiling unicase v1.1.0
   Compiling unsafe-any v0.4.1
   Compiling unicode-xid v0.0.3
   Compiling lazy_static v0.1.15
   Compiling rustc-serialize v0.3.16
   Compiling typemap v0.3.3
   Compiling modifier v0.1.0
   Compiling httparse v1.1.0
   Compiling kernel32-sys v0.2.1
   Compiling winapi v0.2.5
   Compiling traitobject v0.0.1
error: could not exec the linker `gcc`: Access is denied. (os error 5)
Build failed, waiting for other jobs to finish...
Could not compile `kernel32-sys`.

I doubt this is an issue with racerd but rather a misconfiguration on my part. Unfortunately, I don't have any idea on how to fix it.

jwilm commented

The only help I'm really able to offer is some googling; here goes!

It looks like this guy ran into a similar issue. Discussion in the comments gave a link to build rust from source for windows which recommends how to install some dependencies. Naturally you would want to ignore the step about actually building rustc.

I just saw that tests are now passing on AppVeyor. Great job. It also means that I should be able to install racerd by following the steps from appveyor.yml. I am closing this issue then.

jwilm commented

@micbou yes, both here and on ycmd. Sadly, they seem to have doubled the run time for ycmd's appveyor build; the last ycmd commit I made ran on appveyor for 1 hour and 40 minutes (includes all variants in build matrix).

That's a shame. Maybe we should use AppVeyor cache to alleviate this.

jwilm commented

Most of the time building racerd is spent compiling its dependencies; just caching target/release/deps would have a big impact. It looks like the total size of the cache archive is supposed to be capped at 100MB. It's not clear whether the limit is hard. Anyway, gzipping that folder on my local machine ends up with a 104MB file. They might use some better compression, but it's a bummer anyway that we can't be more aggressive with caching. I'm going to play around with it a bit on this project.

jwilm commented

I spent some time caching various pieces of the racerd build. Caching the target and .cargo folders is trivial and has a big impact (see dd0f1bd). Adding caching for the OpenSSL, rustc, and rust source installations saved some time, but it required more extensive changes to the appveyor.yml (see cca3695). I think they are worth doing, but it would be better if someone more comfortable with windows/powershell could add that.

For now, I'm going to only add the target and .cargo folder caching in ycmd. It might be good to cache more downloads/object files in ycmd, but that's a discussion for somewhere else.