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

Support Ubuntu 24.04 / heroku-24 (amd64 and arm64) #112

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 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-medium' || '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 All @@ -69,4 +75,4 @@ jobs:
# only those and not the unit tests, via the `--ignored` option. On the latest stack
# we run all integration tests, but on older stacks we only run stack-specific tests.
- name: Run integration tests (all tests)
run: cargo test --locked -- --ignored --test-threads 5
run: cargo test --locked -- --ignored --test-threads $(($(nproc)+1))
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