Skip to content

Distribution Packaging Improvements#3042

Open
skmcgrail wants to merge 2 commits intoaws:mainfrom
skmcgrail:washbear-package
Open

Distribution Packaging Improvements#3042
skmcgrail wants to merge 2 commits intoaws:mainfrom
skmcgrail:washbear-package

Conversation

@skmcgrail
Copy link
Member

@skmcgrail skmcgrail commented Feb 24, 2026

Summary

  • Introduces ENABLE_DIST_PKG and ENABLE_DIST_PKG_OPENSSL_SHIM CMake options to support Linux distribution packaging where AWS-LC must coexist alongside OpenSSL.
  • When ENABLE_DIST_PKG is enabled, headers are installed under include/aws-lc/ (cohabitant headers) and libraries are built with an -awslc suffix (e.g., libcrypto-awslc.so), preventing file conflicts with other providers
  • The optional ENABLE_DIST_PKG_OPENSSL_SHIM flag creates libcrypto.so, libssl.so, include/openssl, and openssl.pc symlinks or files for drop-in OpenSSL compatibility
  • Refactors pkgconfig generation: replaces openssl.pc.in with product.pc.in, makes library names dynamic in .pc templates, and adds Libs.private for pthread linkage to make pkg-config work correctly for static builds as well.
  • Replaces PERFORM_SONAME_BUILD internal logic with with SET_LIB_SONAME and COHABITANT_HEADERS variables for clearer intent; adds deprecation warning for ENABLE_PRE_SONAME_BUILD as we should remove it in a future release.
  • Moves find_package(Threads) to the top-level CMakeLists.txt and uses Threads::Threads imported target instead of a hardcoded -lpthread, improving cross-platform correctness
  • Switches library install rules from NAMELINK_SKIP to NAMELINK_COMPONENT Development (CMake 3.12+) with a fallback for older CMake versions
  • Centralizes OpenSSL compatibility symlink creation in the top-level CMakeLists.txt instead of scattering it across crypto/ and ssl/ CMakeLists
  • Adds a comprehensive CI test script (tests/ci/run_dist_pkg_tests.sh) that validates all four installation matrix combinations (shared/static x with/without OpenSSL shim) including structure verification, CMake find_package integration, and pkg-config consumption
  • Adds a dist_pkg_tests CI job to the linux x86 omnibus workflow

Testing

  • Verify CI passes for the new dist_pkg_tests job in the linux x86 omnibus workflow
  • Build with ENABLE_DIST_PKG=ON (shared) and verify headers install to include/aws-lc/openssl/, libraries are named libcrypto-awslc.so/libssl-awslc.so, and pkgconfig files reference the correct names
  • Build with ENABLE_DIST_PKG=ON -DENABLE_DIST_PKG_OPENSSL_SHIM=ON and verify libcrypto.so, libssl.so, and include/openssl symlinks are created alongside openssl.pc
  • Build with ENABLE_DIST_PKG=OFF (default) and verify no behavioral change from the previous build
  • Build with the legacy ENABLE_PRE_SONAME_BUILD=OFF path and verify the deprecation warning is emitted
  • Verify a downstream application can consume the dist-pkg installation via both find_package and pkg-config
------------------------------------------------------------------------
DIST_PKG=0, SHIM=0, STATIC
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto.a
lib64/libssl.a

## Library symlinks in lib64/:
  (none)

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto.pc
lib64/pkgconfig/libssl.pc
lib64/pkgconfig/openssl.pc

## Header directories:
include
include/openssl
include/openssl/experimental

## Header files (truncated, showing first 2):
include/openssl/aead.h
include/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  (none)

------------------------------------------------------------------------
DIST_PKG=0, SHIM=0, SHARED
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto.so
lib64/libssl.so

## Library symlinks in lib64/:
  (none)

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto.pc
lib64/pkgconfig/libssl.pc
lib64/pkgconfig/openssl.pc

