@@ -11,7 +11,9 @@ use std::str::FromStr;
1111
1212/// Environment configuration 
1313#[ derive( Debug ,  Serialize ,  Deserialize ,  PartialEq ,  Eq ,  Default ) ]  
14+ #[ serde( rename_all = "kebab-case" ) ]  
1415pub  struct  CrossEnvConfig  { 
16+     ignore_cargo_config :  Option < bool > , 
1517    volumes :  Option < Vec < String > > , 
1618    passthrough :  Option < Vec < String > > , 
1719} 
@@ -273,6 +275,15 @@ impl CrossToml {
273275        self . get_value ( target,  |b| b. build_std ,  |t| t. build_std ) 
274276    } 
275277
278+     /// Returns the whether to ignore cargo config files. 
279+ pub  fn  ignore_cargo_config ( & self ,  target :  & Target )  -> ( Option < bool > ,  Option < bool > )  { 
280+         self . get_value ( 
281+             target, 
282+             |b| b. env . ignore_cargo_config , 
283+             |t| t. env . ignore_cargo_config , 
284+         ) 
285+     } 
286+ 
276287    /// Returns the list of environment variables to pass through for `build` and `target` 
277288pub  fn  env_passthrough ( & self ,  target :  & Target )  -> ( Option < & [ String ] > ,  Option < & [ String ] > )  { 
278289        self . get_ref ( 
@@ -489,6 +500,7 @@ mod tests {
489500            targets :  HashMap :: new ( ) , 
490501            build :  CrossBuildConfig  { 
491502                env :  CrossEnvConfig  { 
503+                     ignore_cargo_config :  Some ( false ) , 
492504                    volumes :  Some ( vec ! [ s!( "VOL1_ARG" ) ,  s!( "VOL2_ARG" ) ] ) , 
493505                    passthrough :  Some ( vec ! [ s!( "VAR1" ) ,  s!( "VAR2" ) ] ) , 
494506                } , 
@@ -506,6 +518,7 @@ mod tests {
506518          pre-build = ["echo 'Hello World!'"] 
507519
508520          [build.env] 
521+           ignore-cargo-config = false 
509522          volumes = ["VOL1_ARG", "VOL2_ARG"] 
510523          passthrough = ["VAR1", "VAR2"] 
511524        "# ; 
@@ -526,6 +539,7 @@ mod tests {
526539            } , 
527540            CrossTargetConfig  { 
528541                env :  CrossEnvConfig  { 
542+                     ignore_cargo_config :  None , 
529543                    passthrough :  Some ( vec ! [ s!( "VAR1" ) ,  s!( "VAR2" ) ] ) , 
530544                    volumes :  Some ( vec ! [ s!( "VOL1_ARG" ) ,  s!( "VOL2_ARG" ) ] ) , 
531545                } , 
@@ -580,6 +594,7 @@ mod tests {
580594                pre_build :  Some ( PreBuild :: Lines ( vec ! [ s!( "echo 'Hello'" ) ] ) ) , 
581595                runner :  None , 
582596                env :  CrossEnvConfig  { 
597+                     ignore_cargo_config :  None , 
583598                    passthrough :  None , 
584599                    volumes :  Some ( vec ! [ s!( "VOL" ) ] ) , 
585600                } , 
@@ -590,6 +605,7 @@ mod tests {
590605            targets :  target_map, 
591606            build :  CrossBuildConfig  { 
592607                env :  CrossEnvConfig  { 
608+                     ignore_cargo_config :  Some ( true ) , 
593609                    volumes :  None , 
594610                    passthrough :  Some ( vec ! [ ] ) , 
595611                } , 
@@ -607,6 +623,7 @@ mod tests {
607623            pre-build = [] 
608624
609625            [build.env] 
626+             ignore-cargo-config = true 
610627            passthrough = [] 
611628
612629            [target.aarch64-unknown-linux-gnu] 
@@ -648,6 +665,7 @@ mod tests {
648665            targets :  HashMap :: new ( ) , 
649666            build :  CrossBuildConfig  { 
650667                env :  CrossEnvConfig  { 
668+                     ignore_cargo_config :  None , 
651669                    passthrough :  None , 
652670                    volumes :  None , 
653671                } , 
0 commit comments