From ce05a92e265bc8040f379de088cb711fa92d619c Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Wed, 1 Jan 2020 19:59:38 +0000 Subject: [PATCH 1/4] fix ~ 'musl' environment doesn't support utmpx --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 58e7ff2..f6896a2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ pub mod parse_time; #[cfg(all(not(windows), feature = "mode"))] pub mod mode; -#[cfg(all(unix, not(target_os = "fuchsia"), feature = "utmpx"))] +#[cfg(all(unix, not(target_os = "fuchsia"), not(target_env="musl"), feature = "utmpx"))] pub mod utmpx; #[cfg(all(unix, feature = "entries"))] pub mod entries; From 1fdeb5e35df723da9bf164c1579ed02ecda53b32 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 2 Jan 2020 05:10:47 +0000 Subject: [PATCH 2/4] fix uucore::fs for windows - standardize the return value of `std::env::current_dir()` by using `canonicalize()` .# [why] `std::env::current_dir()` will, in some situations on windows hosts, return "short"-type paths (eg, "C:\Progra~1\..."). Using `canonicalize()` transforms the path in a standard long form but may also require removing a leading "\\?\" prefix. --- Cargo.toml | 2 +- src/fs.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 66bed35..611be8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,6 +16,7 @@ travis-ci = { repository = "uutils/uucore" } appveyor = { repository = "uutils/uucore" } [dependencies] +dunce = "1.0.0" getopts = "0.2.18" failure = { version = "0.1.1", optional = true } failure_derive = { version = "0.1.1", optional = true } @@ -43,4 +44,3 @@ entries = ["libc"] zero-copy = ["nix", "libc", "lazy_static", "platform-info"] wide = [] default = [] - diff --git a/src/fs.rs b/src/fs.rs index 65819af..39d4b1f 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -6,6 +6,8 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#[cfg(windows)] +extern crate dunce; #[cfg(target_os = "redox")] extern crate termion; @@ -101,7 +103,7 @@ pub fn canonicalize>(original: P, can_mode: CanonicalizeMode) -> let original = if original.is_absolute() { original.to_path_buf() } else { - env::current_dir().unwrap().join(original) + dunce::canonicalize(env::current_dir().unwrap()).unwrap().join(original) }; let mut result = PathBuf::new(); From fa030ebde09c80fb181ab67647df1fa5b413caf7 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 2 Jan 2020 17:26:10 -0600 Subject: [PATCH 3/4] fix forced MinSRV increase (using pinned 'backtrace' version) - hotfix transitive bug in 'failure' forcing MinSRV increase to rust v1.33.0 by pinning 'backtrace' to <= 0.3.31 - [rustlang/nursery#340](https://github.com/rust-lang-nursery/failure/issues/340) is now open on 'failure' to address this issue .# [why] 'failure' was using 'backtrace' `version = "0.3.3"`, which by semantic version auto-upgrade was pulling in 'backtrace' > v0.3.30 (specifically, v0.3.40 most recently). 'backtrace' v0.3.31 introduces use of `#[cfg(target_vendor = ...)]` which requires rust v1.33.0. So, 'backtrace' is forcing an upgrade of MinSRV to rust v1.33.0 with the change from backtrace v0.3.30 to backtrace v0.3.31. Technically, by being less than v1.0.0, 'backtrace' has no semantic version requirement. And there is debate about whether increasing MinSRV is a semantic change. But, in my strong opinion, breaking our MinSRV statement is definitely a semantic change. * ref: --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 611be8a..1b381aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,8 @@ wild = "2.0.1" nix = { version = "0.13", optional = true } lazy_static = { version = "1.3", optional = true } platform-info = { version = "0.0.1", optional = true } +# * transitive dependency via 'failure'; pin to <= v0.3.30 to avoid increasing MinSRV to v1.33.0 +backtrace = ">= 0.3.3, <= 0.3.30" [target.'cfg(target_os = "redox")'.dependencies] termion = "1.5" From 02ca3bf55049274c2a4dcf608e480dcb30f524e9 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 2 Jan 2020 20:57:27 -0600 Subject: [PATCH 4/4] refactor ~ pin all crate versions < v1.0.0 . #[why] Technically, by semver rules, projects with versions < v1.0.0 may make breaking changes with *any* version change. So, for some protection, pin all crates with version < v1.0.0 to a specific version. * ref: @@ --- Cargo.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1b381aa..0fcf202 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,16 +17,16 @@ appveyor = { repository = "uutils/uucore" } [dependencies] dunce = "1.0.0" -getopts = "0.2.18" -failure = { version = "0.1.1", optional = true } -failure_derive = { version = "0.1.1", optional = true } -time = { version = "0.1.40", optional = true } +getopts = "<= 0.2.21" +failure = { version = "<= 0.1.1", optional = true } +failure_derive = { version = "<= 0.1.1", optional = true } +time = { version = "<= 0.1.42", optional = true } data-encoding = { version = "^2.1", optional = true } -libc = { version = "0.2.42", optional = true } +libc = { version = "<= 0.2.66", optional = true } wild = "2.0.1" -nix = { version = "0.13", optional = true } +nix = { version = "<= 0.13", optional = true } lazy_static = { version = "1.3", optional = true } -platform-info = { version = "0.0.1", optional = true } +platform-info = { version = "<= 0.0.1", optional = true } # * transitive dependency via 'failure'; pin to <= v0.3.30 to avoid increasing MinSRV to v1.33.0 backtrace = ">= 0.3.3, <= 0.3.30"