Skip to content
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

Rust analyzer "cargo check" blocks debug builds #4616

Closed
cart opened this issue May 25, 2020 · 30 comments
Closed

Rust analyzer "cargo check" blocks debug builds #4616

cart opened this issue May 25, 2020 · 30 comments

Comments

@cart
Copy link

cart commented May 25, 2020

I'm working on a project where iterative compile times are important. If i make a change, save it, and immediately start a debug build then it will almost always get blocked by rust analyzer's invocation of the "cargo check" command. My build then needs to wait until cargo check completes.

Blocking doesn't occur if I run a release build. This creates the weird situation where release builds are actually faster to complete:

Finished release [optimized] target(s) in 0.80s

vs

Finished dev [unoptimized + debuginfo] target(s) in 1.31s

This is especially troublesome for initial cargo check runs, which can block builds for minutes at a time.

@matklad
Copy link
Member

matklad commented May 26, 2020

The workarounds are:

  • set "rust-analyzer.checkOnSave.enable": false (you should still get errors in the editor if you invoke build manually)
  • set "rust-analyzer.checkOnSave.extraArgs": ["--target-dir", "/path/to/proect/target/check"]

@cart
Copy link
Author

cart commented May 26, 2020

Brilliant. The second option is exactly what I was looking for. My first instinct was "why isn't this the default?", but then I looked at the target folder doubling in size. The current default behavior seems like the right choice for most people. Then people (like me) who are willing to trade some disk space for non-blocking behavior can do so. Ideally theres a way to avoid duplicate artifacts, have check on save enabled, and avoid blocks, but I understand that such an ask might be outside the bounds of the constraints rust-analyzer operates in. Maybe RA could detect when there is a user-initiated cargo lock contention and force-stop its internal cargo check execution?

Thanks for your help! I consider this issue solved for me.

@flodiebold
Copy link
Member

I wonder, if you let it share the target folders, does the cargo build that runs after check has finished have to rebuild all dependencies? Otherwise you might spend some time waiting for the lock, but it's maybe just time you'd otherwise spend waiting for the dependencies to build?

@lnicola
Copy link
Member

lnicola commented May 26, 2020

My impression is that cargo check is mostly but not completely a subset of cargo build. Running cargo check after cargo build will do some work, but will still take less than a clean check.

In a test with a tiny project depending on rand, cargo build took 1.2s for me, a clean cargo check took 1s and a cargo check after cargo build took 0.6s.

I think this is most annoying when you load a freshly-cloned/cleaned repository, but it's less of an issue otherwise.

@cart
Copy link
Author

cart commented May 26, 2020

Those numbers are relatively consistent with my rust-analyzer experience as well. In my project I get ~0.8 seconds for iterative debug builds (release vs debug is nearly indistinguishable) and ~1.3 seconds for iterative debug builds waiting on a rust analyzer cargo check.

Those numbers are definitely workable, but I've worked hard to make the change/build/run/check loop as tight as possible for my project (its a real time app with "hot reloading" in various forms). Every millisecond is valuable to me.

@lnicola
Copy link
Member

lnicola commented May 26, 2020

What if you set cargo build as your check command?

@cart
Copy link
Author

cart commented May 26, 2020

Thats a really smart idea. Sadly i just tested it and for some reason thats significantly slower for iterative builds (~1.5 seconds when immediately invoked and hitting a block. ~0.8 seconds when waiting for cargo check to finish). It seems like cargo decides it needs to re-do the work for some reason. Note that i have reverted the "custom target folder" configuration option.

@lnicola
Copy link
Member

lnicola commented May 26, 2020

That's without your previous watchexec setup, I assume, if you had one? If it's visibly slower when called from rust-analyzer compared to running it from the command line, it may be worth further investigation.

@cart
Copy link
Author

cart commented May 26, 2020

Nope no watchexec setup (i didnt even know what that was until now)

