File tree 3 files changed +10
-7
lines changed
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 7
7
8
8
use std:: env;
9
9
10
- use bootstrap:: { Build , Config , Subcommand } ;
10
+ use bootstrap:: { Build , Config , Subcommand , VERSION } ;
11
11
12
12
fn main ( ) {
13
13
let args = env:: args ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
14
14
let config = Config :: parse ( & args) ;
15
15
16
- let changelog_suggestion = check_version ( & config) ;
16
+ // check_version warnings are not printed during setup
17
+ let changelog_suggestion =
18
+ if matches ! ( config. cmd, Subcommand :: Setup { ..} ) { None } else { check_version ( & config) } ;
17
19
18
20
// NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
19
21
// changelog warning, not the `x.py setup` message.
@@ -40,8 +42,6 @@ fn main() {
40
42
}
41
43
42
44
fn check_version ( config : & Config ) -> Option < String > {
43
- const VERSION : usize = 2 ;
44
-
45
45
let mut msg = String :: new ( ) ;
46
46
47
47
let suggestion = if let Some ( seen) = config. changelog_seen {
Original file line number Diff line number Diff line change @@ -179,6 +179,8 @@ const LLVM_TOOLS: &[&str] = &[
179
179
"llvm-ar" , // used for creating and modifying archive files
180
180
] ;
181
181
182
+ pub const VERSION : usize = 2 ;
183
+
182
184
/// A structure representing a Rust compiler.
183
185
///
184
186
/// Each compiler has a `stage` that it is associated with and a `host` that
Original file line number Diff line number Diff line change 1
- use crate :: t ;
1
+ use crate :: { t , VERSION } ;
2
2
use std:: path:: { Path , PathBuf } ;
3
3
use std:: str:: FromStr ;
4
4
use std:: {
@@ -69,8 +69,9 @@ pub fn setup(src_path: &Path, profile: Profile) {
69
69
let path = cfg_file. unwrap_or_else ( || src_path. join ( "config.toml" ) ) ;
70
70
let settings = format ! (
71
71
"# Includes one of the default files in src/bootstrap/defaults\n \
72
- profile = \" {}\" \n ",
73
- profile
72
+ profile = \" {}\" \n \
73
+ changelog-seen = {}\n ",
74
+ profile, VERSION
74
75
) ;
75
76
t ! ( fs:: write( path, settings) ) ;
76
77
You can’t perform that action at this time.
0 commit comments