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

Linux static binary builds #939

Closed
wants to merge 21 commits into from
Closed
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
7 changes: 6 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ runs:
# use 2024.07.12 vcpkg baseline,
# see https://learn.microsoft.com/en-us/vcpkg/users/examples/versioning.getting-started#builtin-baseline
vcpkgGitCommitId: '1de2026f28ead93ff1773e6e680387643e914ea1'

- uses: lukka/[email protected] # pin version to avoid failed glibc dependency on ubuntu 20 runners. go back to @latest when ubuntu 22+ is adopted for runner os.
name: Configure CMake
with:
configurePreset: ci-${{ inputs.preset }}
configurePresetAdditionalArgs: "[ `-B`, `./build` ]"

- name: hack force libpthread.a for static builds
if: contains(inputs.preset, 'static')
shell: bash
run: "grep -rl ./build | xargs sed -i 's/libpthread.so/libpthread.a/g'"

- name: build ziti-edge-tunnel
shell: bash
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ jobs:
name: Linux arm64
preset: linux-arm64-static-libssl

- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux x86_64
preset: linux-x64-static

- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux arm
preset: linux-arm-static

- os: ubuntu-20.04
container: openziti/ziti-builder:v2
name: Linux arm64
preset: linux-arm64-static

steps:
- name: Debug action
uses: hmarr/debug-action@v3
Expand Down
25 changes: 25 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,31 @@
"name": "ci-linux-arm-static-libssl",
"inherits": [ "ci-linux-static-libssl", "ci-linux-arm" ]
},
{
"name": "ci-linux-static",
"description": "preset to link executable against static libs",
"cacheVariables": {
"CMAKE_EXE_LINKER_FLAGS": "-static",
"BUILD_SHARED_LIBS": "OFF",
"ZLIB_USE_STATIC_LIBS": "ON",
"OPENSSL_USE_STATIC_LIBS": "ON",
"CMAKE_SUPPRESS_REGENERATION": "ON",
"CMAKE_FIND_LIBRARY_SUFFIXES": ".a"
},
"hidden": true
},
{
"name": "ci-linux-x64-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-x64" ]
},
{
"name": "ci-linux-arm64-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-arm64" ]
},
{
"name": "ci-linux-arm-static",
"inherits": [ "ci-linux-static", "ci-linux-static-libssl", "ci-linux-arm" ]
},
{
"name": "ci-windows-x64",
"inherits": "ci-windows-x64-vs2022"
Expand Down