To be clear, the "cargo build" initialized by RA runs at the same speed as a command line "cargo build". The approach im using is:

  1. save change (RA cargo build triggers)
  2. manually run "cargo run" before RA "cargo build" finishes
    • EDIT (for clarity): this immediately blocks because of the RA cargo build
  3. RA "cargo build" finishes in ~0.8 seconds
  4. "cargo run" finishes in ~1.5 seconds.

@cart
Copy link
Author

cart commented May 26, 2020

I have a feeling that using something like watchexec to run the binary whenever RA's cargo build finishes would give me 0.8 second build/runs. But then im running the program every time i save a file (which isn't desirable)

@lnicola
Copy link
Member

lnicola commented May 26, 2020

Yeah, I was about to suggest using cargo run instead of build/check. Note that we pass --all-features by default, that might explain why run takes longer.

@cart
Copy link
Author

cart commented May 26, 2020

I was sure that was going to be it, but sadly passing --all-features to cargo run also didnt change the total build/run time.

@lnicola
Copy link
Member

lnicola commented May 26, 2020

Different environment options might also trigger rebuilds. You could try to start Code from a terminal, then use the Code terminal to run cargo run. But it's pretty far-fetched :-).

Still, might be a fun issue to look at.

@cart
Copy link
Author

cart commented May 26, 2020

Sadly that also had no effect for me. However that might be because my vscode is a "snap", which might change the env variables.

@matklad
Copy link
Member

matklad commented May 27, 2020

I think it's fair to close this: although the probelm is real, I don't think we'll be able to come up with anything better than the current set of work-arounds.

@dpc
Copy link

dpc commented Dec 9, 2020

Another solution/workaround idea would be for rust-analyzer to use normal debug builds for dependencies, so that the cargo build can just re-use the work rust-analyzer just did.

@lnicola
Copy link
Member

lnicola commented Dec 9, 2020

Another solution/workaround idea would be for rust-analyzer to use normal debug builds for dependencies, so that the cargo build can just re-use the work rust-analyzer just did.

It runs cargo check by default, which means that the build artifacts are shared between it and a cargo build. So normally there's no slowdown from letting RA run cargo check.

But there might still be a bug, e.g. if a no-op cargo check takes too much time in RA.

@Ralith
Copy link

Ralith commented Jun 16, 2021

This is still a big problem for me as my build relies on RUSTFLAGS which, afaict, there's no way to pass to rust-analyzer. Each check invocation therefore throws out the entire build cache, meaning I have to start from scratch repeatedly. I have "rust-analyzer.checkOnSave.extraArgs": ["--target-dir", "target/check"] in my global settings, but this appears to have silently stopped working about a month ago.

@lnicola
Copy link
Member

lnicola commented Jun 16, 2021

You can set environment variables using server.extraEnv or something like that.

@Ralith
Copy link

Ralith commented Jun 16, 2021

Tried that, now it's clobbering my cache every time I try to build instead of every startup :(

e: that seems to have stopped for now, might have involved the "loading metadata" step rather than the check?

@Ralith
Copy link

Ralith commented Jul 10, 2021

This is continuing to be a (very frustrating) problem. It looks like every time RA declares it's "loading metadata", it clobbers my debug compile cache. This happens at least once every time I launch vscode, and often at other times, sometimes several times in a row (maybe every time I touch a Cargo.toml? but also sometimes when I haven't...). My environment is set consistently between my terminal and rust-analyzer.server.extraEnv; it seems like RA is ignoring the latter for some of its operations.

@Veykril
Copy link
Member

Veykril commented Jul 10, 2021

What do your RUSTFLAGS/analyzer.server.extraEnv contain? Assuming this is indeed the problem.

Knowing how to reproduce this would be helpful.

cc #5828

@Ralith
Copy link

Ralith commented Jul 11, 2021

Relevant configuration segment:

    "terminal.integrated.env.windows": {
        "RUSTFLAGS": "-L${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release",
        "RUSTC_FORCE_INCREMENTAL": "1"
    },
    "rust-analyzer.server.extraEnv": {
        "RUSTFLAGS": "-L${workspaceFolder}\\..\\OpenXR-SDK\\build\\src\\loader\\Release",
        "RUSTC_FORCE_INCREMENTAL": "1"
    },