## Header directories:
include
include/openssl
include/openssl/experimental

## Header files (truncated, showing first 2):
include/openssl/aead.h
include/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  (none)

------------------------------------------------------------------------
DIST_PKG=1, SHIM=0, STATIC
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto-awslc.a
lib64/libssl-awslc.a

## Library symlinks in lib64/:
  (none)

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto-awslc.pc
lib64/pkgconfig/libssl-awslc.pc

## Header directories:
include
include/aws-lc
include/aws-lc/openssl
include/aws-lc/openssl/experimental

## Header files (truncated, showing first 2):
include/aws-lc/openssl/aead.h
include/aws-lc/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  (none)

------------------------------------------------------------------------
DIST_PKG=1, SHIM=0, SHARED
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto-awslc.so.1.68.0
lib64/libssl-awslc.so.1.68.0

## Library symlinks in lib64/:
  lib64/libssl-awslc.so -> libssl-awslc.so.0
  lib64/libssl-awslc.so.0 -> libssl-awslc.so.1.68.0
  lib64/libcrypto-awslc.so -> libcrypto-awslc.so.0
  lib64/libcrypto-awslc.so.0 -> libcrypto-awslc.so.1.68.0

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto-awslc.pc
lib64/pkgconfig/libssl-awslc.pc

## Header directories:
include
include/aws-lc
include/aws-lc/openssl
include/aws-lc/openssl/experimental

## Header files (truncated, showing first 2):
include/aws-lc/openssl/aead.h
include/aws-lc/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  (none)

------------------------------------------------------------------------
DIST_PKG=1, SHIM=1, STATIC
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto-awslc.a
lib64/libssl-awslc.a

## Library symlinks in lib64/:
  lib64/libssl.a -> libssl-awslc.a
  lib64/libcrypto.a -> libcrypto-awslc.a

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto-awslc.pc
lib64/pkgconfig/libssl-awslc.pc
lib64/pkgconfig/openssl.pc

## Header directories:
include
include/aws-lc
include/aws-lc/openssl
include/aws-lc/openssl/experimental

## Header files (truncated, showing first 2):
include/aws-lc/openssl/aead.h
include/aws-lc/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  include/openssl -> aws-lc/openssl

------------------------------------------------------------------------
DIST_PKG=1, SHIM=1, SHARED
------------------------------------------------------------------------

## Libraries (lib64/):
lib64/libcrypto-awslc.so.1.68.0
lib64/libssl-awslc.so.1.68.0

## Library symlinks in lib64/:
  lib64/libssl-awslc.so -> libssl-awslc.so.0
  lib64/libssl-awslc.so.0 -> libssl-awslc.so.1.68.0
  lib64/libcrypto-awslc.so -> libcrypto-awslc.so.0
  lib64/libcrypto-awslc.so.0 -> libcrypto-awslc.so.1.68.0
  lib64/libssl.so -> libssl-awslc.so
  lib64/libcrypto.so -> libcrypto-awslc.so

## Pkgconfig files:
lib64/pkgconfig/aws-lc.pc
lib64/pkgconfig/libcrypto-awslc.pc
lib64/pkgconfig/libssl-awslc.pc
lib64/pkgconfig/openssl.pc

## Header directories:
include
include/aws-lc
include/aws-lc/openssl
include/aws-lc/openssl/experimental

## Header files (truncated, showing first 2):
include/aws-lc/openssl/aead.h
include/aws-lc/openssl/aes.h
  ... (91 total header files)

## Include symlinks:
  include/openssl -> aws-lc/openssl

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.37%. Comparing base (de4383e) to head (33f15cd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3042   +/-   ##
=======================================
  Coverage   78.36%   78.37%           
=======================================
  Files         689      689           
  Lines      121141   121140    -1     
  Branches    16974    16974           
=======================================
+ Hits        94938    94944    +6     
+ Misses      25306    25300    -6     
+ Partials      897      896    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants