From 47ba70d1b01af6051d7d9b892d9bd9174938f6de Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 16:11:40 -0700 Subject: [PATCH 01/12] make progress output options, as it looks horrible on windows in powershell in vscode. --- README.md | 24 ++++++++++++++++++++++++ elan-init.ps1 | 1 + elan-init.sh | 1 + src/elan-cli/common.rs | 2 +- src/elan-cli/download_tracker.rs | 6 ++++-- src/elan-cli/elan_mode.rs | 11 ++++++++--- src/elan-cli/self_update.rs | 18 ++++-------------- src/elan-cli/setup_mode.rs | 7 ++++++- 8 files changed, 49 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e8188b0..0e16c6c 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,27 @@ On some systems, `lean`/`leanpkg` will not work out of the box even if installed * Removed Windows installer... for now? * Merged `CARGO_HOME` and `RUSTUP_HOME` * Removed options to configure host triple + +# Build + +You need to set the following environment variables: + +``` +export OUT_DIR="~/dist/elan" +export RELEASE_TARGET_NAME="1.0.8" +cargo build +``` + +# Build on Windows + +The windows build requires a windows version of `perl.exe` which you can download from [https://strawberryperl.com/](https://strawberryperl.com/). +Make sure this downloaded perl.exe is the first thing in your PATH so that the build does not try and use `c:\Program Files\Git\usr\bin\perl.exe`. +The git provided version of perl doesn't work for some reason. + +Then run this: + +``` +set OUT_DIR=d:\dist\elan +set RELEASE_TARGET_NAME=1.0.8 +cargo build +``` \ No newline at end of file diff --git a/elan-init.ps1 b/elan-init.ps1 index 36e5578..941094d 100644 --- a/elan-init.ps1 +++ b/elan-init.ps1 @@ -21,6 +21,7 @@ FLAGS: --no-modify-path Don't configure the PATH environment variable -h, --help Prints help information -V, --version Prints version information + -s, --silent No progress output OPTIONS: --default-toolchain Choose a default toolchain to install diff --git a/elan-init.sh b/elan-init.sh index f36a9f5..f645840 100755 --- a/elan-init.sh +++ b/elan-init.sh @@ -32,6 +32,7 @@ FLAGS: --no-modify-path Don't configure the PATH environment variable -h, --help Prints help information -V, --version Prints version information + -s, --silent No progress output OPTIONS: --default-toolchain Choose a default toolchain to install diff --git a/src/elan-cli/common.rs b/src/elan-cli/common.rs index 37a4d33..c22bad7 100644 --- a/src/elan-cli/common.rs +++ b/src/elan-cli/common.rs @@ -99,7 +99,7 @@ pub fn read_line() -> Result { "unable to read from stdin for confirmation".into()) } -pub fn set_globals(verbose: bool) -> Result { +pub fn set_globals(verbose: bool, silent: bool) -> Result { use download_tracker::DownloadTracker; use std::cell::RefCell; diff --git a/src/elan-cli/download_tracker.rs b/src/elan-cli/download_tracker.rs index be6b9e7..6453c5c 100644 --- a/src/elan-cli/download_tracker.rs +++ b/src/elan-cli/download_tracker.rs @@ -33,6 +33,8 @@ pub struct DownloadTracker { /// display the progress info. /// In that case, we do not want to do some cleanup stuff we normally do. displayed_progress: bool, + /// Whether to show any progress + progress: bool } impl DownloadTracker { @@ -47,6 +49,7 @@ impl DownloadTracker { last_sec: None, term: term::stdout(), displayed_progress: false, + progress: true } } @@ -88,8 +91,7 @@ impl DownloadTracker { let elapsed = current_time - start; if elapsed >= 1.0 { self.seconds_elapsed += 1; - - self.display(); + if (self.progress) self.display(); self.last_sec = Some(current_time); if self.downloaded_last_few_secs.len() == DOWNLOAD_TRACK_COUNT { self.downloaded_last_few_secs.pop_back(); diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index faf300a..4d86658 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -18,7 +18,8 @@ pub fn main() -> Result<()> { let ref matches = cli().get_matches(); let verbose = matches.is_present("verbose"); - let ref cfg = try!(common::set_globals(verbose)); + let silent = matches.is_present("silent"); + let ref cfg = try!(common::set_globals(verbose, silent)); match matches.subcommand() { ("show", Some(_)) => try!(show(cfg)), @@ -85,6 +86,10 @@ pub fn cli() -> App<'static, 'static> { .help("Enable verbose output") .short("v") .long("verbose")) + .arg(Arg::with_name("silent") + .short("s") + .long("silent") + .help("Disable progress output")) .subcommand(SubCommand::with_name("show") .about("Show the active and installed toolchains") .after_help(SHOW_HELP)) @@ -209,7 +214,7 @@ pub fn cli() -> App<'static, 'static> { .help("Standard library API documentation")) .group(ArgGroup::with_name("page") .args(&["book", "std"])))*/; - + /*if cfg!(not(target_os = "windows")) { app = app .subcommand(SubCommand::with_name("man") @@ -221,7 +226,7 @@ pub fn cli() -> App<'static, 'static> { .long("toolchain") .takes_value(true))); }*/ - + app.subcommand(SubCommand::with_name("self") .about("Modify the elan installation") .setting(AppSettings::VersionlessSubcommands) diff --git a/src/elan-cli/self_update.rs b/src/elan-cli/self_update.rs index 3e38489..f211c59 100644 --- a/src/elan-cli/self_update.rs +++ b/src/elan-cli/self_update.rs @@ -195,7 +195,7 @@ fn canonical_elan_home() -> Result { /// Installing is a simple matter of coping the running binary to /// `ELAN_HOME`/bin, hardlinking the various Lean tools to it, /// and adding `ELAN_HOME`/bin to PATH. -pub fn install(no_prompt: bool, verbose: bool, +pub fn install(no_prompt: bool, verbose: bool, silent: bool mut opts: InstallOpts) -> Result<()> { try!(check_existence_of_lean_in_path(no_prompt)); @@ -228,7 +228,7 @@ pub fn install(no_prompt: bool, verbose: bool, if !opts.no_modify_path { try!(do_add_to_path(&get_add_path_methods())); } - try!(maybe_install_lean(&opts.default_toolchain, verbose)); + try!(maybe_install_lean(&opts.default_toolchain, verbose, silent)); if cfg!(unix) { let ref env_file = try!(utils::elan_home()).join("env"); @@ -245,16 +245,6 @@ pub fn install(no_prompt: bool, verbose: bool, if let Err(ref e) = install_res { common::report_error(e); - // On windows, where installation happens in a console - // that may have opened just for this purpose, give - // the user an opportunity to see the error before the - // window closes. - if cfg!(windows) && !no_prompt { - println!(""); - println!("Press the Enter key to continue."); - try!(common::read_line()); - } - process::exit(1); } @@ -522,8 +512,8 @@ pub fn install_proxies() -> Result<()> { Ok(()) } -fn maybe_install_lean(toolchain_str: &str, verbose: bool) -> Result<()> { - let ref cfg = try!(common::set_globals(verbose)); +fn maybe_install_lean(toolchain_str: &str, verbose: bool, silent: bool) -> Result<()> { + let ref cfg = try!(common::set_globals(verbose, silent)); // If there is already an install, then `toolchain_str` may not be // a toolchain the user actually wants. Don't do anything. FIXME: diff --git a/src/elan-cli/setup_mode.rs b/src/elan-cli/setup_mode.rs index ef65b85..d2b9947 100644 --- a/src/elan-cli/setup_mode.rs +++ b/src/elan-cli/setup_mode.rs @@ -21,6 +21,10 @@ pub fn main() -> Result<()> { .short("v") .long("verbose") .help("Enable verbose output")) + .arg(Arg::with_name("silent") + .short("s") + .long("silent") + .help("Disable progress output")) .arg(Arg::with_name("no-prompt") .short("y") .help("Disable confirmation prompt.")) @@ -35,6 +39,7 @@ pub fn main() -> Result<()> { let matches = cli.get_matches(); let no_prompt = matches.is_present("no-prompt"); let verbose = matches.is_present("verbose"); + let silent = matches.is_present("silent"); let default_toolchain = matches.value_of("default-toolchain").unwrap_or("stable"); let no_modify_path = matches.is_present("no-modify-path"); @@ -43,7 +48,7 @@ pub fn main() -> Result<()> { no_modify_path: no_modify_path, }; - try!(self_update::install(no_prompt, verbose, opts)); + try!(self_update::install(no_prompt, verbose, silent, opts)); Ok(()) } From 92cd8665010a672b7f3314449070a61ed4f6d884 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 16:50:53 -0700 Subject: [PATCH 02/12] fix: compile errors --- src/elan-cli/download_tracker.rs | 4 +++- src/elan-cli/proxy_mode.rs | 2 +- src/elan-cli/self_update.rs | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/elan-cli/download_tracker.rs b/src/elan-cli/download_tracker.rs index 6453c5c..ae0ce70 100644 --- a/src/elan-cli/download_tracker.rs +++ b/src/elan-cli/download_tracker.rs @@ -91,7 +91,9 @@ impl DownloadTracker { let elapsed = current_time - start; if elapsed >= 1.0 { self.seconds_elapsed += 1; - if (self.progress) self.display(); + if (self.progress) { + self.display(); + } self.last_sec = Some(current_time); if self.downloaded_last_few_secs.len() == DOWNLOAD_TRACK_COUNT { self.downloaded_last_few_secs.pop_back(); diff --git a/src/elan-cli/proxy_mode.rs b/src/elan-cli/proxy_mode.rs index dce41c1..fc8b958 100644 --- a/src/elan-cli/proxy_mode.rs +++ b/src/elan-cli/proxy_mode.rs @@ -39,7 +39,7 @@ pub fn main() -> Result<()> { env::args_os().skip(2).collect() }; - let cfg = try!(set_globals(false)); + let cfg = try!(set_globals(false, false)); try!(direct_proxy(&cfg, arg0, toolchain, &cmd_args)); Ok(()) diff --git a/src/elan-cli/self_update.rs b/src/elan-cli/self_update.rs index f211c59..0372a5f 100644 --- a/src/elan-cli/self_update.rs +++ b/src/elan-cli/self_update.rs @@ -195,7 +195,7 @@ fn canonical_elan_home() -> Result { /// Installing is a simple matter of coping the running binary to /// `ELAN_HOME`/bin, hardlinking the various Lean tools to it, /// and adding `ELAN_HOME`/bin to PATH. -pub fn install(no_prompt: bool, verbose: bool, silent: bool +pub fn install(no_prompt: bool, verbose: bool, silent: bool, mut opts: InstallOpts) -> Result<()> { try!(check_existence_of_lean_in_path(no_prompt)); @@ -719,7 +719,6 @@ fn delete_elan_and_elan_home() -> Result<()> { use winapi::shared::minwindef::DWORD; use std::os::windows::ffi::OsStrExt; use std::ptr; - use std::io; use std::mem; unsafe { From 730a9a88a222255192aa9a105d88ad09bb0d3868 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 17:53:55 -0700 Subject: [PATCH 03/12] Add more to readme, and make the build produce both binaries even though they are identical. --- Cargo.toml | 5 +++++ README.md | 16 +++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index df894c7..f95f826 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,3 +67,8 @@ test = false # no unit tests name = "elan-init" path = "src/elan-cli/main.rs" test = false # no unit tests + +[[bin]] +name = "elan" +path = "src/elan-cli/main.rs" +test = false # no unit tests diff --git a/README.md b/README.md index 0e16c6c..0cbc10d 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,8 @@ On some systems, `lean`/`leanpkg` will not work out of the box even if installed # Build -You need to set the following environment variables: +If you want to build elan from source, you will need to install [Rust](https://www.rust-lang.org/tools/install) and +Cargo and then set the following environment variables: ``` export OUT_DIR="~/dist/elan" @@ -88,11 +89,14 @@ export RELEASE_TARGET_NAME="1.0.8" cargo build ``` +The built binaries will show up in `target/build/debug` folder. + # Build on Windows -The windows build requires a windows version of `perl.exe` which you can download from [https://strawberryperl.com/](https://strawberryperl.com/). -Make sure this downloaded perl.exe is the first thing in your PATH so that the build does not try and use `c:\Program Files\Git\usr\bin\perl.exe`. -The git provided version of perl doesn't work for some reason. +The windows build requires a 64bit developer command prompt and a windows version of `perl.exe` which you can download +from [https://strawberryperl.com/](https://strawberryperl.com/). Make sure this downloaded perl.exe is the first thing +in your PATH so that the build does not try and use `c:\Program Files\Git\usr\bin\perl.exe`. The git provided version of +perl doesn't work for some reason. Then run this: @@ -100,4 +104,6 @@ Then run this: set OUT_DIR=d:\dist\elan set RELEASE_TARGET_NAME=1.0.8 cargo build -``` \ No newline at end of file +``` + +The built binaries will show up in `target\build\debug` folder. \ No newline at end of file From e2d80c7bfdc1d3676154303b9a4d94c85cd405ea Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 18:02:40 -0700 Subject: [PATCH 04/12] remove -silent - it doesn't work as expected. --- elan-init.ps1 | 1 - elan-init.sh | 1 - src/elan-cli/common.rs | 2 +- src/elan-cli/elan_mode.rs | 7 +------ src/elan-cli/self_update.rs | 8 ++++---- src/elan-cli/setup_mode.rs | 7 +------ 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/elan-init.ps1 b/elan-init.ps1 index 941094d..36e5578 100644 --- a/elan-init.ps1 +++ b/elan-init.ps1 @@ -21,7 +21,6 @@ FLAGS: --no-modify-path Don't configure the PATH environment variable -h, --help Prints help information -V, --version Prints version information - -s, --silent No progress output OPTIONS: --default-toolchain Choose a default toolchain to install diff --git a/elan-init.sh b/elan-init.sh index f645840..f36a9f5 100755 --- a/elan-init.sh +++ b/elan-init.sh @@ -32,7 +32,6 @@ FLAGS: --no-modify-path Don't configure the PATH environment variable -h, --help Prints help information -V, --version Prints version information - -s, --silent No progress output OPTIONS: --default-toolchain Choose a default toolchain to install diff --git a/src/elan-cli/common.rs b/src/elan-cli/common.rs index c22bad7..37a4d33 100644 --- a/src/elan-cli/common.rs +++ b/src/elan-cli/common.rs @@ -99,7 +99,7 @@ pub fn read_line() -> Result { "unable to read from stdin for confirmation".into()) } -pub fn set_globals(verbose: bool, silent: bool) -> Result { +pub fn set_globals(verbose: bool) -> Result { use download_tracker::DownloadTracker; use std::cell::RefCell; diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index 4d86658..428e5bf 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -18,8 +18,7 @@ pub fn main() -> Result<()> { let ref matches = cli().get_matches(); let verbose = matches.is_present("verbose"); - let silent = matches.is_present("silent"); - let ref cfg = try!(common::set_globals(verbose, silent)); + let ref cfg = try!(common::set_globals(verbose)); match matches.subcommand() { ("show", Some(_)) => try!(show(cfg)), @@ -86,10 +85,6 @@ pub fn cli() -> App<'static, 'static> { .help("Enable verbose output") .short("v") .long("verbose")) - .arg(Arg::with_name("silent") - .short("s") - .long("silent") - .help("Disable progress output")) .subcommand(SubCommand::with_name("show") .about("Show the active and installed toolchains") .after_help(SHOW_HELP)) diff --git a/src/elan-cli/self_update.rs b/src/elan-cli/self_update.rs index 0372a5f..30886f9 100644 --- a/src/elan-cli/self_update.rs +++ b/src/elan-cli/self_update.rs @@ -195,7 +195,7 @@ fn canonical_elan_home() -> Result { /// Installing is a simple matter of coping the running binary to /// `ELAN_HOME`/bin, hardlinking the various Lean tools to it, /// and adding `ELAN_HOME`/bin to PATH. -pub fn install(no_prompt: bool, verbose: bool, silent: bool, +pub fn install(no_prompt: bool, verbose: bool, mut opts: InstallOpts) -> Result<()> { try!(check_existence_of_lean_in_path(no_prompt)); @@ -228,7 +228,7 @@ pub fn install(no_prompt: bool, verbose: bool, silent: bool, if !opts.no_modify_path { try!(do_add_to_path(&get_add_path_methods())); } - try!(maybe_install_lean(&opts.default_toolchain, verbose, silent)); + try!(maybe_install_lean(&opts.default_toolchain, verbose)); if cfg!(unix) { let ref env_file = try!(utils::elan_home()).join("env"); @@ -512,8 +512,8 @@ pub fn install_proxies() -> Result<()> { Ok(()) } -fn maybe_install_lean(toolchain_str: &str, verbose: bool, silent: bool) -> Result<()> { - let ref cfg = try!(common::set_globals(verbose, silent)); +fn maybe_install_lean(toolchain_str: &str, verbose: bool) -> Result<()> { + let ref cfg = try!(common::set_globals(verbose)); // If there is already an install, then `toolchain_str` may not be // a toolchain the user actually wants. Don't do anything. FIXME: diff --git a/src/elan-cli/setup_mode.rs b/src/elan-cli/setup_mode.rs index d2b9947..ef65b85 100644 --- a/src/elan-cli/setup_mode.rs +++ b/src/elan-cli/setup_mode.rs @@ -21,10 +21,6 @@ pub fn main() -> Result<()> { .short("v") .long("verbose") .help("Enable verbose output")) - .arg(Arg::with_name("silent") - .short("s") - .long("silent") - .help("Disable progress output")) .arg(Arg::with_name("no-prompt") .short("y") .help("Disable confirmation prompt.")) @@ -39,7 +35,6 @@ pub fn main() -> Result<()> { let matches = cli.get_matches(); let no_prompt = matches.is_present("no-prompt"); let verbose = matches.is_present("verbose"); - let silent = matches.is_present("silent"); let default_toolchain = matches.value_of("default-toolchain").unwrap_or("stable"); let no_modify_path = matches.is_present("no-modify-path"); @@ -48,7 +43,7 @@ pub fn main() -> Result<()> { no_modify_path: no_modify_path, }; - try!(self_update::install(no_prompt, verbose, silent, opts)); + try!(self_update::install(no_prompt, verbose, opts)); Ok(()) } From b216ad857012ff62e6644012be457a852f85597f Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 18:06:15 -0700 Subject: [PATCH 05/12] revert more changes. --- src/elan-cli/download_tracker.rs | 9 ++------- src/elan-cli/elan_mode.rs | 2 -- src/elan-cli/proxy_mode.rs | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/elan-cli/download_tracker.rs b/src/elan-cli/download_tracker.rs index ae0ce70..71acc59 100644 --- a/src/elan-cli/download_tracker.rs +++ b/src/elan-cli/download_tracker.rs @@ -33,8 +33,6 @@ pub struct DownloadTracker { /// display the progress info. /// In that case, we do not want to do some cleanup stuff we normally do. displayed_progress: bool, - /// Whether to show any progress - progress: bool } impl DownloadTracker { @@ -48,8 +46,7 @@ impl DownloadTracker { seconds_elapsed: 0, last_sec: None, term: term::stdout(), - displayed_progress: false, - progress: true + displayed_progress: false } } @@ -91,9 +88,7 @@ impl DownloadTracker { let elapsed = current_time - start; if elapsed >= 1.0 { self.seconds_elapsed += 1; - if (self.progress) { - self.display(); - } + self.display(); self.last_sec = Some(current_time); if self.downloaded_last_few_secs.len() == DOWNLOAD_TRACK_COUNT { self.downloaded_last_few_secs.pop_back(); diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index 428e5bf..d582821 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -209,7 +209,6 @@ pub fn cli() -> App<'static, 'static> { .help("Standard library API documentation")) .group(ArgGroup::with_name("page") .args(&["book", "std"])))*/; - /*if cfg!(not(target_os = "windows")) { app = app .subcommand(SubCommand::with_name("man") @@ -221,7 +220,6 @@ pub fn cli() -> App<'static, 'static> { .long("toolchain") .takes_value(true))); }*/ - app.subcommand(SubCommand::with_name("self") .about("Modify the elan installation") .setting(AppSettings::VersionlessSubcommands) diff --git a/src/elan-cli/proxy_mode.rs b/src/elan-cli/proxy_mode.rs index fc8b958..dce41c1 100644 --- a/src/elan-cli/proxy_mode.rs +++ b/src/elan-cli/proxy_mode.rs @@ -39,7 +39,7 @@ pub fn main() -> Result<()> { env::args_os().skip(2).collect() }; - let cfg = try!(set_globals(false, false)); + let cfg = try!(set_globals(false)); try!(direct_proxy(&cfg, arg0, toolchain, &cmd_args)); Ok(()) From 2b57d7e66ef33983091f64901d92e4845061161d Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 18:07:35 -0700 Subject: [PATCH 06/12] revert --- src/elan-cli/download_tracker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elan-cli/download_tracker.rs b/src/elan-cli/download_tracker.rs index 71acc59..87e1aff 100644 --- a/src/elan-cli/download_tracker.rs +++ b/src/elan-cli/download_tracker.rs @@ -32,7 +32,7 @@ pub struct DownloadTracker { /// If the download is quick enough, we don't have time to /// display the progress info. /// In that case, we do not want to do some cleanup stuff we normally do. - displayed_progress: bool, + displayed_progress: bool } impl DownloadTracker { @@ -88,6 +88,7 @@ impl DownloadTracker { let elapsed = current_time - start; if elapsed >= 1.0 { self.seconds_elapsed += 1; + self.display(); self.last_sec = Some(current_time); if self.downloaded_last_few_secs.len() == DOWNLOAD_TRACK_COUNT { From c8da526b3b1ed07d471cc7f39d1d511fce6edf11 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 18:08:03 -0700 Subject: [PATCH 07/12] commas --- src/elan-cli/download_tracker.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/elan-cli/download_tracker.rs b/src/elan-cli/download_tracker.rs index 87e1aff..be6b9e7 100644 --- a/src/elan-cli/download_tracker.rs +++ b/src/elan-cli/download_tracker.rs @@ -32,7 +32,7 @@ pub struct DownloadTracker { /// If the download is quick enough, we don't have time to /// display the progress info. /// In that case, we do not want to do some cleanup stuff we normally do. - displayed_progress: bool + displayed_progress: bool, } impl DownloadTracker { @@ -46,7 +46,7 @@ impl DownloadTracker { seconds_elapsed: 0, last_sec: None, term: term::stdout(), - displayed_progress: false + displayed_progress: false, } } From 52a5e38e90417e55f77c9081500dd7c64f528ac9 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Fri, 8 Oct 2021 18:09:25 -0700 Subject: [PATCH 08/12] add newlines back --- src/elan-cli/elan_mode.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/elan-cli/elan_mode.rs b/src/elan-cli/elan_mode.rs index d582821..428e5bf 100644 --- a/src/elan-cli/elan_mode.rs +++ b/src/elan-cli/elan_mode.rs @@ -209,6 +209,7 @@ pub fn cli() -> App<'static, 'static> { .help("Standard library API documentation")) .group(ArgGroup::with_name("page") .args(&["book", "std"])))*/; + /*if cfg!(not(target_os = "windows")) { app = app .subcommand(SubCommand::with_name("man") @@ -220,6 +221,7 @@ pub fn cli() -> App<'static, 'static> { .long("toolchain") .takes_value(true))); }*/ + app.subcommand(SubCommand::with_name("self") .about("Modify the elan installation") .setting(AppSettings::VersionlessSubcommands) From 0eec4e539396642e56b91053d787d7b042328043 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Mon, 11 Oct 2021 12:57:18 -0700 Subject: [PATCH 09/12] remove reference to lean 3 in error message. --- src/elan/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elan/errors.rs b/src/elan/errors.rs index 71a12e0..9f3c2ce 100644 --- a/src/elan/errors.rs +++ b/src/elan/errors.rs @@ -24,7 +24,7 @@ error_chain! { display("toolchain '{}' is not installed", t) } NoDefaultToolchain { - description("no default toolchain configured. run `elan default stable` to install & configure the latest Lean 3 community release.") + description("no default toolchain configured. run `elan default stable` to install & configure the latest Lean community release.") } OverrideToolchainNotInstalled(t: String) { description("override toolchain is not installed") From 41e239e37c2067059b860c1bbff85b87aad81713 Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Tue, 12 Oct 2021 12:20:40 -0700 Subject: [PATCH 10/12] doc: what does "Removed Windows installer..." mean? We now have a *.ps1 windows installer.. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0cbc10d..e13b2a4 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,6 @@ On some systems, `lean`/`leanpkg` will not work out of the box even if installed *elan* is basically a fork of [rustup](https://github.com/rust-lang-nursery/rustup.rs). Apart from new features and adaptions to the Lean infrastructure, these are the basic changes to the original code: * Replaced every mention of `rustup` with `elan`, `cargo` with `leanpkg`, and `rust(c)` with `lean` -* Removed Windows installer... for now? * Merged `CARGO_HOME` and `RUSTUP_HOME` * Removed options to configure host triple From dcd14dfb116acc237c30fd2f8cadb622d0db337b Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Tue, 12 Oct 2021 12:25:43 -0700 Subject: [PATCH 11/12] doc: Remove OUT_DIR, and RELEASE_TARGET_NAME variables that are no longer needed. --- README.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e13b2a4..10f94ab 100644 --- a/README.md +++ b/README.md @@ -80,15 +80,17 @@ On some systems, `lean`/`leanpkg` will not work out of the box even if installed # Build If you want to build elan from source, you will need to install [Rust](https://www.rust-lang.org/tools/install) and -Cargo and then set the following environment variables: +Cargo and run the following: ``` -export OUT_DIR="~/dist/elan" -export RELEASE_TARGET_NAME="1.0.8" cargo build ``` -The built binaries will show up in `target/build/debug` folder. +The built binaries will show up in `target/debug` folder. You can test that it works by running the following: + +``` +./target/debug/elan --help +``` # Build on Windows @@ -97,12 +99,4 @@ from [https://strawberryperl.com/](https://strawberryperl.com/). Make sure this in your PATH so that the build does not try and use `c:\Program Files\Git\usr\bin\perl.exe`. The git provided version of perl doesn't work for some reason. -Then run this: - -``` -set OUT_DIR=d:\dist\elan -set RELEASE_TARGET_NAME=1.0.8 -cargo build -``` - -The built binaries will show up in `target\build\debug` folder. \ No newline at end of file +Then you can run `cargo build` as shown above. From 5ce36af78ed0d94c7d7d974d561850588e71e61e Mon Sep 17 00:00:00 2001 From: Chris Lovett Date: Wed, 13 Oct 2021 23:49:22 -0700 Subject: [PATCH 12/12] fix: revert removing reference to "Lean 3" --- src/elan/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elan/errors.rs b/src/elan/errors.rs index 9f3c2ce..71a12e0 100644 --- a/src/elan/errors.rs +++ b/src/elan/errors.rs @@ -24,7 +24,7 @@ error_chain! { display("toolchain '{}' is not installed", t) } NoDefaultToolchain { - description("no default toolchain configured. run `elan default stable` to install & configure the latest Lean community release.") + description("no default toolchain configured. run `elan default stable` to install & configure the latest Lean 3 community release.") } OverrideToolchainNotInstalled(t: String) { description("override toolchain is not installed")