Skip to content

Conversation

@Leiyks
Copy link
Contributor

@Leiyks Leiyks commented Jan 5, 2026

Description

Problem

DataDog PHP tracer packages fail to install on Alpine Linux 3.23 with the error:
ERROR: datadog-php-tracer_1.14.1_aarch64.apk: v2 package format error

Root Cause

Alpine 3.23 introduced apk-tools v3.0.0, which enforces stricter APK v2 package validation. The new version requires a datahash field in the package's PKGINFO file - a SHA256 hash of the gzipped data.tar that's validated post-installation. Packages built with fpm 1.17.0 don't include this field, causing validation failures.

Solution

Add a patch with fpm_apk_alpine323.patch that:

  • Generates SHA256 hash of the gzipped data.tar
  • Calls hash_datatar() before calculating datahash, since hash_datatar modifies the tar by adding PAX headers with file checksums
  • Sets mtime=0 to ensure deterministic compression output (required for datahash to match the actual package data)
  • Add datahash to PKGINFO by writing datahash = <sha256> field for Alpine 3.23+ validation

Fixes #3529

@Leiyks Leiyks force-pushed the leiyks/3529 branch 3 times, most recently from d503645 to d962ab4 Compare January 5, 2026 16:08
@Leiyks Leiyks marked this pull request as ready for review January 5, 2026 16:15
@Leiyks Leiyks requested a review from a team as a code owner January 5, 2026 16:15
Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.64%. Comparing base (98a31cb) to head (3305991).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3555      +/-   ##
==========================================
- Coverage   61.65%   61.64%   -0.02%     
==========================================
  Files         139      139              
  Lines       13051    13051              
  Branches     1712     1712              
==========================================
- Hits         8047     8045       -2     
- Misses       4238     4241       +3     
+ Partials      766      765       -1     

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98a31cb...3305991. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: APK package format error

3 participants