Skip to content

Commit

Permalink
Support Ubuntu 24.04 / heroku-24 (amd64 and arm64)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Jun 4, 2024
1 parent 44dcea0 commit 72e0822
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,17 @@ jobs:
run: cargo test --locked

integration-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
builder: ["builder:22", "builder:20"]
builder: ["builder:24", "builder:22", "builder:20"]
arch: ["amd64", "arm64"]
exclude:
- builder: "builder:22"
arch: "arm64"
- builder: "builder:20"
arch: "arm64"
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-22.04-arm-large' || 'ubuntu-latest' }}
env:
INTEGRATION_TEST_CNB_BUILDER: heroku/${{ matrix.builder }}
steps:
Expand All @@ -54,11 +60,11 @@ jobs:
with:
submodules: true
- name: Install musl-tools
run: sudo apt-get install musl-tools --no-install-recommends
run: sudo apt-get install -y --no-install-recommends musl-tools
- name: Update Rust toolchain
run: rustup update
- name: Install Rust linux-musl target
run: rustup target add x86_64-unknown-linux-musl
run: rustup target add ${{ matrix.arch == 'arm64' && 'aarch64' || 'x86_64' }}-unknown-linux-musl
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install Pack CLI
Expand Down
2 changes: 2 additions & 0 deletions buildpacks/php/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add PHP/8.3, update PHP runtimes, extensions, Composers, web servers (#104)
- Support Ubuntu 24.04 (and, as a result, Heroku-24 and `heroku/builder:24`)
- Support `arm64` CPU architecture (Ubuntu 24.04 / Heroku-24 only)

### Changed

Expand Down
12 changes: 12 additions & 0 deletions buildpacks/php/buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@ version = "20.04"
name = "ubuntu"
version = "22.04"

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

[[targets]]
os = "linux"
arch = "arm64"

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

[metadata.release]
image = { repository = "docker.io/heroku/buildpack-php" }
2 changes: 1 addition & 1 deletion buildpacks/php/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub(crate) fn heroku_stack_name_for_target(target: &Target) -> Result<String, St
..
} = target;
match (os.as_str(), distro_name.as_str(), distro_version.as_str()) {
("linux", "ubuntu", v @ ("20.04" | "22.04")) => {
("linux", "ubuntu", v @ ("20.04" | "22.04" | "24.04")) => {
Ok(format!("heroku-{}", v.strip_suffix(".04").unwrap_or(v)))
}
_ => Err(format!("{os}-{distro_name}-{distro_version}")),
Expand Down
12 changes: 10 additions & 2 deletions buildpacks/php/tests/integration/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,18 @@ pub(crate) fn smoke_test<P, B>(
P: AsRef<Path>,
B: Into<Vec<BuildpackReference>>,
{
let build_config = BuildConfig::new(builder_name.as_ref(), app_dir)
let mut build_config = BuildConfig::new(builder_name.as_ref(), app_dir)
.buildpacks(buildpacks.into())
.clone();

let target_triple = match builder_name.as_ref() {
// Compile the buildpack for ARM64 iff the builder supports multi-arch and the host is ARM64.
"heroku/builder:24" if cfg!(target_arch = "aarch64") => "aarch64-unknown-linux-musl",
_ => "x86_64-unknown-linux-musl",
};

build_config.target_triple(target_triple);

TestRunner::default().build(&build_config, |context| {
start_container_assert_basic_http_response(&context, expected_http_response_body_contains);

Expand All @@ -89,7 +97,7 @@ pub(crate) fn smoke_test<P, B>(
});
}

const DEFAULT_INTEGRATION_TEST_BUILDER: &str = "heroku/builder:22";
const DEFAULT_INTEGRATION_TEST_BUILDER: &str = "heroku/builder:24";

const UREQ_RESPONSE_RESULT_EXPECT_MESSAGE: &str = "http request should be successful";

Expand Down

0 comments on commit 72e0822

Please sign in to comment.