-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Option to ignore missing workspace members when building #14566
Copy link
Copy link
Closed
Labels
A-workspacesArea: workspacesArea: workspacesC-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`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.Status: Needs more info, such as a reproduction or more background for a feature request.
Metadata
Metadata
Assignees
Labels
A-workspacesArea: workspacesArea: workspacesC-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`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.Status: Needs more info, such as a reproduction or more background for a feature request.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Given the following virtual workspace:
Building
bin1withcargo build -p bin1should be allowed even ifbin2is missing from the file system.Use case: In docker when building a binary, only the relevant files are sent to the build context. For example, consider the following ignore file for building
bin1The binary is then built with:
cargo build -p bin1 --locked --releaseThis fails with
error: failed to load manifest for workspace member /code/app/bin2because the other binaries which are members of the workspace aren't present, but they are irrelevant to this build so should not be needed.
Proposed Solution
An option to prevent a build from failing because of a missing member.
This could be done either:
through a flag:
cargo build -p bin1 --ignore-missing-members(with a better flag name)or directly in the manifest?
Notes
No response