Skip to content

cargo waits on package cache lock when my crate has 0 dependencies  #11924

Open
@matthiaskrgr

Description

@matthiaskrgr

Problem

It seems that cargo is waiting for the lock on the package cache during cargo check, even if I have 0 dependencies stated in my Cargo.toml and we could theoretically build right away.

Steps

  1. cargo new myproj
  2. run cargo update on a large repo (i.e. servo)
  3. at the same time cargo check in myproj
    => Blocking waiting for file lock on package cache although myproj has 0 dependencies.

Possible Solution(s)

Skip looking into the cache entirely if we don't have any dependencies specified in Cargo.toml?

Notes

No response

Version

cargo 1.70.0-nightly (0e474cfd7 2023-03-31)
release: 1.70.0-nightly
commit-hash: 0e474cfd7b16b018cf46e95da3f6a5b2f1f6a9e7
commit-date: 2023-03-31
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:OpenSSL/1.1.1q)
os: Manjaro 22.1.0 (Talos) [64-bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cachingArea: caching of dependencies, repositories, and build artifactsC-bugCategory: bugP-lowPriority: LowPerformanceGotta go fast!S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions