@@ -920,7 +920,7 @@ impl CargoVariant {
920
920
}
921
921
922
922
pub ( crate ) trait DockerCommandExt {
923
- fn add_cargo_configuration_envvars ( & mut self ) ;
923
+ fn add_configuration_envvars ( & mut self ) ;
924
924
fn add_envvars (
925
925
& mut self ,
926
926
options : & DockerOptions ,
@@ -948,8 +948,8 @@ pub(crate) trait DockerCommandExt {
948
948
}
949
949
950
950
impl DockerCommandExt for Command {
951
- fn add_cargo_configuration_envvars ( & mut self ) {
952
- let non_cargo_prefix = & [
951
+ fn add_configuration_envvars ( & mut self ) {
952
+ let other = & [
953
953
"http_proxy" ,
954
954
"TERM" ,
955
955
"RUSTDOCFLAGS" ,
@@ -958,6 +958,7 @@ impl DockerCommandExt for Command {
958
958
"HTTPS_PROXY" ,
959
959
"HTTP_TIMEOUT" ,
960
960
"https_proxy" ,
961
+ "QEMU_STRACE" ,
961
962
] ;
962
963
let cargo_prefix_skip = & [
963
964
"CARGO_HOME" ,
@@ -968,15 +969,22 @@ impl DockerCommandExt for Command {
968
969
"CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER" ,
969
970
"CARGO_BUILD_RUSTDOC" ,
970
971
] ;
971
- let is_cargo_passthrough = |key : & str | -> bool {
972
- non_cargo_prefix. contains ( & key)
972
+ let cross_prefix_skip = & [
973
+ "CROSS_RUNNER" ,
974
+ "CROSS_RUSTC_MAJOR_VERSION" ,
975
+ "CROSS_RUSTC_MINOR_VERSION" ,
976
+ "CROSS_RUSTC_PATCH_VERSION" ,
977
+ ] ;
978
+ let is_passthrough = |key : & str | -> bool {
979
+ other. contains ( & key)
973
980
|| key. starts_with ( "CARGO_" ) && !cargo_prefix_skip. contains ( & key)
981
+ || key. starts_with ( "CROSS_" ) && !cross_prefix_skip. contains ( & key)
974
982
} ;
975
983
976
984
// also need to accept any additional flags used to configure
977
- // cargo, but only pass what's actually present.
985
+ // cargo or cross , but only pass what's actually present.
978
986
for ( key, _) in env:: vars ( ) {
979
- if is_cargo_passthrough ( & key) {
987
+ if is_passthrough ( & key) {
980
988
self . args ( [ "-e" , & key] ) ;
981
989
}
982
990
}
@@ -1018,20 +1026,12 @@ impl DockerCommandExt for Command {
1018
1026
// otherwise, zig has a permission error trying to create the cache
1019
1027
self . args ( [ "-e" , "XDG_CACHE_HOME=/target/.zig-cache" ] ) ;
1020
1028
}
1021
- self . add_cargo_configuration_envvars ( ) ;
1029
+ self . add_configuration_envvars ( ) ;
1022
1030
1023
1031
if let Some ( username) = id:: username ( ) . wrap_err ( "could not get username" ) ? {
1024
1032
self . args ( [ "-e" , & format ! ( "USER={username}" ) ] ) ;
1025
1033
}
1026
1034
1027
- if let Ok ( value) = env:: var ( "QEMU_STRACE" ) {
1028
- self . args ( [ "-e" , & format ! ( "QEMU_STRACE={value}" ) ] ) ;
1029
- }
1030
-
1031
- if let Ok ( value) = env:: var ( "CROSS_DEBUG" ) {
1032
- self . args ( [ "-e" , & format ! ( "CROSS_DEBUG={value}" ) ] ) ;
1033
- }
1034
-
1035
1035
if let Ok ( value) = env:: var ( "CROSS_CONTAINER_OPTS" ) {
1036
1036
if env:: var ( "DOCKER_OPTS" ) . is_ok ( ) {
1037
1037
msg_info. warn ( "using both `CROSS_CONTAINER_OPTS` and `DOCKER_OPTS`." ) ?;
0 commit comments