Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from stacks to targets AKA "Stay on target" #283

Merged
merged 14 commits into from
May 15, 2024
Merged
178 changes: 59 additions & 119 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions buildpacks/ruby/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ glob = "0.3"
indoc = "2"
# libcnb has a much bigger impact on buildpack behaviour than any other dependencies,
# so it's pinned to an exact version to isolate it from lockfile refreshes.
libcnb = "=0.17.0"
libherokubuildpack = { version = "=0.17.0", default-features = false, features = ["digest"] }
libcnb = "=0.21.0"
libherokubuildpack = { version = "=0.21.0", default-features = false, features = ["digest"] }
rand = "0.8"
# TODO: Consolidate on either the regex crate or the fancy-regex crate, since this repo currently uses both.
regex = "1"
Expand All @@ -27,7 +27,8 @@ tempfile = "3"
thiserror = "1"
ureq = { version = "2", default-features = false, features = ["tls"] }
url = "2"
magic_migrate = "0.2"
toml = "0.8"

[dev-dependencies]
libcnb-test = "=0.17.0"
toml = "0.8"
libcnb-test = "=0.21.0"
23 changes: 18 additions & 5 deletions buildpacks/ruby/buildpack.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
api = "0.9"
api = "0.10"

schneems marked this conversation as resolved.
Show resolved Hide resolved
[buildpack]
id = "heroku/ruby"
Expand All @@ -12,10 +12,23 @@ keywords = ["ruby", "rails", "heroku"]
type = "BSD-3-Clause"

[[stacks]]
id = "heroku-20"

[[stacks]]
id = "heroku-22"
id = "*"

schneems marked this conversation as resolved.
Show resolved Hide resolved
[metadata.release]
image = { repository = "docker.io/heroku/buildpack-ruby" }

[[targets]]
os = "linux"
schneems marked this conversation as resolved.
Show resolved Hide resolved
arch = "arm64"

[[targets]]
schneems marked this conversation as resolved.
Show resolved Hide resolved
os = "linux"
arch = "amd64"

[[targets.distros]]
name = "ubuntu"
version = "20.04"

[[targets.distros]]
name = "ubuntu"
version = "22.04"
11 changes: 5 additions & 6 deletions buildpacks/ruby/src/layers/bundle_download_layer.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use crate::RubyBuildpack;
use crate::RubyBuildpackError;
use commons::gemfile_lock::ResolvedBundlerVersion;
use commons::output::{
fmt,
section_log::{log_step, log_step_timed, SectionLogger},
};

use crate::RubyBuildpack;
use crate::RubyBuildpackError;
use commons::gemfile_lock::ResolvedBundlerVersion;
use fun_run::{self, CommandWithName};
use libcnb::build::BuildContext;
use libcnb::data::layer_content_metadata::LayerTypes;
Expand Down Expand Up @@ -46,7 +45,7 @@ impl<'a> Layer for BundleDownloadLayer<'a> {
}

fn create(
&self,
&mut self,
_context: &BuildContext<Self::Buildpack>,
layer_path: &Path,
) -> Result<LayerResult<Self::Metadata>, RubyBuildpackError> {
Expand Down Expand Up @@ -106,7 +105,7 @@ impl<'a> Layer for BundleDownloadLayer<'a> {
}

fn existing_layer_strategy(
&self,
&mut self,
_context: &BuildContext<Self::Buildpack>,
layer_data: &LayerData<Self::Metadata>,
) -> Result<ExistingLayerStrategy, RubyBuildpackError> {
Expand Down
Loading
Loading