Skip to content

Commit 2a74b4c

Browse files
hyperpolymathclaude
andcommitted
fix(chapel-ci): set CHPL_HOME after .deb install to find ChapelSysCTypes
The Chapel 2.3.0 .deb installs the `chpl` binary into /usr/bin (or a symlinked location) but leaves the bundled modules tree under /usr/share/chapel/<minor>/modules. Without CHPL_HOME pointing at that prefix, the typecheck step fails: error: Could not find bundled module 'ChapelSysCTypes' note: Missing ChapelSysCTypes indicates an incomplete build CI's `chapel-build` first run after the 22:30Z fix-pin commit failed on the very first module (LibProven.chpl uses `use CTypes`). Fix: after `apt-get install`, derive CHPL_HOME from `which chpl`'s realpath; if the bundled `modules/` directory is not next to the binary (which is the case when /usr/bin/chpl is the install target), probe the canonical install locations and use whichever has `modules/`. Export via $GITHUB_ENV so downstream steps inherit it. Applied to all 4 Chapel install steps (build / smoke / tests / detachable-build). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 587ffb3 commit 2a74b4c

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/chapel-ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,21 @@ jobs:
167167
echo "$CHAPEL_DEB_SHA256 /tmp/chapel.deb" | sha256sum --check
168168
sudo apt-get update
169169
sudo apt-get install -y /tmp/chapel.deb
170+
# The Chapel .deb installs CHPL_HOME under /usr/share/chapel/<minor>.
171+
# `chpl` reads CHPL_HOME from the env to locate bundled modules
172+
# (ChapelSysCTypes lives there); without it the typecheck step
173+
# fails with "Could not find bundled module 'ChapelSysCTypes'".
174+
CHPL_HOME="$(dirname "$(dirname "$(realpath "$(which chpl)")")")"
175+
# Probe a few canonical install layouts in case the symlink target
176+
# is /usr/bin instead of /usr/share/chapel/<minor>/bin.
177+
if [ ! -d "$CHPL_HOME/modules" ]; then
178+
for cand in /usr/share/chapel/2.3 /usr/share/chapel/2 /usr/lib/chapel/2.3; do
179+
if [ -d "$cand/modules" ]; then CHPL_HOME="$cand"; break; fi
180+
done
181+
fi
182+
echo "CHPL_HOME=$CHPL_HOME" | tee -a "$GITHUB_ENV"
170183
chpl --version
184+
test -d "$CHPL_HOME/modules" || { echo "::error::CHPL_HOME bundled modules not found"; exit 1; }
171185
172186
- name: Chapel module typecheck (--no-codegen, every module)
173187
working-directory: proven/bindings/chapel
@@ -241,6 +255,14 @@ jobs:
241255
echo "$CHAPEL_DEB_SHA256 /tmp/chapel.deb" | sha256sum --check
242256
sudo apt-get update
243257
sudo apt-get install -y /tmp/chapel.deb
258+
CHPL_HOME="$(dirname "$(dirname "$(realpath "$(which chpl)")")")"
259+
if [ ! -d "$CHPL_HOME/modules" ]; then
260+
for cand in /usr/share/chapel/2.3 /usr/share/chapel/2 /usr/lib/chapel/2.3; do
261+
if [ -d "$cand/modules" ]; then CHPL_HOME="$cand"; break; fi
262+
done
263+
fi
264+
echo "CHPL_HOME=$CHPL_HOME" | tee -a "$GITHUB_ENV"
265+
test -d "$CHPL_HOME/modules" || { echo "::error::CHPL_HOME bundled modules not found"; exit 1; }
244266
245267
- name: Install just
246268
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2
@@ -290,6 +312,14 @@ jobs:
290312
echo "$CHAPEL_DEB_SHA256 /tmp/chapel.deb" | sha256sum --check
291313
sudo apt-get update
292314
sudo apt-get install -y /tmp/chapel.deb
315+
CHPL_HOME="$(dirname "$(dirname "$(realpath "$(which chpl)")")")"
316+
if [ ! -d "$CHPL_HOME/modules" ]; then
317+
for cand in /usr/share/chapel/2.3 /usr/share/chapel/2 /usr/lib/chapel/2.3; do
318+
if [ -d "$cand/modules" ]; then CHPL_HOME="$cand"; break; fi
319+
done
320+
fi
321+
echo "CHPL_HOME=$CHPL_HOME" | tee -a "$GITHUB_ENV"
322+
test -d "$CHPL_HOME/modules" || { echo "::error::CHPL_HOME bundled modules not found"; exit 1; }
293323
294324
- name: Install just
295325
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2
@@ -351,6 +381,14 @@ jobs:
351381
echo "$CHAPEL_DEB_SHA256 /tmp/chapel.deb" | sha256sum --check
352382
sudo apt-get update
353383
sudo apt-get install -y /tmp/chapel.deb
384+
CHPL_HOME="$(dirname "$(dirname "$(realpath "$(which chpl)")")")"
385+
if [ ! -d "$CHPL_HOME/modules" ]; then
386+
for cand in /usr/share/chapel/2.3 /usr/share/chapel/2 /usr/lib/chapel/2.3; do
387+
if [ -d "$cand/modules" ]; then CHPL_HOME="$cand"; break; fi
388+
done
389+
fi
390+
echo "CHPL_HOME=$CHPL_HOME" | tee -a "$GITHUB_ENV"
391+
test -d "$CHPL_HOME/modules" || { echo "::error::CHPL_HOME bundled modules not found"; exit 1; }
354392
355393
- name: Install just
356394
uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2

0 commit comments

Comments
 (0)