File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Prints where `mcpp::out_dir()` pointed for the root package in the newest
3+ # build of the package in the current directory: its `outDir` in
4+ # resolution.json. Each configuration has its own output directory, so a check
5+ # reads it instead of naming target/.build-mcpp/out.
6+ r=$( ls -t target/* /* /resolution.json 2> /dev/null | head -1)
7+ [ -n " $r " ] || { echo " out_dir.sh: no resolution.json under target/" >&2 ; exit 1; }
8+ py=$( command -v python3 || command -v python)
9+ d=$( " $py " -c ' import json, sys
10+ for p in json.load(open(sys.argv[1])).get("graph", {}).get("packages", []):
11+ if p.get("root"):
12+ print(p.get("outDir", ""))
13+ break' " $r " )
14+ [ -n " $d " ] || { echo " out_dir.sh: $r records no outDir for the root package" >&2 ; exit 1; }
15+ echo " $d "
Original file line number Diff line number Diff line change @@ -349,8 +349,8 @@ jobs:
349349 # THE SHADERS ARE THE FIRST ASSERTION, and both of them: a rule that
350350 # compiled only the first source would leave the second header absent
351351 # and everything after this would still pass.
352+ d="$(sh "$GITHUB_WORKSPACE/.github/tools/out_dir.sh")/spirv"
352353 for f in triangle_vert triangle_frag; do
353- d="target/.build-mcpp/out/spirv"
354354 test -f "$d/$f.h" || { echo "missing $d/$f.h"; exit 1; }
355355 # Either file: which of the two carries the words is a property of
356356 # the shader compiler the rule chose, not of the shader. See the
Original file line number Diff line number Diff line change @@ -374,8 +374,8 @@ jobs:
374374 # a neighbouring step happened to select makes this step's subject
375375 # depend on step order, which is not a property anybody reads.
376376 "/tmp/mcpp-fresh" build --toolchain "llvm@${MCPP_LLVM_VER}"
377+ d="$(sh "$GITHUB_WORKSPACE/.github/tools/out_dir.sh")/spirv"
377378 for f in triangle_vert triangle_frag; do
378- d="target/.build-mcpp/out/spirv"
379379 test -f "$d/$f.h" || { echo "missing $d/$f.h"; exit 1; }
380380 # THE MAGIC IS NOT ALWAYS IN THE HEADER, AND THAT IS THE POINT OF
381381 # THIS JOB. The rule chooses the shader compiler this platform
Original file line number Diff line number Diff line change @@ -432,8 +432,8 @@ jobs:
432432 # a neighbouring step happened to select makes this step's subject
433433 # depend on step order, which is not a property anybody reads.
434434 "$MCPP_SELF" build --toolchain "llvm@23.1.3"
435+ d="$(sh "$GITHUB_WORKSPACE/.github/tools/out_dir.sh")/spirv"
435436 for f in triangle_vert triangle_frag; do
436- d="target/.build-mcpp/out/spirv"
437437 test -f "$d/$f.h" || { echo "missing $d/$f.h"; exit 1; }
438438 # THE MAGIC IS NOT ALWAYS IN THE HEADER, AND THAT IS THE POINT OF
439439 # THIS JOB. The rule chooses the shader compiler this platform
You can’t perform that action at this time.
0 commit comments