-
Notifications
You must be signed in to change notification settings - Fork 4
Align macOS CI with container build: derive configuration at runtime #96
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
Changes from all commits
3e79e6a
adfc3d0
a82b16e
68a7cd3
2cd3d9e
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 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,48 +32,80 @@ jobs: | |||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| submodules: recursive | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Extract Spack configuration | ||||||||||||||||||||||||||||
| id: spack-config | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| # Source spack.sh to get SPACK_VERSION and SPACK_CHERRYPICKS | ||||||||||||||||||||||||||||
| source spack.sh | ||||||||||||||||||||||||||||
| echo "spack-version=${SPACK_VERSION}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "spack-cherrypicks<<EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "${SPACK_CHERRYPICKS}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Source spack-packages.sh to get SPACKPACKAGES_VERSION and SPACKPACKAGES_CHERRYPICKS | ||||||||||||||||||||||||||||
| source spack-packages.sh | ||||||||||||||||||||||||||||
| echo "spackpackages-version=${SPACKPACKAGES_VERSION}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "spackpackages-cherrypicks<<EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "${SPACKPACKAGES_CHERRYPICKS}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
| echo "EOF" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Extract buildcache URL from mirrors.yaml.in (simplified - get the version) | ||||||||||||||||||||||||||||
| echo "buildcache-version=${SPACKPACKAGES_VERSION}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Setup Spack | ||||||||||||||||||||||||||||
| uses: spack/setup-spack@v2.1.1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| ref: develop | ||||||||||||||||||||||||||||
| ref: ${{ steps.spack-config.outputs.spack-version }} | ||||||||||||||||||||||||||||
| color: true | ||||||||||||||||||||||||||||
| path: ${{ github.workspace }}/spack | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Apply Spack cherry-picks | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cd ${{ github.workspace }}/spack | ||||||||||||||||||||||||||||
| git config user.name "GitHub Actions" | ||||||||||||||||||||||||||||
| git config user.email "actions@github.com" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Apply cherry-picks from spack.sh (match only valid git commit hashes) | ||||||||||||||||||||||||||||
| echo "${{ steps.spack-config.outputs.spack-cherrypicks }}" | grep -E '^[a-f0-9]{40}$' | while read -r commit; do | ||||||||||||||||||||||||||||
| echo "Cherry-picking ${commit}" | ||||||||||||||||||||||||||||
| git cherry-pick "${commit}" | ||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||
|
Comment on lines
+69
to
+72
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Checkout and configure spack-packages | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| cd ${{ github.workspace }}/spack | ||||||||||||||||||||||||||||
| git clone https://github.com/spack/spack-packages.git var/spack/repos/spack-packages | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| cd var/spack/repos/spack-packages | ||||||||||||||||||||||||||||
| git checkout ${{ steps.spack-config.outputs.spackpackages-version }} | ||||||||||||||||||||||||||||
| git config user.name "GitHub Actions" | ||||||||||||||||||||||||||||
| git config user.email "actions@github.com" | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Apply cherry-picks from spack-packages.sh (match only valid git commit hashes) | ||||||||||||||||||||||||||||
| echo "${{ steps.spack-config.outputs.spackpackages-cherrypicks }}" | grep -E '^[a-f0-9]{40}$' | while read -r commit; do | ||||||||||||||||||||||||||||
| echo "Cherry-picking ${commit}" | ||||||||||||||||||||||||||||
| git cherry-pick "${commit}" | ||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||
|
Comment on lines
+84
to
+87
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| - name: Register spack-packages repository | |
| run: | |
Copilot
AI
Dec 19, 2025
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.
The spack repo add command could fail if the repository path is invalid or if there are configuration issues. This would prevent the workflow from proceeding correctly but wouldn't be immediately obvious from the error message. Consider adding error context or verification that the repository was successfully added.
| spack repo add var/spack/repos/spack-packages | |
| if ! spack repo add var/spack/repos/spack-packages; then | |
| echo "ERROR: Failed to add Spack repository 'var/spack/repos/spack-packages'." >&2 | |
| echo "Current Spack repositories:" >&2 | |
| spack repo list >&2 || true | |
| exit 1 | |
| fi | |
| # Verify that the repository was successfully registered | |
| if ! spack repo list | grep -q 'var/spack/repos/spack-packages'; then | |
| echo "ERROR: Spack repository 'var/spack/repos/spack-packages' does not appear in 'spack repo list' after adding." >&2 | |
| spack repo list >&2 || true | |
| exit 1 | |
| fi |
Copilot
AI
Dec 19, 2025
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.
The spack external find llvm command is added without the --not-buildable flag, unlike cmake. This means spack may still attempt to build llvm from source if the external installation doesn't meet requirements. Based on the PR description mentioning "Find llvm externally in addition to cmake, matching container build strategy", consider whether --not-buildable should also be applied to llvm to enforce using only the external installation.
| spack -e ci external find llvm | |
| spack -e ci external find --not-buildable llvm |
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.
The grep pattern
'^[a-f0-9]{40}$'will silently filter out invalid lines including the heredoc delimiters (---) and any malformed commit hashes. While this provides robustness, it also means that if the configuration files are accidentally corrupted or contain invalid data, the workflow will silently skip those entries without warning. Consider adding a validation step that warns if any lines are filtered out, or explicitly count and verify the expected number of cherry-picks were applied.