Repository navigation
COMP: Fail the build on an undeclared external function #92
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: master
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -70,3 +70,121 @@ jobs: | |
| # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
| run: ctest --build-config ${{ matrix.build_type }} | ||
|
|
||
| minimal: | ||
| # The configuration a downstream project vendoring only the core | ||
| # reader selects. Nothing else in the matrix proves the tree still | ||
| # configures with the optional subdirectories switched off. | ||
| name: minimal configuration (znzlib + niftilib only) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Configure CMake | ||
| run: > | ||
| cmake -B ${{ github.workspace }}/build | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| -DUSE_NIFTI2_CODE=OFF | ||
| -DUSE_NIFTICDF_CODE=OFF | ||
| -DUSE_CIFTI_CODE=OFF | ||
| -DUSE_FSL_CODE=OFF | ||
| -DNIFTI_BUILD_APPLICATIONS=OFF | ||
| -S ${{ github.workspace }} | ||
| - name: Build | ||
| run: cmake --build ${{ github.workspace }}/build | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| # This configuration registers no tests at all, because the test | ||
| # programs live with the applications that are switched off here. | ||
| # --no-tests=ignore keeps that from being an error; the value of | ||
| # this job is that the tree still configures and builds. | ||
| run: ctest --output-on-failure --no-tests=ignore | ||
|
|
||
| oldest-cmake: | ||
| # Guards cmake_minimum_required. Every other runner carries a | ||
| # recent CMake, so a policy or command that needs a newer release | ||
| # than the project claims to support is invisible to them. | ||
| # PR #30 was exactly that: CMP0169 does not exist before 3.30 and | ||
|
Collaborator
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. I wouldn't refer to PRs in the code comments, could be confusing vs upsteam vs the ITK fork.
Member
Author
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. |
||
| # setting it unconditionally was fatal on Ubuntu 24.04's 3.28. | ||
| name: oldest supported CMake | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y cmake ninja-build libexpat1-dev zlib1g-dev | ||
| - name: Show CMake version | ||
| run: cmake --version | ||
| - name: Configure CMake | ||
| run: > | ||
| cmake -G Ninja -B ${{ github.workspace }}/build | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| -DUSE_CIFTI_CODE=ON | ||
| -DUSE_FSL_CODE=ON | ||
| -S ${{ github.workspace }} | ||
| - name: Build | ||
| run: cmake --build ${{ github.workspace }}/build | ||
| - name: Test | ||
| working-directory: ${{ github.workspace }}/build | ||
| run: ctest --output-on-failure | ||
|
|
||
| exported-symbols: | ||
| # The exported symbol set is the ABI. Several open changes assert | ||
| # that they leave it untouched and nothing verified that claim, so | ||
| # this job diffs it against a committed baseline. An intentional | ||
| # change to the ABI updates the baseline in the same commit, which | ||
| # makes the change visible in review rather than implicit. | ||
| name: exported symbol baseline | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y libexpat1-dev zlib1g-dev ninja-build | ||
| - name: Configure CMake | ||
| run: > | ||
| cmake -G Ninja -B ${{ github.workspace }}/build | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| -DBUILD_SHARED_LIBS=ON | ||
| -DUSE_CIFTI_CODE=ON | ||
| -DUSE_FSL_CODE=ON | ||
| -S ${{ github.workspace }} | ||
| - name: Build | ||
| run: cmake --build ${{ github.workspace }}/build | ||
| - name: Collect exported symbols | ||
| run: | | ||
| bash cmake/collect_exported_symbols.sh \ | ||
|
Collaborator
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. [Google Carbon]
Member
Author
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. |
||
| "${{ github.workspace }}/build" \ | ||
| /tmp/exported_symbols.txt | ||
| - name: Compare against the committed baseline | ||
| run: | | ||
| if ! diff -u cmake/exported_symbols_linux.txt /tmp/exported_symbols.txt; then | ||
| echo "" | ||
| echo "The exported symbol set changed." | ||
| echo "If that is intended, update cmake/exported_symbols_linux.txt" | ||
| echo "in this commit so the ABI change is visible in review:" | ||
| echo " bash cmake/collect_exported_symbols.sh <build-dir> cmake/exported_symbols_linux.txt" | ||
| exit 1 | ||
| fi | ||
| echo "Exported symbols match the baseline." | ||
|
|
||
| missing-declarations: | ||
| # Clang checks C functions only under -Wmissing-prototypes; GCC under both. | ||
| name: no undeclared external functions (FSLSTYLE=${{ matrix.fslstyle }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| fslstyle: ["OFF", "ON"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y libexpat1-dev zlib1g-dev ninja-build | ||
| - name: Configure CMake | ||
| run: > | ||
| cmake -G Ninja -B ${{ github.workspace }}/build | ||
| -DCMAKE_BUILD_TYPE=Release | ||
| "-DCMAKE_C_FLAGS=-Werror=missing-declarations -Werror=missing-prototypes" | ||
| -DNIFTI_BUILD_APPLICATIONS=ON | ||
| -DUSE_CIFTI_CODE=ON | ||
| -DUSE_FSL_CODE=ON | ||
| -DFSLSTYLE=${{ matrix.fslstyle }} | ||
| -S ${{ github.workspace }} | ||
| - name: Build | ||
| run: cmake --build ${{ github.workspace }}/build | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I need more coffee but I just don't grok these words...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hunk is a copy of #89's
minimaljob, where the comment now reads "The core-reader-only configuration a vendoring project selects." The copy leaves this PR when it is rebased after #89 merges.