-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: add CMake build system alongside Autotools #7481
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
base: develop
Are you sure you want to change the base?
Changes from all commits
de58575
54b4544
78616a5
f1b571b
a71ad4d
24cd0c9
6fc6b1b
d979aa1
d494ec3
f746e96
1eb9354
24d2e75
72dd87a
bcffd84
50a91ba
ad269c4
97c9536
47a512a
d1cf740
ef09a35
de0b54a
994bf6b
b6101a4
5d02a2a
62b20dd
0882c8f
cb3a474
04dfd03
3d6fcb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| name: Build source (CMake) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| build-target: | ||
| description: "Target name as defined by inputs.sh" | ||
| required: true | ||
| type: string | ||
| container-path: | ||
| description: "Path to built container at registry" | ||
| required: true | ||
| type: string | ||
| depends-key: | ||
| description: "Key needed to access cached depends" | ||
| required: true | ||
| type: string | ||
| depends-host: | ||
| description: "Host triplet from depends build" | ||
| required: true | ||
| type: string | ||
| depends-dep-opts: | ||
| description: "DEP_OPTS used to build depends" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| depends-artifact: | ||
| description: "Artifact holding freshly built depends, used if the cache restore misses" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| runs-on: | ||
| description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)" | ||
| required: true | ||
| type: string | ||
|
|
||
| # Builds the tree with CMake on top of the depends prefix produced for the | ||
| # Autotools jobs, which is what makes this a full-stack check: depends emits | ||
| # toolchain.cmake, CMake consumes it, and the unit tests run against the | ||
| # result, followed by a short functional smoke list. The full functional suite | ||
| # stays with the Autotools jobs, so this job does not bundle artifacts. | ||
| jobs: | ||
| build-src-cmake: | ||
| name: Build source (CMake) | ||
| runs-on: ${{ inputs.runs-on }} | ||
| container: | ||
| image: ${{ inputs.container-path }} | ||
| options: --user root | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| allow-unsafe-pr-checkout: true | ||
| persist-credentials: false | ||
| fetch-depth: 50 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Initial setup | ||
| run: | | ||
| git config --global --add safe.directory "$PWD" | ||
| shell: bash | ||
|
|
||
| - name: Restore depends cache | ||
| id: depends-cache | ||
| uses: actions/cache/restore@v5 | ||
| with: | ||
| path: depends/built/${{ inputs.depends-host }} | ||
| key: ${{ inputs.depends-key }} | ||
|
|
||
| - name: Download built depends | ||
| # Same-run handoff from build-depends.yml: pull_request_target runs | ||
| # have read-only cache tokens (GitHub change, June 2026), so freshly | ||
| # built depends arrive as an artifact instead of a cache entry. Also | ||
| # covers trusted runs whose cache save was denied (save only warns). | ||
| if: steps.depends-cache.outputs.cache-hit != 'true' && inputs.depends-artifact != '' | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: ${{ inputs.depends-artifact }} | ||
| path: depends/built/${{ inputs.depends-host }} | ||
|
|
||
| - name: Check built depends are present | ||
| if: steps.depends-cache.outputs.cache-hit != 'true' && inputs.depends-artifact == '' | ||
| run: | | ||
| echo "::error::Depends cache restore missed and no built depends artifact was provided" | ||
| exit 1 | ||
| shell: bash | ||
|
|
||
| - name: Rebuild depends prefix | ||
| run: | | ||
| # Use the HOST and DEP_OPTS from the depends build, not this build-target | ||
| # This ensures the build_id matches the cached packages, and it is what | ||
| # writes depends/${HOST}/toolchain.cmake. | ||
| make -j$(nproc) -C depends HOST="${{ inputs.depends-host }}" ${{ inputs.depends-dep-opts }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| shell: bash | ||
|
|
||
| - name: Restore ccache cache | ||
| uses: actions/cache/restore@v5 | ||
| with: | ||
| path: | | ||
| /cache/ccache | ||
| key: ccache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}-${{ github.sha }} | ||
| restore-keys: | | ||
| ccache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}- | ||
|
|
||
| - name: Build source | ||
| run: | | ||
| CCACHE_MAXSIZE="600M" | ||
| CACHE_DIR="/cache" | ||
| mkdir /output | ||
| BASE_OUTDIR="/output" | ||
| BUILD_TARGET="${{ inputs.build-target }}" | ||
| source ./ci/dash/matrix.sh | ||
| ./ci/dash/build_src_cmake.sh | ||
| ccache -X 9 | ||
| ccache -c | ||
| du -hd0 "${BASE_OUTDIR}" | ||
| shell: bash | ||
|
|
||
| - name: Save ccache cache | ||
| if: | | ||
| github.event_name == 'push' && | ||
| github.ref_name == github.event.repository.default_branch | ||
| uses: actions/cache/save@v5 | ||
| with: | ||
| path: | | ||
| /cache/ccache | ||
| key: ccache-${{ hashFiles('contrib/containers/ci/ci.Dockerfile', 'depends/packages/*') }}-${{ inputs.build-target }}-${{ github.sha }} | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| BUILD_TARGET="${{ inputs.build-target }}" | ||
| source ./ci/dash/matrix.sh | ||
| ./ci/dash/test_unittests_cmake.sh | ||
| shell: bash | ||
|
|
||
| - name: Run functional smoke tests | ||
| run: | | ||
| BUILD_TARGET="${{ inputs.build-target }}" | ||
| source ./ci/dash/matrix.sh | ||
| ./ci/dash/test_integrationtests_cmake.sh | ||
| shell: bash | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,7 @@ jobs: | |
| if: | | ||
| vars.SKIP_LINUX64 == '' || | ||
| vars.SKIP_LINUX64_ASAN == '' || | ||
| vars.SKIP_LINUX64_CMAKE == '' || | ||
| vars.SKIP_LINUX64_FUZZ == '' || | ||
| vars.SKIP_LINUX64_SQLITE == '' | ||
| with: | ||
|
|
@@ -236,6 +237,20 @@ jobs: | |
| depends-artifact: ${{ needs.depends-linux64.outputs.built-artifact }} | ||
| runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} | ||
|
|
||
| src-linux64_cmake: | ||
| name: linux64_cmake-build | ||
| uses: ./.github/workflows/build-src-cmake.yml | ||
| needs: [check-skip, container, depends-linux64] | ||
| if: ${{ vars.SKIP_LINUX64_CMAKE == '' }} | ||
| with: | ||
| build-target: linux64_cmake | ||
| container-path: ${{ needs.container.outputs.path }} | ||
| depends-key: ${{ needs.depends-linux64.outputs.key }} | ||
| depends-host: ${{ needs.depends-linux64.outputs.host }} | ||
| depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }} | ||
| depends-artifact: ${{ needs.depends-linux64.outputs.built-artifact }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the dependency cache misses and the freshly built cache cannot be saved, this input is always empty: the called Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Blocking: Provide the depends artifact output before consuming it This line passes source: ['codex'] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved in this update — Provide the depends artifact output before consuming it no longer present. Auto-resolved by the review system based on the latest commit diff. If you believe this was closed in error, reopen the thread. |
||
| runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} | ||
|
|
||
| src-linux64_fuzz: | ||
| name: linux64_fuzz-build | ||
| uses: ./.github/workflows/build-src.yml | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,11 @@ | |
| todo.txt | ||
| reset-files.bash | ||
|
|
||
| # Build subdirectories. | ||
| /*build* | ||
| !/build-aux | ||
| !/build_msvc | ||
|
|
||
| *.tar.gz | ||
|
|
||
| *.exe | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.