@Veykril
Copy link
Member

Veykril commented Jul 18, 2021

Good new is I can reproduce this, bad news is I still don't see why this is happening but its certainly RUSTFLAGS related ...

Note that you can set the rustflags in the .cargo/config.toml which should work fine.

@Veykril
Copy link
Member

Veykril commented Jul 18, 2021

So ${workspaceFolder} isnt being substituted in settings, "terminal.integrated.env.windows" is special cause its innate to vscode, extensions can't substitute these OTOH.

@Ralith so you have to replace the ${workspaceFolder} in the RUSTFLAGS, vscode doesnt allow up to substitute this ourselves unfortunately.

@Veykril
Copy link
Member

Veykril commented Jul 18, 2021

Well I suppose we could support the known set ourselves here... cc #9626

@Ralith
Copy link

Ralith commented Jul 18, 2021

Thanks for investigating!

@mirgee
Copy link

mirgee commented Aug 15, 2021

Did anyone found out how to set rust-analyzer config with YouCompleteMe? Is it possible to set it via .ycm_extra_config.py? I tried different variations of, e.g.:

def Settings( **kwargs ):
    return {
        "checkOnSave": {
           "enable": False
        }
    }

with no effect.

@matklad
Copy link
Member

matklad commented Aug 16, 2021

@mirgee note that we log the config we get from the editor. When using vscode, I enable logs like

λ RA_LOG=rust_analyzer=info code .

look for [INFO rust_analyzer::config] updating config from JSON: line, it might help you to map what you write in Python to what rust-analyzer actually sees.

@jsha
Copy link

jsha commented Nov 22, 2022

Documenting for anyone else running into this issue:

I was having lots of spurious rebuilds for the openssl-sys package (and some dependees of it). It turned out to be because I was setting $PKG_CONFIG_PATH to something custom in my .bashrc. I run VSCode via the Unity launcher, not from a terminal, so it was not getting the setting from .bashrc.. But as soon as I opened a terminal, whether within VSCode or not, that terminal had a different $PKG_CONFIG_PATH and so triggered a rebuild.

Removing the line in my .bashrc that sets $PKG_CONFIG_PATH fixed it.

Here's a minimal project to reproduce:

src/main.rs

fn main() {
    println!("Hello, world6!");
}

src/Cargo.toml

[package]
name = "rebuild-repro"
version = "0.1.0"
[dependencies]
openssl-sys = "0.9.77"

~/.bashrc

export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"

cargo 1.67.0-nightly (eb5d35917 2022-11-17)
VSCode 1.73.1

And here's how I debugged:

  1. In an editor pane, change the program in a trivial way and save.

  2. Note that cargo check takes a few seconds.

  3. In a terminal pane, run cargo build. Note that it takes a few seconds, and rebuilds openssl-sys.

  4. Repeat back-and-forth, noting the slowness each time.

  5. In the terminal pane, run:

    CARGO_LOG=cargo::core::compiler::fingerprint=info RUST_LOG=trace cargo -vv build > ~/slow-rebuild-log-1.txt 2>&1

  6. In ~/slow-rebuild-log-1.txt, notice the lines:

[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint]     err: current filesystem status shows we're outdated
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint] fingerprint error for openssl-sys v0.9.77/RunCustomBuild/TargetInner { ..: custom_build_target("build-script-main", "/home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77/build/main.rs", Edition2015) }
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint]     err: env var `PKG_CONFIG_PATH` changed: previously Some("/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig::/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig"), now Some("/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig::/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig")

Note the mention of PKG_CONFIG_PATH. This happens because openssl-sys has a build script: build.rs. That invokes pkg-config, which emits a bunch of rerun-if-changed commands for Cargo, including cargo:rerun-if-env-changed=PKG_CONFIG.

I noticed that the "new" version of PKG_CONFIG_PATH included some directories that were specific to my user, which led me to look for that variable in my dotfiles and find it in .bashrc.

