Skip to content

Commit

Permalink
Prepare release v0.20.0 (#817)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
heroku-linguist[bot] and edmorley committed Apr 12, 2024
1 parent 292762e commit 78d218e
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 50 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" }
2 changes: 1 addition & 1 deletion examples/execd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions libcnb-cargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
2 changes: 1 addition & 1 deletion libcnb-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion libcnb-data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion libcnb-data/src/buildpack/api.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use serde::Deserialize;
use std::convert::TryFrom;
use std::fmt;
use std::fmt::{Display, Formatter};

Expand Down
1 change: 0 additions & 1 deletion libcnb-data/src/buildpack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ pub struct Group {
#[cfg(test)]
mod tests {
use super::*;
use crate::sbom::SbomFormat;

#[test]
#[allow(clippy::too_many_lines)]
Expand Down
2 changes: 1 addition & 1 deletion libcnb-data/src/buildpack/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ id = "*"
toml::from_str::<Stack>(toml_str),
Ok(Stack {
id: String::from("*"),
mixins: vec![],
mixins: Vec::new(),
}),
);
}
Expand Down
1 change: 0 additions & 1 deletion libcnb-data/src/buildpack/version.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use serde::Deserialize;
use std::convert::TryFrom;
use std::fmt;
use std::fmt::{Display, Formatter};

Expand Down
1 change: 0 additions & 1 deletion libcnb-data/src/newtypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down
8 changes: 4 additions & 4 deletions libcnb-package/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions libcnb-proc-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
10 changes: 5 additions & 5 deletions libcnb-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
2 changes: 1 addition & 1 deletion libcnb-test/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions libcnb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
4 changes: 1 addition & 3 deletions libcnb/src/layer/handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,12 @@ fn read_layer<M: DeserializeOwned, P: AsRef<Path>>(
#[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;

Expand Down
1 change: 0 additions & 1 deletion libcnb/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub(crate) fn read_platform_env(platform_dir: impl AsRef<Path>) -> std::io::Resu
mod tests {
use super::*;
use std::ffi::OsString;
use std::fs;

#[test]
fn read_platform_env_reads_correct_env_vars() {
Expand Down
3 changes: 1 addition & 2 deletions libcnb/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -29,7 +28,7 @@ pub struct Target {
pub distro_name: Option<String>,
/// 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<String>,
Expand Down
6 changes: 3 additions & 3 deletions libcnb/src/tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down Expand Up @@ -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";
Expand Down
6 changes: 3 additions & 3 deletions libherokubuildpack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion libherokubuildpack/src/buildpack_output/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod test {
fn test_paragraph_inspect_write() {
use std::io::Write;

let buffer: Vec<u8> = vec![];
let buffer: Vec<u8> = Vec::new();
let mut inspect_write = ParagraphInspectWrite::new(buffer);
assert!(!inspect_write.was_paragraph);

Expand Down
1 change: 0 additions & 1 deletion libherokubuildpack/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 78d218e

Please sign in to comment.