@@ -17,7 +17,7 @@ use subprocess::{Exec, Redirection};
17
17
use crate :: manifest:: component_build_configs;
18
18
19
19
/// If present, run the build command of each component.
20
- pub async fn build ( manifest_file : & Path , component_ids : & [ String ] ) -> Result < ( ) > {
20
+ pub async fn build ( manifest_file : & Path , component_ids : & [ String ] , skip_target_checks : bool ) -> Result < ( ) > {
21
21
let ( components, deployment_targets, manifest) = component_build_configs ( manifest_file)
22
22
. await
23
23
. with_context ( || {
@@ -37,7 +37,8 @@ pub async fn build(manifest_file: &Path, component_ids: &[String]) -> Result<()>
37
37
build_result?;
38
38
39
39
if let Ok ( manifest) = & manifest {
40
- if !deployment_targets. is_empty ( ) {
40
+ let should_check_targets = !skip_target_checks && !deployment_targets. is_empty ( ) ;
41
+ if should_check_targets {
41
42
let resolution_context =
42
43
spin_environments:: ResolutionContext :: new ( manifest_file. parent ( ) . unwrap ( ) ) . await ?;
43
44
spin_environments:: validate_application_against_environment_ids (
@@ -163,6 +164,6 @@ mod tests {
163
164
#[ tokio:: test]
164
165
async fn can_load_even_if_trigger_invalid ( ) {
165
166
let bad_trigger_file = test_data_root ( ) . join ( "bad_trigger.toml" ) ;
166
- build ( & bad_trigger_file, & [ ] ) . await . unwrap ( ) ;
167
+ build ( & bad_trigger_file, & [ ] , true ) . await . unwrap ( ) ;
167
168
}
168
169
}
0 commit comments