Hope this is helpful to someone in the future!

Bonus helpful link: https://doc.rust-lang.org/stable/cargo/faq.html#why-is-cargo-rebuilding-my-code

slow-rebuild-log-1.txt
    Blocking waiting for file lock on build directory
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint] dependency on `build_script_main` is newer than we are 1669150759.255947158s > 1669150603.416814653s "/home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77"
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint] fingerprint error for rebuild-repro v0.1.0 (/home/jsha/rust/rebuild-repro)/Build/TargetInner { name: "rebuild-repro", doc: true, ..: with_path("/home/jsha/rust/rebuild-repro/src/main.rs", Edition2021) }
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint]     err: current filesystem status shows we're outdated
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint] fingerprint error for openssl-sys v0.9.77/Build/TargetInner { ..: lib_target("openssl-sys", ["lib"], "/home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77/src/lib.rs", Edition2015) }
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint]     err: current filesystem status shows we're outdated
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint] fingerprint error for openssl-sys v0.9.77/RunCustomBuild/TargetInner { ..: custom_build_target("build-script-main", "/home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77/build/main.rs", Edition2015) }
[2022-11-22T20:59:21Z INFO  cargo::core::compiler::fingerprint]     err: env var `PKG_CONFIG_PATH` changed: previously Some("/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig::/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig"), now Some("/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig:/home/jsha/local/lib/pkgconfig::/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib/pkgconfig")
       Fresh autocfg v1.1.0
       Fresh cc v1.0.77
       Fresh pkg-config v0.3.26
   Compiling openssl-sys v0.9.77
       Fresh libc v0.2.137
     Running `/home/jsha/rust/rebuild-repro/target/debug/build/openssl-sys-ea23160e4c72873c/build-script-main`
