Core calculation and linking parameters
Some checks failed
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-debug, Debug Template, no, template_debug) (push) Failing after 22m24s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-release, Release Template, yes, template_release) (push) Has been cancelled
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-editor, Editor, yes, editor) (push) Has been cancelled
Some checks failed
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-debug, Debug Template, no, template_debug) (push) Failing after 22m24s
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-release, Release Template, yes, template_release) (push) Has been cancelled
Build Godot Engine / Build Windows ${{ matrix.name }} (godot-windows-editor, Editor, yes, editor) (push) Has been cancelled
This commit is contained in:
@ -49,18 +49,46 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Compile with SCons
|
||||
# We don't need to install scons/mingw; they are already in the Fedora image!
|
||||
run: |
|
||||
# --- SMART CORE DETECTION ---
|
||||
# Default to hardware limit if no quota is found
|
||||
REAL_CORES=$(nproc)
|
||||
|
||||
# Check Cgroup V2 (Fedora / Modern K8s)
|
||||
if [ -f /sys/fs/cgroup/cpu.max ]; then
|
||||
# Read quota and period (e.g., "700000 100000")
|
||||
read QUOTA PERIOD < /sys/fs/cgroup/cpu.max
|
||||
if [ "$QUOTA" != "max" ]; then
|
||||
# Calculate limit: Quota / Period (e.g., 700000 / 100000 = 7)
|
||||
REAL_CORES=$(( QUOTA / PERIOD ))
|
||||
fi
|
||||
|
||||
# Check Cgroup V1 (Older K8s / Docker)
|
||||
elif [ -f /sys/fs/cgroup/cpu/cpu.cfs_quota_us ]; then
|
||||
QUOTA=$(cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us)
|
||||
PERIOD=$(cat /sys/fs/cgroup/cpu/cpu.cfs_period_us)
|
||||
if [ "$QUOTA" -gt 0 ]; then
|
||||
REAL_CORES=$(( QUOTA / PERIOD ))
|
||||
fi
|
||||
fi
|
||||
|
||||
# Safety: Ensure we use at least 1 core
|
||||
if [ "$REAL_CORES" -lt 1 ]; then REAL_CORES=1; fi
|
||||
|
||||
echo "Hardware has $(nproc) cores. Container limit is ${REAL_CORES} cores."
|
||||
# -----------------------------
|
||||
|
||||
echo "Compiling ${{ matrix.name }}..."
|
||||
|
||||
# Godot 4 SCons Command
|
||||
scons platform=windows \
|
||||
nice -n 10 scons platform=windows \
|
||||
target=${{ matrix.target }} \
|
||||
d3d12=no \
|
||||
arch=x86_64 \
|
||||
precision=double \
|
||||
production=${{ matrix.production }} \
|
||||
-j$(nproc)
|
||||
LINKFLAGS="-lhid -lsetupapi" \
|
||||
-j$REAL_CORES
|
||||
|
||||
- name: Verify Output
|
||||
run: ls -l bin/
|
||||
|
||||
Reference in New Issue
Block a user