File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
25
25
let host_triple = env. host_tuple ( ) ;
26
26
let version = find_dist_version ( & dist_dir) ?;
27
27
28
+ let channel = version_to_channel ( & version) ;
29
+
28
30
// Extract rustc, libstd, cargo and src archives to create the optimized sysroot
29
31
let rustc_dir = extract_dist_dir ( & format ! ( "rustc-{version}-{host_triple}" ) ) ?. join ( "rustc" ) ;
30
32
let libstd_dir = extract_dist_dir ( & format ! ( "rust-std-{version}-{host_triple}" ) ) ?
@@ -61,9 +63,13 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
61
63
assert ! ( llvm_config. is_file( ) ) ;
62
64
63
65
let config_content = format ! (
64
- r#"profile = "user"
66
+ r#"
67
+ profile = "user"
65
68
change-id = 115898
66
69
70
+ [rust]
71
+ channel = "{channel}"
72
+
67
73
[build]
68
74
rustc = "{rustc}"
69
75
cargo = "{cargo}"
@@ -116,3 +122,13 @@ fn find_dist_version(directory: &Utf8Path) -> anyhow::Result<String> {
116
122
archive. strip_prefix ( "reproducible-artifacts-" ) . unwrap ( ) . split_once ( '-' ) . unwrap ( ) ;
117
123
Ok ( version. to_string ( ) )
118
124
}
125
+
126
+ /// Roughly convert a version string (`nightly`, `beta`, or `1.XY.Z`) to channel string (`nightly`,
127
+ /// `beta` or `stable`).
128
+ fn version_to_channel ( version_str : & str ) -> & ' static str {
129
+ match version_str {
130
+ "nightly" => "nightly" ,
131
+ "beta" => "beta" ,
132
+ _ => "stable" ,
133
+ }
134
+ }
You can’t perform that action at this time.
0 commit comments