[openssl-sys 0.9.77] cargo:rustc-cfg=const_fn
[openssl-sys 0.9.77] cargo:rustc-cfg=openssl
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
[openssl-sys 0.9.77] X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
[openssl-sys 0.9.77] OPENSSL_LIB_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
[openssl-sys 0.9.77] X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
[openssl-sys 0.9.77] OPENSSL_INCLUDE_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
[openssl-sys 0.9.77] X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_DIR
[openssl-sys 0.9.77] OPENSSL_DIR unset
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=SYSROOT
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
[openssl-sys 0.9.77] cargo:rustc-link-lib=ssl
[openssl-sys 0.9.77] cargo:rustc-link-lib=crypto
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_PATH
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
[openssl-sys 0.9.77] cargo:rerun-if-changed=build/expando.c
[openssl-sys 0.9.77] OPT_LEVEL = Some("0")
[openssl-sys 0.9.77] TARGET = Some("x86_64-unknown-linux-gnu")
[openssl-sys 0.9.77] HOST = Some("x86_64-unknown-linux-gnu")
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CC_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] CC_x86_64-unknown-linux-gnu = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CC_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] CC_x86_64_unknown_linux_gnu = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_CC
[openssl-sys 0.9.77] HOST_CC = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CC
[openssl-sys 0.9.77] CC = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CFLAGS_x86_64-unknown-linux-gnu
[openssl-sys 0.9.77] CFLAGS_x86_64-unknown-linux-gnu = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CFLAGS_x86_64_unknown_linux_gnu
[openssl-sys 0.9.77] CFLAGS_x86_64_unknown_linux_gnu = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=HOST_CFLAGS
[openssl-sys 0.9.77] HOST_CFLAGS = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CFLAGS
[openssl-sys 0.9.77] CFLAGS = None
[openssl-sys 0.9.77] cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
[openssl-sys 0.9.77] CRATE_CC_NO_DEFAULTS = None
[openssl-sys 0.9.77] DEBUG = Some("true")
[openssl-sys 0.9.77] CARGO_CFG_TARGET_FEATURE = Some("fxsr,llvm14-builtins-abi,sse,sse2")
[openssl-sys 0.9.77] running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "/usr/include" "-Wall" "-Wextra" "-E" "build/expando.c"
[openssl-sys 0.9.77] exit status: 0
[openssl-sys 0.9.77] version: 3_0_2
[openssl-sys 0.9.77] cargo:rustc-cfg=osslconf="OPENSSL_NO_SSL3_METHOD"
[openssl-sys 0.9.77] cargo:conf=OPENSSL_NO_SSL3_METHOD
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl300
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl101
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl102
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl102f
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl102h
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl110
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl110f
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl110g
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl110h
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl111
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl111b
[openssl-sys 0.9.77] cargo:rustc-cfg=ossl111c
[openssl-sys 0.9.77] cargo:version_number=30000020
[openssl-sys 0.9.77] cargo:include=/usr/include
     Running `CARGO=/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo CARGO_CRATE_NAME=openssl_sys CARGO_MANIFEST_DIR=/home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77 CARGO_PKG_AUTHORS='Alex Crichton <alex@alexcrichton.com>:Steven Fackler <sfackler@gmail.com>' CARGO_PKG_DESCRIPTION='FFI bindings to OpenSSL' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=openssl-sys CARGO_PKG_REPOSITORY='https://github.com/sfackler/rust-openssl' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.9.77 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=9 CARGO_PKG_VERSION_PATCH=77 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/jsha/rust/rebuild-repro/target/debug/deps:/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/jsha/rust/rebuild-repro/target/debug/build/openssl-sys-d302818e9941e583/out rustc --crate-name openssl_sys /home/jsha/.cargo/registry/src/index.crates.io-93a9e06d8945f2c0/openssl-sys-0.9.77/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=5000c6011fb6dcd0 -C extra-filename=-5000c6011fb6dcd0 --out-dir /home/jsha/rust/rebuild-repro/target/debug/deps -L dependency=/home/jsha/rust/rebuild-repro/target/debug/deps --extern libc=/home/jsha/rust/rebuild-repro/target/debug/deps/liblibc-be771ccdf8acea64.rmeta --cap-lints warn -l ssl -l crypto --cfg const_fn --cfg openssl --cfg 'osslconf="OPENSSL_NO_SSL3_METHOD"' --cfg ossl300 --cfg ossl101 --cfg ossl102 --cfg ossl102f --cfg ossl102h --cfg ossl110 --cfg ossl110f --cfg ossl110g --cfg ossl110h --cfg ossl111 --cfg ossl111b --cfg ossl111c`
   Compiling rebuild-repro v0.1.0 (/home/jsha/rust/rebuild-repro)
     Running `CARGO=/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=rebuild-repro CARGO_CRATE_NAME=rebuild_repro CARGO_MANIFEST_DIR=/home/jsha/rust/rebuild-repro CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=rebuild-repro CARGO_PKG_REPOSITORY='' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=0.1.0 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=1 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 LD_LIBRARY_PATH='/home/jsha/rust/rebuild-repro/target/debug/deps:/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib:/home/jsha/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib' rustc --crate-name rebuild_repro --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=b6f75a22ff169989 -C extra-filename=-b6f75a22ff169989 --out-dir /home/jsha/rust/rebuild-repro/target/debug/deps -C incremental=/home/jsha/rust/rebuild-repro/target/debug/incremental -L dependency=/home/jsha/rust/rebuild-repro/target/debug/deps --extern openssl_sys=/home/jsha/rust/rebuild-repro/target/debug/deps/libopenssl_sys-5000c6011fb6dcd0.rlib`
    Finished dev [unoptimized + debuginfo] target(s) in 2.26s

vimpostor added a commit to vimpostor/dotfiles that referenced this issue Feb 28, 2024
Otherwise if we want to build manually in a different terminal after
saving, we will get an annoying conflict, where our build is blocked by
the editor build until it is finished:
"Blocking waiting for file lock on build directory"

rust-analyzer can still autocomplete just fine if we disable
checkOnSave, we will just miss out on the cargo check warnings.

ref: rust-lang/rust-analyzer#4616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants