File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 77
88use std:: env;
99
10- use bootstrap:: { Build , Config , Subcommand } ;
10+ use bootstrap:: { Build , Config , Subcommand , VERSION } ;
1111
1212fn main ( ) {
1313 let args = env:: args ( ) . skip ( 1 ) . collect :: < Vec < _ > > ( ) ;
1414 let config = Config :: parse ( & args) ;
1515
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) } ;
1719
1820 // NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
1921 // changelog warning, not the `x.py setup` message.
@@ -40,8 +42,6 @@ fn main() {
4042}
4143
4244fn check_version ( config : & Config ) -> Option < String > {
43- const VERSION : usize = 2 ;
44-
4545 let mut msg = String :: new ( ) ;
4646
4747 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] = &[
179179 "llvm-ar" , // used for creating and modifying archive files
180180] ;
181181
182+ pub const VERSION : usize = 2 ;
183+
182184/// A structure representing a Rust compiler.
183185///
184186/// 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 } ;
22use std:: path:: { Path , PathBuf } ;
33use std:: str:: FromStr ;
44use std:: {
@@ -69,8 +69,9 @@ pub fn setup(src_path: &Path, profile: Profile) {
6969 let path = cfg_file. unwrap_or_else ( || src_path. join ( "config.toml" ) ) ;
7070 let settings = format ! (
7171 "# 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
7475 ) ;
7576 t ! ( fs:: write( path, settings) ) ;
7677
You can’t perform that action at this time.
0 commit comments