Skip to content

Commit

Permalink
[x] update guppy etc to latest versions
Browse files Browse the repository at this point in the history
Pull in support for newer Rust versions.

Needed a small update to a linter -- with semver 1.0, a no-version-req
is now represented as `*` rather than `>=0.0.0`.

Closes: aptos-labs#9162
  • Loading branch information
sunshowers authored and bors-libra committed Sep 14, 2021
1 parent 4f68c85 commit 6a29e04
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 123 deletions.
208 changes: 115 additions & 93 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions common/workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ futures-util = { version = "0.3.16", features = ["alloc", "async-await", "async-
getrandom = { version = "0.2.2", default-features = false, features = ["std"] }
hyper = { version = "0.14.11", features = ["client", "default", "full", "h2", "http1", "http2", "runtime", "server", "socket2", "stream", "tcp"] }
indexmap = { version = "1.7.0", default-features = false, features = ["std"] }
itertools = { version = "0.10.0", features = ["default", "use_alloc", "use_std"] }
itertools = { version = "0.10.1", features = ["default", "use_alloc", "use_std"] }
itoa = { version = "0.4.7", features = ["default", "std"] }
libc = { version = "0.2.99", features = ["default", "extra_traits", "std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
Expand All @@ -53,8 +53,8 @@ regex-automata = { version = "0.1.9", features = ["default", "regex-syntax", "st
regex-syntax = { version = "0.6.23", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
reqwest = { version = "0.11.2", features = ["__tls", "blocking", "default", "default-tls", "hyper-tls", "json", "native-tls-crate", "serde_json", "stream", "tokio-native-tls"] }
rusty-fork = { version = "0.3.0", features = ["default", "timeout", "wait-timeout"] }
serde = { version = "1.0.127", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.64", features = ["default", "indexmap", "preserve_order", "std"] }
serde = { version = "1.0.130", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.67", features = ["default", "indexmap", "preserve_order", "std"] }
standback = { version = "0.2.15", default-features = false, features = ["std"] }
subtle = { version = "2.4.0", default-features = false, features = ["std"] }
tiny-keccak = { version = "2.0.2", features = ["default", "sha3"] }
Expand Down Expand Up @@ -93,7 +93,7 @@ futures-util = { version = "0.3.16", features = ["alloc", "async-await", "async-
getrandom = { version = "0.2.2", default-features = false, features = ["std"] }
hyper = { version = "0.14.11", features = ["client", "default", "full", "h2", "http1", "http2", "runtime", "server", "socket2", "stream", "tcp"] }
indexmap = { version = "1.7.0", default-features = false, features = ["std"] }
itertools = { version = "0.10.0", features = ["default", "use_alloc", "use_std"] }
itertools = { version = "0.10.1", features = ["default", "use_alloc", "use_std"] }
itoa = { version = "0.4.7", features = ["default", "std"] }
libc = { version = "0.2.99", features = ["default", "extra_traits", "std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
Expand All @@ -112,8 +112,8 @@ regex-automata = { version = "0.1.9", features = ["default", "regex-syntax", "st
regex-syntax = { version = "0.6.23", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
reqwest = { version = "0.11.2", features = ["__tls", "blocking", "default", "default-tls", "hyper-tls", "json", "native-tls-crate", "serde_json", "stream", "tokio-native-tls"] }
rusty-fork = { version = "0.3.0", features = ["default", "timeout", "wait-timeout"] }
serde = { version = "1.0.127", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.64", features = ["default", "indexmap", "preserve_order", "std"] }
serde = { version = "1.0.130", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.67", features = ["default", "indexmap", "preserve_order", "std"] }
standback = { version = "0.2.15", default-features = false, features = ["std"] }
subtle = { version = "2.4.0", default-features = false, features = ["std"] }
syn-3575ec1268b04181 = { package = "syn", version = "0.15.44", features = ["clone-impls", "default", "derive", "extra-traits", "full", "parsing", "printing", "proc-macro", "quote", "visit"] }
Expand Down Expand Up @@ -153,7 +153,7 @@ futures-util = { version = "0.3.16", features = ["alloc", "async-await", "async-
getrandom = { version = "0.2.2", default-features = false, features = ["std"] }
hyper = { version = "0.14.11", features = ["client", "default", "full", "h2", "http1", "http2", "runtime", "server", "socket2", "stream", "tcp"] }
indexmap = { version = "1.7.0", default-features = false, features = ["std"] }
itertools = { version = "0.10.0", features = ["default", "use_alloc", "use_std"] }
itertools = { version = "0.10.1", features = ["default", "use_alloc", "use_std"] }
itoa = { version = "0.4.7", features = ["default", "std"] }
libc = { version = "0.2.99", features = ["default", "extra_traits", "std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
Expand All @@ -170,8 +170,8 @@ regex-automata = { version = "0.1.9", features = ["default", "regex-syntax", "st
regex-syntax = { version = "0.6.23", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
reqwest = { version = "0.11.2", features = ["__tls", "blocking", "default", "default-tls", "hyper-tls", "json", "native-tls-crate", "serde_json", "stream", "tokio-native-tls"] }
rusty-fork = { version = "0.3.0", features = ["default", "timeout", "wait-timeout"] }
serde = { version = "1.0.127", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.64", features = ["default", "indexmap", "preserve_order", "std"] }
serde = { version = "1.0.130", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.67", features = ["default", "indexmap", "preserve_order", "std"] }
standback = { version = "0.2.15", default-features = false, features = ["std"] }
subtle = { version = "2.4.0", default-features = false, features = ["std"] }
tiny-keccak = { version = "2.0.2", features = ["default", "sha3"] }
Expand Down Expand Up @@ -210,7 +210,7 @@ futures-util = { version = "0.3.16", features = ["alloc", "async-await", "async-
getrandom = { version = "0.2.2", default-features = false, features = ["std"] }
hyper = { version = "0.14.11", features = ["client", "default", "full", "h2", "http1", "http2", "runtime", "server", "socket2", "stream", "tcp"] }
indexmap = { version = "1.7.0", default-features = false, features = ["std"] }
itertools = { version = "0.10.0", features = ["default", "use_alloc", "use_std"] }
itertools = { version = "0.10.1", features = ["default", "use_alloc", "use_std"] }
itoa = { version = "0.4.7", features = ["default", "std"] }
libc = { version = "0.2.99", features = ["default", "extra_traits", "std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
Expand All @@ -229,8 +229,8 @@ regex-automata = { version = "0.1.9", features = ["default", "regex-syntax", "st
regex-syntax = { version = "0.6.23", features = ["default", "unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }
reqwest = { version = "0.11.2", features = ["__tls", "blocking", "default", "default-tls", "hyper-tls", "json", "native-tls-crate", "serde_json", "stream", "tokio-native-tls"] }
rusty-fork = { version = "0.3.0", features = ["default", "timeout", "wait-timeout"] }
serde = { version = "1.0.127", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.64", features = ["default", "indexmap", "preserve_order", "std"] }
serde = { version = "1.0.130", features = ["alloc", "default", "derive", "rc", "serde_derive", "std"] }
serde_json = { version = "1.0.67", features = ["default", "indexmap", "preserve_order", "std"] }
standback = { version = "0.2.15", default-features = false, features = ["std"] }
subtle = { version = "2.4.0", default-features = false, features = ["std"] }
syn-3575ec1268b04181 = { package = "syn", version = "0.15.44", features = ["clone-impls", "default", "derive", "extra-traits", "full", "parsing", "printing", "proc-macro", "quote", "visit"] }
Expand Down
6 changes: 3 additions & 3 deletions devtools/x-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ license = "Apache-2.0"

[dependencies]
camino = { version = "1.0.3", features = ["serde1"] }
determinator = "0.4.0"
guppy = "0.9.0"
determinator = "0.5.1"
guppy = "0.10.1"
indoc = "1.0.3"
hakari = { version = "0.3.0", features = ["summaries"] }
hakari = { version = "0.4.1", features = ["summaries"] }
hex = "0.4.3"
log = "0.4.14"
toml = "0.5.8"
Expand Down
2 changes: 1 addition & 1 deletion devtools/x-core/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl GitCli {
));
}
};
if self.root != &git_root {
if self.root != git_root {
let msg = formatdoc!(
"git root expected to be at {}, but actually found at {}
(hint: did you download an archive from GitHub? x requires a git clone)",
Expand Down
2 changes: 1 addition & 1 deletion devtools/x-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl XCoreContext {
}

/// Returns a Hakari builder for this workspace.
pub fn hakari_builder<'a>(&'a self) -> Result<HakariBuilder<'a, 'static>> {
pub fn hakari_builder(&self) -> Result<HakariBuilder<'_>> {
let graph = self.package_graph()?;
self.config
.hakari
Expand Down
4 changes: 2 additions & 2 deletions devtools/x-lint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ license = "Apache-2.0"

[dependencies]
camino = "1.0.3"
guppy = "0.9.0"
hakari = "0.3.0"
guppy = "0.10.1"
hakari = "0.4.1"
once_cell = "1.7.2"
toml = "0.5.8"
serde = { version = "1.0.124", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion devtools/x-lint/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'l> ProjectContext<'l> {
}

/// Returns Hakari information.
pub fn hakari(&self) -> Result<Hakari<'l, 'static>> {
pub fn hakari(&self) -> Result<Hakari<'l>> {
Ok(self.core.hakari_builder()?.compute())
}
}
Expand Down
8 changes: 4 additions & 4 deletions devtools/x/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ license = "Apache-2.0"

[dependencies]
camino = "1.0.3"
cargo_metadata = "0.13.1"
determinator = "0.4.0"
cargo_metadata = "0.14.0"
determinator = "0.5.1"
serde = { version = "1.0.124", features = ["derive"] }
serde_json = "1.0.64"
structopt = "0.3.21"
anyhow = "1.0.38"
colored-diff = "0.2.2"
guppy = { version = "0.9.0", features = ["summaries"] }
hakari = "0.3.0"
guppy = { version = "0.10.1", features = ["summaries"] }
hakari = "0.4.1"
indoc = "1.0.3"
toml = "0.5.8"
env_logger = "0.8.3"
Expand Down
5 changes: 3 additions & 2 deletions devtools/x/src/lint/guppy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ pub struct UnpublishedPackagesOnlyUsePathDependencies {
impl UnpublishedPackagesOnlyUsePathDependencies {
pub fn new() -> Self {
Self {
no_version_req: VersionReq::parse(">=0.0.0").expect(">=0.0.0 should be a valid req"),
no_version_req: VersionReq::parse("*").expect("* should be a valid req"),
}
}
}
Expand All @@ -432,9 +432,10 @@ impl PackageLinter for UnpublishedPackagesOnlyUsePathDependencies {
for direct_dep in metadata.direct_links().filter(|p| p.to().in_workspace()) {
if direct_dep.version_req() != &self.no_version_req {
let msg = format!(
"unpublished package specifies a version of first-party dependency '{}'; \
"unpublished package specifies a version of first-party dependency '{}' ({}); \
unpublished packages should only use path dependencies for first-party packages.",
direct_dep.dep_name(),
direct_dep.version_req(),
);
out.write(LintLevel::Error, msg);
}
Expand Down
2 changes: 1 addition & 1 deletion devtools/x/src/lint/workspace_hack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl ProjectLinter for GenerateWorkspaceHack {
/// Ensure the workspace-hack package is a dependency
#[derive(Debug)]
pub struct WorkspaceHackDep<'cfg> {
hakari_builder: HakariBuilder<'cfg, 'static>,
hakari_builder: HakariBuilder<'cfg>,
hakari_id: &'cfg PackageId,
}

Expand Down
8 changes: 5 additions & 3 deletions devtools/x/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use crate::{config::CargoConfig, installer::install_cargo_component_if_needed, R
use anyhow::anyhow;
use camino::Utf8Path;
use log::{info, warn};
use std::{env::var_os, process::{Command, Stdio}};
use std::{
env::var_os,
process::{Command, Stdio},
};

/// The number of directories between the project root and the root of this crate.
pub const X_DEPTH: usize = 2;
Expand All @@ -26,8 +29,7 @@ pub fn sccache_should_run(cargo_config: &CargoConfig, warn_if_not_correct_locati
if let Some(sccache_config) = &cargo_config.sccache {
// Are we work on items in the right location:
// See: https://github.com/mozilla/sccache#known-caveats
let correct_location = var_os("CARGO_HOME")
.unwrap_or_default()
let correct_location = var_os("CARGO_HOME").unwrap_or_default()
== sccache_config.required_cargo_home.as_str()
&& sccache_config.required_git_home == project_root();
if !correct_location && warn_if_not_correct_location {
Expand Down

0 comments on commit 6a29e04

Please sign in to comment.