We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c21a04 commit db2a7b2Copy full SHA for db2a7b2
crates/build/src/command/docker.rs
@@ -76,7 +76,13 @@ pub(crate) fn create_docker_command(
76
77
// Get the target directory for the ELF in the context of the Docker container.
78
let relative_target_dir =
79
- (program_metadata.target_directory).strip_prefix(workspace_root).unwrap();
+ program_metadata.target_directory.strip_prefix(workspace_root).with_context(|| {
80
+ format!(
81
+ "Cargo target directory ({}) must be a child of the workspace directory ({}).\n\
82
+ This can happen if CARGO_TARGET_DIR is set to a location outside the workspace.",
83
+ program_metadata.target_directory, workspace_root
84
+ )
85
+ })?;
86
let target_dir = format!(
87
"/root/program/{}/{}/{}",
88
relative_target_dir,
0 commit comments