Skip to content

Releases: heroku/libcnb.rs

v0.21.0

30 Apr 15:27
a4e48fd
Compare
Choose a tag to compare

Added

  • libcnb:
    • Target now implements Clone and Debug. (#821)

Changed

  • libcnb:
    • Changed the type of Target's distro_name and distro_version fields from Option<String> to String. (#821)
    • The libcnb runtime now enforces that the CNB_TARGET_DISTRO_NAME and CNB_TARGET_DISTRO_VERSION env vars have been set by lifecycle. (#821)

v0.20.0

12 Apr 10:34
78d218e
Compare
Choose a tag to compare

Added

  • libcnb:
    • Made Target (the type of DetectContext::target and BuildContext::target) public. (#815)

Changed

  • libcnb:
    • WriteLayerError changed to contain more specific error enums instead of generic ones. (#786)
  • libcnb-data:
    • Renamed Target to BuildpackTarget to disambiguate it from the new libcnb::Target. (#815)

v0.19.0

23 Feb 16:54
b538cd3
Compare
Choose a tag to compare

Added

  • libcnb-data:
    • Reintroduced support for deserializing [[stacks]] in buildpack.toml.
      (#789)
  • libherokubuildpack:
    • Added buildpack_output module. This will help buildpack authors provide consistent and delightful output to their buildpack users (#721)

v0.18.0

12 Feb 14:08
f959dd1
Compare
Choose a tag to compare

Changed

  • Now targets Buildpack API 0.10. Buildpacks need to upgrade the api key to 0.10 in their buildpack.toml. (#773)
  • Improved the consistency of cross-compilation assistance provided across all supported target_triple and host OS/architecture combinations. #769
  • Added cross-compilation assistance for aarch64-unknown-linux-musl (on macOS and ARM64 Linux) and x86_64-unknown-linux-musl (on ARM64 Linux). #769
  • Raised Minimum Supported Rust Version (MSRV) to 1.76. (#774)
  • libcnb:
    • Changed Layer interface from &self to &mut self. (#669)

Added

  • libherokubuildpack:
    • MappedWrite::unwrap for getting the wrapped Write back out. (#765)

Removed

  • Types, errors, macros and functions related to stacks. The concept of stacks has been removed from the CNB spec. Use Target instead. (#773)

v0.17.0

06 Dec 17:53
24a10fd
Compare
Choose a tag to compare

Added

  • libcnb:
    • An optional trace feature has been added that emits OpenTelemetry tracing
      data to a File Export. (#723)

v0.16.0

17 Nov 15:24
6cd51ce
Compare
Choose a tag to compare

Changed

  • Raised Minimum Supported Rust Version (MSRV) to 1.74. (#747)
  • Improved the consistency of all user-facing libcnb.rs error message wordings. (#722)
  • The assistance error message shown when the necessary cross-compilation tools are not found now also includes the rustup target add step. (#729)
  • Updated the documentation for TestRunner::build and TestContext::start_container to mention when Docker resource teardown occurs. (#743)

Fixed

  • libcnb-test:
    • Fixed incorrect error messages being shown for buildpack compilation/packaging failures. (#720)
    • The Docker volumes created by Pack for the build and launch layer caches are now cleaned up after each test. (#741)
    • The Docker image cleanup process no longer makes duplicate attempts to remove images when using TestContext::rebuild. (#741)
    • Test failures due to the Docker daemon not being installed or started no longer cause a non-unwinding panic abort with noisy traceback. (#741)
    • Containers created by TestContext::start_container are now correctly cleaned up if the container failed to start. (#742)

v0.15.0

25 Sep 13:09
56b4f4e
Compare
Choose a tag to compare

Added

  • libcnb:
    • LayerTypes now implements Copy and Clone. (#670).
  • libcnb-data:
    • ExecDProgramOutputKey, ProcessType, LayerName, BuildpackId and StackId now implement Ord and PartialOrd. (#658)
    • Added generic::GenericMetadata as a generic metadata type. Also makes it the default for BuildpackDescriptor, SingleBuildpackDescriptor, CompositeBuildpackDescriptor and LayerContentMetadata. (#664)
  • libcnb-test:
    • Added the BuildpackReference::WorkspaceBuildpack enum variant. This allows for the testing of any libcnb.rs or composite buildpack in the Cargo workspace, instead of only the buildpack of the current crate. Note: The testing of composite buildpacks requires pack CLI version >=0.30. (#666)

Changed

  • libcnb-data:
    • Renamed the buildpackage module to package_descriptor, and the Buildpackage* types within it to PackageDescriptor*. (#656)
    • Renamed multiple types to match the new composite vs component buildpack upstream terminology. Renamed SingleBuildpackDescriptor to ComponentBuildpackDescriptor, MetaBuildpackDescriptor to CompositeBuildpackDescriptor and BuildpackDescriptor::{Single,Meta} to BuildpackDescriptor::{Component,Composite}. (#682)
  • libcnb-cargo:
    • No longer outputs paths for non-libcnb.rs and non-meta buildpacks. (#657)
    • Build output for humans changed slightly, output intended for machines/scripting didn't change. (#657)
    • When performing buildpack detection, standard ignore files (.ignore and .gitignore) will be respected. (#673)
  • libcnb-test:
    • Renamed BuildpackReference::Crate to BuildpackReference::CurrentCrate. (#666)

v0.14.0

18 Aug 15:26
b700ea0
Compare
Choose a tag to compare

Added

  • libcnb-package: Added cross-compilation assistance for Linux aarch64-unknown-linux-musl. (#577)
  • libcnb-cargo: Added --package-dir command line option to control where packaged buildpacks are written. (#583)
  • libcnb-test:
    • LogOutput now implements std::fmt::Display. (#635)
    • ContainerConfig now implements Clone. (#636)

Changed

  • libcnb-cargo: Moved the default location for packaged buildpacks from Cargo's target/ directory to packaged/ in the Cargo workspace root. This simplifies the path and stops modification of the target/ directory which previously might have caching implications when other tools didn't expect non-Cargo output in that directory. Users that implicitly rely on the output directory need to adapt. The output of cargo libcnb package will refer to the new locations. (#583)
  • libcnb-package:
    • buildpack target directory now contains the target triple. Users that implicitly rely on the output directory need to adapt. The output of cargo libcnb package will refer to the new locations. (#580)
    • get_buildpack_target_dir was renamed to get_buildpack_package_dir (#583)
  • libcnb-test:
    • ContainerContext::address_for_port will now panic for all failure modes rather than just some, and so now returns SocketAddr directly instead of Option<SocketAddr>. This reduces test boilerplate due to the caller no longer needing to .unwrap() and improves debugging UX when containers crash after startup. (#605 and #636)
    • Docker commands are now run using the Docker CLI instead of Bollard and the Docker daemon API. (#620)
    • ContainerConfig::entrypoint now accepts a String rather than a vector of strings. Any arguments to the entrypoint should be moved to ContainerConfig::command. (#620)
    • Removed TestRunner::new since its only purpose was for advanced configuration that's no longer applicable. Use TestRunner::default instead. (#620)
    • Removed stdout_raw and stderr_raw from LogOutput. (#607)
    • Improved wording of panic error messages. (#619 and #620)
  • libherokubuildpack: Changed the flate2 decompression backend from miniz_oxide to zlib. (#593)

Fixed

  • libcnb-test:
    • TestContext::run_shell_command and ContainerContext::shell_exec now validate the exit code of the spawned commands and panic if they are non-zero. (#620)
    • ContainerContext::expose_port now only exposes the port to localhost. (#610)
    • If a test with an expected result of PackResult::Failure unexpectedly succeeds, the built app image is now correctly cleaned up. (#625)

v0.13.0

17 Jul 21:49
868e6f3
Compare
Choose a tag to compare

The highlight of this release is the cargo libcnb package changes to support compilation of both buildpacks and meta-buildpacks.

Changed

  • libcnb-cargo: The cargo libcnb package command now supports compiling buildpacks and meta-buildpacks (#575):
    • When used in a buildpack directory it will compile only that buildpack.
    • When used in a workspace directory it will compile all buildpacks found in subdirectories.
  • libcnb-package: Changed default_buildpack_directory_name to accept a BuildpackId (#575)

Added

  • libcnb-cargo
    • Buildpacks can reference other buildpacks within a workspace by using uri = "libcnb:{buildpack_id}" as a dependency entry in the buildpack's package.toml file. (#575)
  • libcnb-data
    • Serialization / deserialization of package.toml files supported with the Buildpackage struct. (#575)
  • libcnb-package
    • Added read_buildpackage_data, find_buildpack_dirs, get_buildpack_target_dir to support packaging operations. (#575)
    • Added buildpack_dependency::BuildpackDependency, buildpack_dependency::get_local_buildpackage_dependencies, buildpack_dependency::rewrite_buildpackage_local_dependencies, buildpack_dependency::rewrite_buildpackage_relative_path_dependencies_to_absolute to support Buildpack dependency handling and packaging operations. (#575)
    • Added buildpack_package::BuildpackPackage, buildpack_package::read_buildpack_package to support libcnb.rs-based Rust packages. (#575)
    • Added dependency_graph::DependencyNode, dependency_graph::create_dependency_graph, dependency_graph::get_dependencies to support dependency ordering and resolution in libcnb.rs-based Rust packages. (#575)

v0.12.0

28 Apr 11:46
bc86099
Compare
Choose a tag to compare

Highlight of this release is the bump to Buildpack API 0.9. This release contains breaking changes, please refer to the items below for migration advice.

Changed

  • libcnb.rs now targets Buildpack API 0.9. Buildpacks need to upgrade the api key to 0.9 in their buildpack.toml. (#567)
    • Process no longer supports the direct flag. All processes are now direct. Processes that need to use bash can use bash explicitly in the command. (#567)
    • Process::command has been changed to a sequence of values where the first one is the executable and any additional values are arguments to the executable. The already existing args field behaves slightly different now as its contents can now be overridden by the user. See the upstream CNB specification for details. (#567)
  • Env::get now returns Option<&OsString> instead of Option<OsString>. This is more in line with expectations users have when dealing with a collection type. This is a breaking change, compile errors can be fixed by adding a Option::cloned call after Env::get to get the old behaviour. In some cases, cloning might not be necessary, slightly improving the code that uses Env::get. (#565)

Added

  • Env::get_string_lossy as a convenience method to work with environment variables directly. Getting a value out of an Env and treating its contents as unicode is a common case. Using this new method can simplify buildpack code. (#565)
  • Clone implementation for libcnb::layer_env::Scope. (#566)