1 //! rustbuild, the Rust build system
3 //! This is the entry point for the build system used to compile the `rustc`
4 //! compiler. Lots of documentation can be found in the `README.md` file in the
5 //! parent directory, and otherwise documentation can be found throughout the `build`
6 //! directory in each respective module.
10 use bootstrap::{Build, Config};
13 let args = env::args().skip(1).collect::<Vec<_>>();
14 let config = Config::parse(&args);
16 let changelog_suggestion = check_version(&config);
17 if let Some(suggestion) = &changelog_suggestion {
18 println!("{}", suggestion);
21 Build::new(config).build();
23 if let Some(suggestion) = changelog_suggestion {
24 println!("{}", suggestion);
25 println!("note: this message was printed twice to make it more likely to be seen");
29 fn check_version(config: &Config) -> Option<String> {
30 const VERSION: usize = 1;
32 let mut msg = String::new();
34 let suggestion = if let Some(seen) = config.changelog_seen {
36 msg.push_str("warning: there have been changes to x.py since you last updated.\n");
37 format!("update `config.toml` to use `changelog-seen = {}` instead", VERSION)
42 msg.push_str("warning: x.py has made several changes recently you may want to look at\n");
43 format!("add `changelog-seen = {}` to `config.toml`", VERSION)
46 msg.push_str("help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`\n");
47 msg.push_str("note: to silence this warning, ");
48 msg.push_str(&suggestion);