From 78d218ea44f3daab79663e4062cc3d61cf687ab1 Mon Sep 17 00:00:00 2001 From: "heroku-linguist[bot]" <136119646+heroku-linguist[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 11:25:03 +0100 Subject: [PATCH] Prepare release v0.20.0 (#817) * Prepare release v0.20.0 * Cleanup * Fix lint errors with Rust 1.78 Fixes: ``` warning: the item `TryFrom` is imported redundantly --> libcnb-data/src/buildpack/api.rs:2:5 | 2 | use std::convert::TryFrom; | ^^^^^^^^^^^^^^^^^^^^^ | ::: /Users/emorley/.rustup/toolchains/beta-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13 | 129 | pub use core::prelude::rust_2021::*; | ------------------------ the item `TryFrom` is already defined here | = note: `#[warn(unused_imports)]` on by default warning: the item `TryFrom` is imported redundantly --> libcnb-data/src/buildpack/version.rs:2:5 | 2 | use std::convert::TryFrom; | ^^^^^^^^^^^^^^^^^^^^^ | ::: /Users/emorley/.rustup/toolchains/beta-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13 | 129 | pub use core::prelude::rust_2021::*; | ------------------------ the item `TryFrom` is already defined here warning: `libcnb-data` (lib) generated 2 warnings warning: backticks are unbalanced --> libcnb/src/target.rs:14:9 | 14 | /// CNB `lifecycle` sources this value from the build OCI image's [`architecture` property](https://g... | _________^ 15 | | /// `` | |__________^ | = help: a backtick may be missing a pair = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown = note: `-W clippy::doc-markdown` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::doc_markdown)]` warning: `libcnb` (lib) generated 1 warning warning: assigning the result of `Clone::clone()` may be inefficient --> libcnb-test/tests/integration_test.rs:686:25 | 686 | container_name = container.container_name.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `container_name.clone_from(&container.container_name)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `#[warn(clippy::assigning_clones)]` on by default warning: the item `SbomFormat` is imported redundantly --> libcnb-data/src/buildpack/mod.rs:235:9 | 234 | use super::*; | -------- the item `SbomFormat` is already imported here 235 | use crate::sbom::SbomFormat; | ^^^^^^^^^^^^^^^^^^^^^^^ warning: the item `libcnb_newtype` is imported redundantly --> libcnb-data/src/newtypes.rs:193:9 | 52 | / macro_rules! libcnb_newtype { 53 | | ( 54 | | $path:path, 55 | | $(#[$macro_attributes:meta])* ... | 186 | | }; 187 | | } | |_- the item `libcnb_newtype` is already defined here ... 193 | use super::libcnb_newtype; | ^^^^^^^^^^^^^^^^^^^^^ warning: the item `fs` is imported redundantly --> libherokubuildpack/src/fs.rs:44:9 | 44 | use std::fs; | ^^^^^^^ ... 49 | use super::*; | -------- the item `fs` is already imported here | = note: `#[warn(unused_imports)]` on by default warning: `libcnb-test` (test "integration_test") generated 1 warning (run `cargo clippy --fix --test "integration_test"` to apply 1 suggestion) warning: `libcnb-data` (lib test) generated 4 warnings (2 duplicates) warning: `libherokubuildpack` (lib test) generated 1 warning warning: the item `LayerContentMetadata` is imported redundantly --> libcnb/src/layer/handling.rs:465:47 | 464 | use super::*; | -------- the item `LayerContentMetadata` is already imported here 465 | use crate::data::layer_content_metadata::{LayerContentMetadata, LayerTypes}; | ^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default warning: the item `GenericMetadata` is imported redundantly --> libcnb/src/layer/handling.rs:467:9 | 464 | use super::*; | -------- the item `GenericMetadata` is already imported here ... 467 | use crate::generic::GenericMetadata; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: the item `fs` is imported redundantly --> libcnb/src/layer/handling.rs:472:9 | 464 | use super::*; | -------- the item `fs` is already imported here ... 472 | use std::fs; | ^^^^^^^ warning: the item `fs` is imported redundantly --> libcnb/src/platform.rs:68:9 | 66 | use super::*; | -------- the item `fs` is already imported here 67 | use std::ffi::OsString; 68 | use std::fs; | ^^^^^^^ ``` --------- Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com> Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com> --- CHANGELOG.md | 6 +++++- Cargo.toml | 16 ++++++++-------- examples/execd/Cargo.toml | 2 +- libcnb-cargo/Cargo.toml | 6 +++--- libcnb-common/Cargo.toml | 2 +- libcnb-data/Cargo.toml | 2 +- libcnb-data/src/buildpack/api.rs | 1 - libcnb-data/src/buildpack/mod.rs | 1 - libcnb-data/src/buildpack/stack.rs | 2 +- libcnb-data/src/buildpack/version.rs | 1 - libcnb-data/src/newtypes.rs | 1 - libcnb-package/Cargo.toml | 8 ++++---- libcnb-proc-macros/Cargo.toml | 4 ++-- libcnb-test/Cargo.toml | 10 +++++----- libcnb-test/tests/integration_test.rs | 2 +- libcnb/Cargo.toml | 8 ++++---- libcnb/src/layer/handling.rs | 4 +--- libcnb/src/platform.rs | 1 - libcnb/src/target.rs | 3 +-- libcnb/src/tracing.rs | 6 +++--- libherokubuildpack/Cargo.toml | 6 +++--- libherokubuildpack/src/buildpack_output/util.rs | 2 +- libherokubuildpack/src/fs.rs | 1 - 23 files changed, 45 insertions(+), 50 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 792222c9..7aa9faeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] + +## [0.20.0] - 2024-04-12 + ### Added - `libcnb`: @@ -276,7 +279,8 @@ version number. See the changelog below for other changes. - Remove support for legacy BOM. Remove `Launch::bom`, `Build::bom`, `bom::Bom`, `bom::Entry`. ([#489](https://github.com/heroku/libcnb.rs/pull/489)) -[unreleased]: https://github.com/heroku/libcnb.rs/compare/v0.19.0...HEAD +[unreleased]: https://github.com/heroku/libcnb.rs/compare/v0.20.0...HEAD +[0.20.0]: https://github.com/heroku/libcnb.rs/compare/v0.19.0...v0.20.0 [0.19.0]: https://github.com/heroku/libcnb.rs/compare/v0.18.0...v0.19.0 [0.18.0]: https://github.com/heroku/libcnb.rs/compare/v0.17.0...v0.18.0 [0.17.0]: https://github.com/heroku/libcnb.rs/compare/v0.16.0...v0.17.0 diff --git a/Cargo.toml b/Cargo.toml index a56220cf..f5db376d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ members = [ ] [workspace.package] -version = "0.19.0" +version = "0.20.0" rust-version = "1.76" edition = "2021" license = "BSD-3-Clause" @@ -38,10 +38,10 @@ missing_errors_doc = "allow" module_name_repetitions = "allow" [workspace.dependencies] -libcnb = { version = "=0.19.0", path = "libcnb" } -libcnb-common = { version = "=0.19.0", path = "libcnb-common" } -libcnb-data = { version = "=0.19.0", path = "libcnb-data" } -libcnb-package = { version = "=0.19.0", path = "libcnb-package" } -libcnb-proc-macros = { version = "=0.19.0", path = "libcnb-proc-macros" } -libcnb-test = { version = "=0.19.0", path = "libcnb-test" } -toml = { version = "0.8.10" } +libcnb = { version = "=0.20.0", path = "libcnb" } +libcnb-common = { version = "=0.20.0", path = "libcnb-common" } +libcnb-data = { version = "=0.20.0", path = "libcnb-data" } +libcnb-package = { version = "=0.20.0", path = "libcnb-package" } +libcnb-proc-macros = { version = "=0.20.0", path = "libcnb-proc-macros" } +libcnb-test = { version = "=0.20.0", path = "libcnb-test" } +toml = { version = "0.8.12" } diff --git a/examples/execd/Cargo.toml b/examples/execd/Cargo.toml index 09759239..bcac5001 100644 --- a/examples/execd/Cargo.toml +++ b/examples/execd/Cargo.toml @@ -7,8 +7,8 @@ rust-version.workspace = true workspace = true [dependencies] +fastrand = "2.0.2" libcnb.workspace = true -fastrand = "2.0.1" [dev-dependencies] libcnb-test.workspace = true diff --git a/libcnb-cargo/Cargo.toml b/libcnb-cargo/Cargo.toml index 611a6ef2..dc2df6d3 100644 --- a/libcnb-cargo/Cargo.toml +++ b/libcnb-cargo/Cargo.toml @@ -19,7 +19,7 @@ path = "src/main.rs" workspace = true [dependencies] -clap = { version = "4.5.1", default-features = false, features = [ +clap = { version = "4.5.4", default-features = false, features = [ "derive", "error-context", "help", @@ -29,8 +29,8 @@ clap = { version = "4.5.1", default-features = false, features = [ libcnb-data.workspace = true libcnb-package.workspace = true pathdiff = "0.2.1" -thiserror = "1.0.57" +thiserror = "1.0.58" [dev-dependencies] -tempfile = "3.10.0" libcnb-common.workspace = true +tempfile = "3.10.1" diff --git a/libcnb-common/Cargo.toml b/libcnb-common/Cargo.toml index dd5f4949..bbfae22f 100644 --- a/libcnb-common/Cargo.toml +++ b/libcnb-common/Cargo.toml @@ -15,5 +15,5 @@ workspace = true [dependencies] serde = { version = "1.0.197", features = ["derive"] } -thiserror = "1.0.57" +thiserror = "1.0.58" toml.workspace = true diff --git a/libcnb-data/Cargo.toml b/libcnb-data/Cargo.toml index 2f90528a..503026d9 100644 --- a/libcnb-data/Cargo.toml +++ b/libcnb-data/Cargo.toml @@ -18,7 +18,7 @@ workspace = true fancy-regex = { version = "0.13.0", default-features = false, features = ["std"] } libcnb-proc-macros.workspace = true serde = { version = "1.0.197", features = ["derive"] } -thiserror = "1.0.57" +thiserror = "1.0.58" toml.workspace = true uriparse = "0.6.4" diff --git a/libcnb-data/src/buildpack/api.rs b/libcnb-data/src/buildpack/api.rs index 390850af..9d5a3cc4 100644 --- a/libcnb-data/src/buildpack/api.rs +++ b/libcnb-data/src/buildpack/api.rs @@ -1,5 +1,4 @@ use serde::Deserialize; -use std::convert::TryFrom; use std::fmt; use std::fmt::{Display, Formatter}; diff --git a/libcnb-data/src/buildpack/mod.rs b/libcnb-data/src/buildpack/mod.rs index 28845bf6..c65090ed 100644 --- a/libcnb-data/src/buildpack/mod.rs +++ b/libcnb-data/src/buildpack/mod.rs @@ -232,7 +232,6 @@ pub struct Group { #[cfg(test)] mod tests { use super::*; - use crate::sbom::SbomFormat; #[test] #[allow(clippy::too_many_lines)] diff --git a/libcnb-data/src/buildpack/stack.rs b/libcnb-data/src/buildpack/stack.rs index 012d6254..45bb381b 100644 --- a/libcnb-data/src/buildpack/stack.rs +++ b/libcnb-data/src/buildpack/stack.rs @@ -53,7 +53,7 @@ id = "*" toml::from_str::(toml_str), Ok(Stack { id: String::from("*"), - mixins: vec![], + mixins: Vec::new(), }), ); } diff --git a/libcnb-data/src/buildpack/version.rs b/libcnb-data/src/buildpack/version.rs index 9fa3ad4b..2043cda3 100644 --- a/libcnb-data/src/buildpack/version.rs +++ b/libcnb-data/src/buildpack/version.rs @@ -1,5 +1,4 @@ use serde::Deserialize; -use std::convert::TryFrom; use std::fmt; use std::fmt::{Display, Formatter}; diff --git a/libcnb-data/src/newtypes.rs b/libcnb-data/src/newtypes.rs index cf914c18..0b370d22 100644 --- a/libcnb-data/src/newtypes.rs +++ b/libcnb-data/src/newtypes.rs @@ -190,7 +190,6 @@ pub(crate) use libcnb_newtype; #[cfg(test)] mod tests { - use super::libcnb_newtype; use serde_test::{assert_de_tokens, assert_de_tokens_error, Token}; libcnb_newtype!( diff --git a/libcnb-package/Cargo.toml b/libcnb-package/Cargo.toml index a18e6a28..250af6e5 100644 --- a/libcnb-package/Cargo.toml +++ b/libcnb-package/Cargo.toml @@ -16,11 +16,11 @@ workspace = true [dependencies] cargo_metadata = "0.18.1" -ignore = "0.4" -indoc = "2.0.4" +ignore = "0.4.22" +indoc = "2.0.5" libcnb-common.workspace = true libcnb-data.workspace = true petgraph = { version = "0.6.4", default-features = false } -thiserror = "1.0.57" +thiserror = "1.0.58" uriparse = "0.6.4" -which = "6.0.0" +which = "6.0.1" diff --git a/libcnb-proc-macros/Cargo.toml b/libcnb-proc-macros/Cargo.toml index 2e29d588..9c12c8c1 100644 --- a/libcnb-proc-macros/Cargo.toml +++ b/libcnb-proc-macros/Cargo.toml @@ -19,5 +19,5 @@ workspace = true [dependencies] cargo_metadata = "0.18.1" fancy-regex = { version = "0.13.0", default-features = false, features = ["std"] } -quote = "1.0.35" -syn = { version = "2.0.50", features = ["full"] } +quote = "1.0.36" +syn = { version = "2.0.58", features = ["full"] } diff --git a/libcnb-test/Cargo.toml b/libcnb-test/Cargo.toml index f2ceea32..3b786003 100644 --- a/libcnb-test/Cargo.toml +++ b/libcnb-test/Cargo.toml @@ -15,15 +15,15 @@ include = ["src/**/*", "LICENSE", "README.md"] workspace = true [dependencies] -fastrand = "2.0.1" +fastrand = "2.0.2" fs_extra = "1.3.0" libcnb-common.workspace = true libcnb-data.workspace = true libcnb-package.workspace = true -tempfile = "3.10.0" -thiserror = "1.0.57" +tempfile = "3.10.1" +thiserror = "1.0.58" [dev-dependencies] -indoc = "2.0.4" -ureq = { version = "2.9.6", default-features = false } +indoc = "2.0.5" libcnb.workspace = true +ureq = { version = "2.9.6", default-features = false } diff --git a/libcnb-test/tests/integration_test.rs b/libcnb-test/tests/integration_test.rs index 9fe96f38..52a64f01 100644 --- a/libcnb-test/tests/integration_test.rs +++ b/libcnb-test/tests/integration_test.rs @@ -683,7 +683,7 @@ fn address_for_port_when_container_crashed() { .command(["echo 'some stdout'; echo 'some stderr' >&2; exit 1"]) .expose_port(TEST_PORT), |container| { - container_name = container.container_name.clone(); + container_name.clone_from(&container.container_name); // Wait for the container to actually exit, otherwise `address_for_port()` will succeed. thread::sleep(Duration::from_secs(1)); let _ = container.address_for_port(TEST_PORT); diff --git a/libcnb/Cargo.toml b/libcnb/Cargo.toml index 053afe86..9eb6ee4a 100644 --- a/libcnb/Cargo.toml +++ b/libcnb/Cargo.toml @@ -18,7 +18,7 @@ workspace = true trace = ["dep:opentelemetry", "dep:opentelemetry_sdk", "dep:opentelemetry-stdout"] [dependencies] -anyhow = { version = "1.0.80", optional = true } +anyhow = { version = "1.0.82", optional = true } cyclonedx-bom = { version = "0.5.0", optional = true } libcnb-common.workspace = true libcnb-data.workspace = true @@ -27,9 +27,9 @@ opentelemetry = { version = "0.21.0", optional = true } opentelemetry_sdk = { version = "0.21.2", optional = true } opentelemetry-stdout = { version = "0.2.0", optional = true, features = ["trace"] } serde = { version = "1.0.197", features = ["derive"] } -thiserror = "1.0.57" +thiserror = "1.0.58" toml.workspace = true [dev-dependencies] -tempfile = "3.10.0" -serde_json = "1.0.114" +serde_json = "1.0.115" +tempfile = "3.10.1" diff --git a/libcnb/src/layer/handling.rs b/libcnb/src/layer/handling.rs index fc7f2515..39538d43 100644 --- a/libcnb/src/layer/handling.rs +++ b/libcnb/src/layer/handling.rs @@ -462,14 +462,12 @@ fn read_layer>( #[cfg(test)] mod tests { use super::*; - use crate::data::layer_content_metadata::{LayerContentMetadata, LayerTypes}; + use crate::data::layer_content_metadata::LayerTypes; use crate::data::layer_name; - use crate::generic::GenericMetadata; use crate::layer_env::{ModificationBehavior, Scope}; use crate::read_toml_file; use serde::Deserialize; use std::ffi::OsString; - use std::fs; use tempfile::tempdir; diff --git a/libcnb/src/platform.rs b/libcnb/src/platform.rs index 378082b4..21567ff4 100644 --- a/libcnb/src/platform.rs +++ b/libcnb/src/platform.rs @@ -65,7 +65,6 @@ pub(crate) fn read_platform_env(platform_dir: impl AsRef) -> std::io::Resu mod tests { use super::*; use std::ffi::OsString; - use std::fs; #[test] fn read_platform_env_reads_correct_env_vars() { diff --git a/libcnb/src/target.rs b/libcnb/src/target.rs index 0cc0cbf3..0d102aa6 100644 --- a/libcnb/src/target.rs +++ b/libcnb/src/target.rs @@ -12,7 +12,6 @@ pub struct Target { /// `amd64` or `arm64`. /// /// CNB `lifecycle` sources this value from the build OCI image's [`architecture` property](https://github.com/opencontainers/image-spec/blob/main/config.md#properties). - /// `` pub arch: String, /// The variant of the specified CPU architecture. /// @@ -29,7 +28,7 @@ pub struct Target { pub distro_name: Option, /// The version of the operating system distribution. /// - /// For example: `18.02` or `3.19`. + /// For example: `22.04` or `3.19`. /// /// CNB `lifecycle` sources this value from the build OCI image's `io.buildpacks.base.distro.version` label. pub distro_version: Option, diff --git a/libcnb/src/tracing.rs b/libcnb/src/tracing.rs index 2d0eae80..6f66f76e 100644 --- a/libcnb/src/tracing.rs +++ b/libcnb/src/tracing.rs @@ -104,7 +104,7 @@ impl BuildpackTrace { } /// Add a named event to the underlying span. pub(crate) fn add_event(&mut self, name: &'static str) { - self.span.add_event(name, vec![]); + self.span.add_event(name, Vec::new()); } } @@ -139,8 +139,8 @@ mod tests { homepage: None, clear_env: false, description: None, - keywords: vec![], - licenses: vec![], + keywords: Vec::new(), + licenses: Vec::new(), sbom_formats: HashSet::new(), }; let telemetry_path = "/tmp/libcnb-telemetry/company_com_foo-bar.jsonl"; diff --git a/libherokubuildpack/Cargo.toml b/libherokubuildpack/Cargo.toml index f178aae2..b8343c75 100644 --- a/libherokubuildpack/Cargo.toml +++ b/libherokubuildpack/Cargo.toml @@ -43,11 +43,11 @@ pathdiff = { version = "0.2.1", optional = true } sha2 = { version = "0.10.8", optional = true } tar = { version = "0.4.40", default-features = false, optional = true } termcolor = { version = "1.4.1", optional = true } -thiserror = { version = "1.0.57", optional = true } +thiserror = { version = "1.0.58", optional = true } toml = { workspace = true, optional = true } ureq = { version = "2.9.6", default-features = false, features = ["tls"], optional = true } [dev-dependencies] -indoc = "2.0.4" +indoc = "2.0.5" libcnb-test = { workspace = true } -tempfile = "3.10.0" +tempfile = "3.10.1" diff --git a/libherokubuildpack/src/buildpack_output/util.rs b/libherokubuildpack/src/buildpack_output/util.rs index ba8154d3..8a147846 100644 --- a/libherokubuildpack/src/buildpack_output/util.rs +++ b/libherokubuildpack/src/buildpack_output/util.rs @@ -160,7 +160,7 @@ mod test { fn test_paragraph_inspect_write() { use std::io::Write; - let buffer: Vec = vec![]; + let buffer: Vec = Vec::new(); let mut inspect_write = ParagraphInspectWrite::new(buffer); assert!(!inspect_write.was_paragraph); diff --git a/libherokubuildpack/src/fs.rs b/libherokubuildpack/src/fs.rs index ada992cb..1a2bcf2f 100644 --- a/libherokubuildpack/src/fs.rs +++ b/libherokubuildpack/src/fs.rs @@ -41,7 +41,6 @@ pub fn move_directory_contents( #[cfg(test)] mod test { use std::collections::HashMap; - use std::fs; use std::path::PathBuf; use tempfile::tempdir;