fix AMReXConfig.cmake unquoted variable expansion (real root cause)#265
Merged
jameslehoux merged 1 commit intomasterfrom Apr 29, 2026
Merged
fix AMReXConfig.cmake unquoted variable expansion (real root cause)#265jameslehoux merged 1 commit intomasterfrom
jameslehoux merged 1 commit intomasterfrom
Conversation
Previous "fix" only addressed half the problem. The actual bug is at
AMReXConfig.cmake.in:277:
CUDA_ARCHITECTURES ${AMREX_CUDA_ARCHS})
Note the *unquoted* ${...}. With AMREX_CUDA_ARCHS="75;80" (a CMake list
of two elements), this expands as TWO arguments — set_target_properties
parses them as `CUDA_ARCHITECTURES=75, then property "80" with no value`,
which trips:
CMake Error at AMReXConfig.cmake:289 (set_target_properties):
set_target_properties called with incorrect number of arguments.
AMReX itself uses the QUOTED form internally
(AMReXParallelBackends.cmake:103) but the export template forgot the
quotes — upstream bug. Confirmed locally:
set_target_properties(... CUDA_ARCHITECTURES ${AMREX_CUDA_ARCHS}) → ERROR
set_target_properties(... CUDA_ARCHITECTURES "${AMREX_CUDA_ARCHS}") → OK
Two structural changes:
1. Add a sed that wraps ${AMREX_CUDA_ARCHS} in quotes in the installed
config. Belt for new builds, braces for cached.
2. Move BOTH AMReXConfig patches outside the if/else cache branch.
actions/cache@v4 saves on cache-miss regardless of job outcome, so
the previous failed v9 run could have cached a deps.tar.gz with a
half-fixed config; an else-branch-only patch would skip it on
restore. Now both seds run unconditionally — `if AMReX cache hit:
patch the restored file; else: patch the freshly-installed file`.
Also added a `grep -n 'AMREX_CUDA_ARCHS' ...` after the patches so the
build log shows exactly what the lines look like before configure runs.
Cache key bumped to v10 with -quotefix tag to force a fresh build at
least once with the new sed chain.
https://claude.ai/code/session_011dJ5Bwq4Tnr8wxH597XJFf
Code Coverage ReportGenerated by CI — coverage data from gcovr |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previous "fix" only addressed half the problem. The actual bug is at AMReXConfig.cmake.in:277:
Note the unquoted ${...}. With AMREX_CUDA_ARCHS="75;80" (a CMake list of two elements), this expands as TWO arguments — set_target_properties parses them as
CUDA_ARCHITECTURES=75, then property "80" with no value, which trips:AMReX itself uses the QUOTED form internally
(AMReXParallelBackends.cmake:103) but the export template forgot the quotes — upstream bug. Confirmed locally:
Two structural changes:
Add a sed that wraps ${AMREX_CUDA_ARCHS} in quotes in the installed config. Belt for new builds, braces for cached.
Move BOTH AMReXConfig patches outside the if/else cache branch. actions/cache@v4 saves on cache-miss regardless of job outcome, so the previous failed v9 run could have cached a deps.tar.gz with a half-fixed config; an else-branch-only patch would skip it on restore. Now both seds run unconditionally —
if AMReX cache hit: patch the restored file; else: patch the freshly-installed file.Also added a
grep -n 'AMREX_CUDA_ARCHS' ...after the patches so the build log shows exactly what the lines look like before configure runs.Cache key bumped to v10 with -quotefix tag to force a fresh build at least once with the new sed chain.