From 06754b78ac462d7b9fe8bd176ff7831772c0b1c8 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 13 Nov 2019 11:19:07 -0500 Subject: Use autocfg to determine rust version --- xtask/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'xtask/Cargo.toml') diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 023f6a859..72b39c3b4 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -6,6 +6,7 @@ authors = ["rust-analyzer developers"] publish = false [dependencies] +autocfg = "0.1" walkdir = "2.1.3" pico-args = "0.3.0" quote = "1.0.2" -- cgit v1.2.3 From 5075c77957e127be51e1b5271567f906abeb50c6 Mon Sep 17 00:00:00 2001 From: Pascal Hertleif Date: Wed, 13 Nov 2019 20:51:57 +0100 Subject: Use anyhow::Result in xtask, add contexts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This builds on #2231 but was actually done before that. You see, the cause for #2231 was that I got this error message: Error: Error { kind: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" }) } Just switching to `anyhow::Result` got me stack traces (when setting `RUST_LIB_BACKTRACE=1`) that at least showed stack backtrace: 0: std::backtrace::Backtrace::create 1: std::backtrace::Backtrace::capture 2: anyhow::error:: for anyhow::Error>::from 3: xtask::install_server 4: xtask::install 5: xtask::main 6: std::rt::lang_start::{{closure}} 7: std::panicking::try::do_call 8: __rust_maybe_catch_panic 9: std::rt::lang_start_internal 10: std::rt::lang_start 11: main With the added contexts (not at all exhaustive), the error became Error: install server Caused by: 0: build AutoCfg with target directory 1: No such file or directory (os error 2) Since anyhow is such a small thing (no new transitive dependencies!), and in general gives you `Result>` on steroids, I think this a nice small change. The only slightly annoying thing was to replace all the `Err(format!(…))?` calls (haven't even looked at whether we can make it support wrapping strings though), but the `bail!` macro is shorter anyway :) --- xtask/Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'xtask/Cargo.toml') diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 72b39c3b4..bba4be192 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -13,3 +13,4 @@ quote = "1.0.2" proc-macro2 = "1.0.1" ron = "0.5.1" serde = { version = "1.0.0", features = ["derive"] } +anyhow = "1.0.19" -- cgit v1.2.3 From c65f42325fa9213ad79fcf12115213a923b651df Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 14 Nov 2019 11:11:32 +0300 Subject: Revert #2230 Looks like autocfg tries to do slightly more than we need (see #2231), so let's stick with minimal home-grown solution. --- xtask/Cargo.toml | 1 - 1 file changed, 1 deletion(-) (limited to 'xtask/Cargo.toml') diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index bba4be192..77b9ae2b4 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -6,7 +6,6 @@ authors = ["rust-analyzer developers"] publish = false [dependencies] -autocfg = "0.1" walkdir = "2.1.3" pico-args = "0.3.0" quote = "1.0.2" -- cgit v1.2.3