-
Notifications
You must be signed in to change notification settings - Fork 21
add install check #649
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
Closed
Closed
add install check #649
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
748d26d
add headers to CMakeLists.txt
buechlerm 3041cd9
Fix type
buechlerm f349ac8
Add a changelog entry
buechlerm fa20636
add install check
jonahm-LANL 40a7446
changelog
jonahm-LANL 569ecbc
Merge branch 'buechler/missed_headers' into jmm/check-installs
jonahm-LANL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,3 +52,5 @@ jobs: | |
| make -j4 | ||
| make install | ||
| ctest --output-on-failure | ||
| cd .. | ||
| bash ./utils/scripts/check_installs.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,3 +37,5 @@ jobs: | |
| make -j4 | ||
| make install | ||
| ctest --output-on-failure | ||
| cd .. | ||
| bash ./utils/scripts/check_installs.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,3 +37,5 @@ jobs: | |
| make -j4 | ||
| make install | ||
| ctest --output-on-failure | ||
| cd .. | ||
| bash ./utils/scripts/check_installs.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/bin/bash | ||
|
|
||
| #------------------------------------------------------------------------------ | ||
| # © 2021-2026. Triad National Security, LLC. All rights reserved. This | ||
| # program was produced under U.S. Government contract 89233218CNA000001 | ||
| # for Los Alamos National Laboratory (LANL), which is operated by Triad | ||
| # National Security, LLC for the U.S. Department of Energy/National | ||
| # Nuclear Security Administration. All rights in the program are | ||
| # reserved by Triad National Security, LLC, and the U.S. Department of | ||
| # Energy/National Nuclear Security Administration. The Government is | ||
| # granted for itself and others acting on its behalf a nonexclusive, | ||
| # paid-up, irrevocable worldwide license in this material to reproduce, | ||
| # prepare derivative works, distribute copies to the public, perform | ||
| # publicly and display publicly, and to permit others to do so. | ||
| #------------------------------------------------------------------------------ | ||
|
|
||
| # This file generated with the assistance of generative AI | ||
|
|
||
| # Report singularity-eos headers that are missing install logic. | ||
| # | ||
| # Every .hpp under singularity-eos/ is meant to be installed, which means it | ||
| # must appear as an argument to a register_headers(...) call in some | ||
| # CMakeLists.txt (see cmake/plugins.cmake). A header that is never registered | ||
| # is silently left out of the install. This script flags any such header so | ||
| # it can be wired into CI as a guard (non-zero exit when any are found). | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # Move to the repo root (two levels up from utils/scripts/). | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" | ||
| cd "${REPO_ROOT}" | ||
|
|
||
| # Directory whose headers must all be installed. | ||
| HEADER_ROOT="singularity-eos" | ||
|
|
||
| # Collect the text of every CMakeLists.txt so we can search registrations. | ||
| CMAKE_FILES=$(find . -name CMakeLists.txt -not -path './build/*' -not -path './.git/*') | ||
|
|
||
| missing=0 | ||
| for f in $(find "${HEADER_ROOT}" -name '*.hpp' | sed "s|^${HEADER_ROOT}/||" | sort); do | ||
| base=$(basename "$f") | ||
| # A header is considered registered if either its path relative to the | ||
| # header root, or just its file name, appears in a CMakeLists.txt. The | ||
| # register_headers() paths are relative to the calling CMakeLists.txt, so | ||
| # matching on the basename keeps this robust without re-implementing | ||
| # CMake's path resolution. | ||
| if ! grep -rqF "$f" ${CMAKE_FILES} && ! grep -rqF "$base" ${CMAKE_FILES}; then | ||
| if [ "$missing" -eq 0 ]; then | ||
| echo "Headers missing register_headers() install logic:" | ||
| fi | ||
| echo " ${HEADER_ROOT}/$f" | ||
| missing=$((missing + 1)) | ||
| fi | ||
| done | ||
|
|
||
| if [ "$missing" -eq 0 ]; then | ||
| echo "OK: every ${HEADER_ROOT} header has register_headers() install logic." | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "${missing} header(s) have no register_headers call." | ||
| echo "Add each to a register_headers(...) call in the appropriate CMakeLists.txt" | ||
| echo "(with the matching build condition if it is only needed under an option)," | ||
| echo "or exclude it deliberately." | ||
| exit 1 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Doesn't matter much but this literal is actually 2^-52. Had dropped one degree of precision somehow.