-
Notifications
You must be signed in to change notification settings - Fork 2.9k
'cargo metadata' fails on read-only file system #10096
Copy link
Copy link
Open
Labels
A-lockfileArea: Cargo.lock issuesArea: Cargo.lock issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-metadataS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Metadata
Metadata
Assignees
Labels
A-lockfileArea: Cargo.lock issuesArea: Cargo.lock issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-metadataS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
I first reported this with rust-analyzer at rust-lang/rust-analyzer#10792: when running
cargo metadataon a read-only file system, it fails sayingHowever, the action RA is trying to perform is fundamentally a read-only operation (querying for information about the rustc compiler crates).
I don't think the currently available flags provide any way to make this work on a read-only file system either (I tried
--frozenbut as expected it refuses to download required crates from the network). Even if my toolchain was on a read-write file system I would not want RA'scargo metadatato change toolchain files, after all.Proposed Solution
cargo metadatashould either handle read-only file systems by falling back to not creating/updating the lock file -- or (IMO the right fix) it should not even attempt to mutate the workspace when what it is doing is a read-only operation like just determining the metadata.Notes
No response