@@ -397,30 +397,68 @@ jobs:
397397 run : |
398398 set -e
399399 echo "▶ macOS depends build starting…"
400-
401400 export V=1
402401
403- # Keep runner alive
402+ # Prevent timeout
404403 ( while true; do echo "❤️ still building mac depends…"; sleep 60; done ) &
405404
406- TOOLCHAIN_DIR="$(pwd)/depends/x86_64-apple-darwin11/native/bin"
405+ echo "▶ Scanning depends/ for Darwin toolchain…"
406+ echo "----------------------------------------"
407+
408+ find depends -maxdepth 5 -type f \( -name "clang" -o -name "clang++" -o -name "*-ar" -o -name "*-ranlib" \) -print || true
409+
410+ echo "----------------------------------------"
411+ echo "▶ Auto-detecting REAL clang toolchain…"
412+
413+ # Try all known possible toolchain install paths
414+ CANDIDATES=(
415+ "depends/x86_64-apple-darwin11/native/bin"
416+ "depends/native/bin"
417+ "depends/*/native/bin"
418+ "depends/*/*/bin"
419+ "depends/*/toolchain/bin"
420+ "depends/work/build/*/native_cctools/*/toolchain/bin"
421+ )
422+
423+ REAL_TC=""
424+
425+ for DIR in "${CANDIDATES[@]}"; do
426+ MATCH=$(ls -d $DIR 2>/dev/null || true)
427+ if [ -n "$MATCH" ]; then
428+ if [ -f "$MATCH/clang" ]; then
429+ REAL_TC="$MATCH"
430+ break
431+ fi
432+ fi
433+ done
434+
435+ if [ -z "$REAL_TC" ]; then
436+ echo "❌ FAILED TO FIND DARWIN TOOLCHAIN"
437+ echo "Dumping directory structure for debugging:"
438+ find depends -maxdepth 4 | sed 's/^/ /'
439+ exit 1
440+ fi
407441
408- echo "▶ Using Darwin toolchain from : $TOOLCHAIN_DIR "
409- ls -l "$TOOLCHAIN_DIR "
442+ echo "✅ Found Darwin toolchain at : $REAL_TC "
443+ ls -l "$REAL_TC "
410444
411- export PATH="$TOOLCHAIN_DIR:$PATH"
445+ # Export compilers
446+ export PATH="$REAL_TC:$PATH"
447+ export CC="$REAL_TC/clang"
448+ export CXX="$REAL_TC/clang++"
412449
413- # FORCE depends to use the correct Darwin toolchain compiler
414- export CC="$TOOLCHAIN_DIR/clang"
415- export CXX="$TOOLCHAIN_DIR/clang++"
416- export AR="$TOOLCHAIN_DIR/x86_64-apple-darwin11-ar"
417- export RANLIB="$TOOLCHAIN_DIR/x86_64-apple-darwin11-ranlib"
418- export STRIP="$TOOLCHAIN_DIR/x86_64-apple-darwin11-strip"
450+ # Also setup binutils
451+ export AR=$(ls "$REAL_TC"/*-ar | head -n1)
452+ export RANLIB=$(ls "$REAL_TC"/*-ranlib | head -n1)
453+ export STRIP=$(ls "$REAL_TC"/*-strip | head -n1)
419454
420- echo "▶ CC = $CC"
421- echo "▶ CXX = $CXX"
455+ echo "▶ Using CC=$CC"
456+ echo "▶ Using CXX=$CXX"
457+ echo "▶ Using AR=$AR"
458+ echo "▶ Using RANLIB=$RANLIB"
459+ echo "▶ Using STRIP=$STRIP"
422460
423- echo "▶ Building macOS depends…"
461+ echo "▶ Building macOS depends with HOST=x86_64-apple-darwin11 …"
424462 make $MAKEJOBS -C depends HOST=x86_64-apple-darwin11
425463
426464 - name : Build AdventureCoin
0 commit comments