File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 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<()> {
2525 let host_triple = env. host_tuple ( ) ;
2626 let version = find_dist_version ( & dist_dir) ?;
2727
28+ let channel = version_to_channel ( & version) ;
29+
2830 // Extract rustc, libstd, cargo and src archives to create the optimized sysroot
2931 let rustc_dir = extract_dist_dir ( & format ! ( "rustc-{version}-{host_triple}" ) ) ?. join ( "rustc" ) ;
3032 let libstd_dir = extract_dist_dir ( & format ! ( "rust-std-{version}-{host_triple}" ) ) ?
@@ -61,9 +63,13 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
6163 assert ! ( llvm_config. is_file( ) ) ;
6264
6365 let config_content = format ! (
64- r#"profile = "user"
66+ r#"
67+ profile = "user"
6568change-id = 115898
6669
70+ [rust]
71+ channel = "{channel}"
72+
6773[build]
6874rustc = "{rustc}"
6975cargo = "{cargo}"
@@ -116,3 +122,13 @@ fn find_dist_version(directory: &Utf8Path) -> anyhow::Result<String> {
116122 archive. strip_prefix ( "reproducible-artifacts-" ) . unwrap ( ) . split_once ( '-' ) . unwrap ( ) ;
117123 Ok ( version. to_string ( ) )
118124}
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