@@ -58,7 +58,8 @@ export BEAM_INSTALL_ROOT="$tmp_root/install-root"
5858
5959mkdir -p " $HOME " " $BEAM_INSTALL_ROOT "
6060
61- toolchain=" $( awk ' NR==1 {print $1}' lean-toolchain) "
61+ mapfile -t supported_toolchains < <( grep -v ' ^[[:space:]]*#' supported-lean-toolchains | sed ' /^[[:space:]]*$/d' )
62+ toolchain=" ${supported_toolchains[0]} "
6263source_checkout=" $tmp_root /source-checkout"
6364
6465assert_file () {
@@ -117,14 +118,14 @@ assert_runtime_layout() {
117118assert_manifest_metadata () {
118119 local manifest_path=" $1 "
119120 local expected_payload=" $2 "
120- local expected_toolchain =" $3 "
121- local expected_source_commit= " $4 "
122- python3 - " $manifest_path " " $expected_payload " " $expected_toolchain " " $expected_source_commit " << 'PY '
121+ local expected_source_commit =" $3 "
122+ shift 3
123+ python3 - " $manifest_path " " $expected_payload " " $expected_source_commit " " $@ " << 'PY '
123124import json
124125import os
125126import sys
126127
127- manifest_path, expected_payload, expected_toolchain, expected_source_commit = sys.argv[1:]
128+ manifest_path, expected_payload, expected_source_commit, *expected_toolchains = sys.argv[1:]
128129with open(manifest_path, "r", encoding="utf-8") as f:
129130 manifest = json.load(f)
130131layout = json.loads(os.environ["BEAM_INSTALL_LAYOUT_JSON"])
@@ -133,7 +134,7 @@ if manifest.get("schemaVersion") != 2:
133134 raise SystemExit(f"unexpected manifest schemaVersion: {manifest.get('schemaVersion')}")
134135if manifest.get("payloadHash") != expected_payload:
135136 raise SystemExit(f"unexpected manifest payloadHash: {manifest.get('payloadHash')}")
136- if manifest.get("toolchains") != [expected_toolchain] :
137+ if manifest.get("toolchains") != expected_toolchains :
137138 raise SystemExit(f"unexpected manifest toolchains: {manifest.get('toolchains')}")
138139if "toolchain" in manifest:
139140 raise SystemExit(f"unexpected legacy manifest toolchain field: {manifest.get('toolchain')}")
@@ -206,25 +207,42 @@ path_without_elan() {
206207
207208assert_bundle_layout () {
208209 local bundle_root=" $1 "
209- local metadata
210- metadata=" $( find " $bundle_root " -name metadata.json | head -n 1 || true) "
211- if [ -z " $metadata " ]; then
210+ shift
211+ local metadata_files=()
212+ local metadata=" "
213+ local expected_toolchain=" "
214+ local found=" "
215+ mapfile -t metadata_files < <( find " $bundle_root " -name metadata.json | sort)
216+ if [ " ${# metadata_files[@]} " -eq 0 ]; then
212217 echo " missing bundle metadata under $bundle_root " >&2
213218 exit 1
214219 fi
215- if ! rg -n --fixed-strings " \" toolchain\" : \" $toolchain \" " " $metadata " > /dev/null; then
216- echo " bundle metadata does not mention expected toolchain $toolchain : $metadata " >&2
217- exit 1
218- fi
219-
220- local workspace
221- workspace=" $( dirname " $metadata " ) /workspace"
222- assert_file " $workspace /Beam.lean"
223- assert_file " $workspace /Beam/Broker/Server.lean"
224- assert_file " $workspace /RunAt/Internal/SaveArtifacts.lean"
225- assert_file " $workspace /.lake/build/bin/beam-daemon"
226- assert_file " $workspace /.lake/build/bin/beam-client"
227- assert_file " $workspace /.lake/build/lib/librunAt_RunAt.so"
220+ for expected_toolchain in " $@ " ; do
221+ found=" "
222+ for metadata in " ${metadata_files[@]} " ; do
223+ if command -v rg > /dev/null 2>&1 ; then
224+ if rg -n --fixed-strings " \" toolchain\" : \" $expected_toolchain \" " " $metadata " > /dev/null; then
225+ found=" $metadata "
226+ break
227+ fi
228+ elif grep -F " \" toolchain\" : \" $expected_toolchain \" " " $metadata " > /dev/null; then
229+ found=" $metadata "
230+ break
231+ fi
232+ done
233+ if [ -z " $found " ]; then
234+ echo " bundle metadata does not mention expected toolchain $expected_toolchain under $bundle_root " >&2
235+ exit 1
236+ fi
237+ local workspace
238+ workspace=" $( dirname " $found " ) /workspace"
239+ assert_file " $workspace /Beam.lean"
240+ assert_file " $workspace /Beam/Broker/Server.lean"
241+ assert_file " $workspace /RunAt/Internal/SaveArtifacts.lean"
242+ assert_file " $workspace /.lake/build/bin/beam-daemon"
243+ assert_file " $workspace /.lake/build/bin/beam-client"
244+ assert_file " $workspace /.lake/build/lib/librunAt_RunAt.so"
245+ done
228246}
229247
230248rsync -a --exclude=' .git' ./ " $source_checkout " /
@@ -327,20 +345,20 @@ assert_version_count "$BEAM_INSTALL_ROOT/versions" 1
327345installed_version_root=" $( python3 -c ' import os,sys; print(os.path.realpath(sys.argv[1]))' " $installed_runtime_root " ) "
328346installed_payload_id=" $( basename " $installed_version_root " ) "
329347assert_file " $installed_runtime_root /manifest.json"
330- BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $toolchain " " $expected_source_commit "
348+ BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $expected_source_commit " " $toolchain "
331349
332350assert_not_exists " $CODEX_HOME "
333351assert_not_exists " $CLAUDE_HOME "
334- assert_bundle_layout " $BEAM_INSTALL_ROOT /state/install-bundles"
352+ assert_bundle_layout " $BEAM_INSTALL_ROOT /state/install-bundles" " $toolchain "
335353
336354(
337355 cd " $source_checkout "
338356 bash scripts/install-beam.sh --all-supported > /dev/null
339357)
340358
341359assert_version_count " $BEAM_INSTALL_ROOT /versions" 1
342- BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $toolchain " " $expected_source_commit "
343- assert_bundle_layout " $BEAM_INSTALL_ROOT /state/install-bundles"
360+ BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $expected_source_commit " " $toolchain "
361+ assert_bundle_layout " $BEAM_INSTALL_ROOT /state/install-bundles" " ${supported_toolchains[@]} "
344362
345363(
346364 cd " $source_checkout "
@@ -354,7 +372,7 @@ for skills_home in "$CODEX_HOME" "$CLAUDE_HOME"; do
354372 assert_no_skill_socket_guidance " $skills_home /skills/rocq-beam/SKILL.md"
355373done
356374assert_version_count " $BEAM_INSTALL_ROOT /versions" 1
357- BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $toolchain " " $expected_source_commit "
375+ BEAM_INSTALL_LAYOUT_JSON=" $install_layout_json " assert_manifest_metadata " $installed_runtime_root /manifest.json" " $installed_payload_id " " $expected_source_commit " " $toolchain "
358376
359377blocked_home=" $tmp_root /blocked-home"
360378blocked_install_root=" $tmp_root /blocked-install-root"
0 commit comments