New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore parse-only
to rustc
#748
Conversation
It seems that neomake#613 deleted the args passed to rustc, as introduced in neomake#276. This PR restores the args (`-Z parse-only`), so neomake#275 will not be reopened.
Ping @fuine |
I decided to remove parse-only for two reasons:
Current solution is especially bad for |
Also let me know if you have regression as described in #275, I use |
@xcambar |
Closing this for now, feel free to re-open. |
Sorry I'm late to reply. I'm fine with closing the PR. Note that I'm a super extra noob to Rust, still figuring out the environment, and as such I may not be the best person to discuss the choices of more seasoned Rust devs such as @fuine until I'm more comfortable with the ins and outs of Rust's tooling. |
@fuine what kind of Neomake configuration are you running with now then? I'm now getting a lot of "unresolved import" errors with make-on-save when working on files in a Cargo-managed project. Have you just disabled the |
The Cargo maker is also significantly slower than the Rust maker, so relying only on the former is a bit of a chore. For my current project, it takes 23 seconds from save until the errors are shown.. |
@jonhoo these are selected lines from my
The time to show warnings is not an issue of neomake, but rather it's the time it takes cargo to perform the whole debug build of your project. That being said 23 seconds is still suspiciously high number - usually cargo will take much longer compile time if:
the latter could be avoided with Rust community is currently working on implementing incremental compilation, alpha version of which is currently in the nightly compiler, so you might take a look at it, if the build time is really bugging you. Note that this feature is of course unstable. To learn more about it visit this link. |
Following this change, I'm currently using, which amounts to about the same let g:neomake_rust_enabled_makers = []
autocmd! BufWritePost * Neomake
autocmd BufWritePost *.rs Neomake! cargo I'm working on a decently sized project, and ~23 seconds is the build time if the previous build did not complete (but with all dependencies compiled). Note that the errors appear almost instantly, so I wonder if there's a flag we can pass to Cargo so that it will terminate early if any part of the compilation process fails with an error: $ cargo build -v
Fresh rustc-serialize v0.3.21
Fresh libc v0.1.12
...
Fresh thread_local v0.2.7
Fresh regex v0.1.80
Compiling foobar v0.1.0 (file:///home/jon/dev/projects/foobar)
Running `rustc src/lib.rs --crate-name foobar --crate-type lib -g -C metadata=52b528dae9da63ec -C extra-filename=-52b528dae9da63ec --out-dir /home/jon/dev/projects/foobar/target/debug/deps --emit=dep-info,link -L dependency=/home/jon/dev/projects/foobar/target/debug/deps [more externs] -L /home/jon/dev/projects/foobar/target/debug/build/randomkit-c6d77419a385d677/out`
error[E0428]: a type named `Domain` has already been defined in this module
--> src/flow/alt.rs:51:1
|
8 | struct Domain(usize);
| --------------------- previous definition of `Domain` here
...
51 | pub struct Domain(usize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ already defined
[various other errors]
error: aborting due to previous error
[~20 seconds pause]
error: Could not compile `distributary`.
To learn more, run the command again with --verbose.
Command exited with non-zero status 101
20.99user 0.06system 0:21.08elapsed 99%CPU (0avgtext+0avgdata 153860maxresident)k
0inputs+352outputs (0major+21988minor)pagefaults 0swaps I see the same behavior when I run the |
Upon further inspection, this is probably related to rust-lang/rust#37477. Once that is fixed, this would hopefully be much more manageable. |
For others with the same issue, unsetting |
Nice, i wanted to note that i couldnt observe this, and now i know why. Sadly at the moment there isn't any way of getting errors/warnings faster without using unstable features. If compile times are that much of a problem, then i'd suggest you try them out - |
For future record, we should probably also track rust-lang/cargo#1313, as that command sounds like exactly what we want here. |
rust-lang/cargo#1313 has already landed in nightly Cargo. |
It seems that #613 deleted the args passed to
rustc
, as introduced in #276, causing a regression as described in #275.This PR restores the args (
-Z parse-only
).