Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/actions/setup-demo-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
- name: Set up Python 3.12 on Windows
if: runner.os == 'Windows'
id: windows_python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
# LLVM 19.1.3's MSVC LLDB embeds the 3.12.7 hosted-tool-cache prefix.
# A newer 3.12 patch is ABI-compatible, but LLDB combines its embedded
Expand All @@ -34,7 +34,7 @@ runs:
- name: Set up target Python 3.12 on Windows
if: runner.os == 'Windows' && inputs.windows-arch != 'amd64'
id: windows_target_python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
# The target library ABI is stable across Python 3.12 patch releases.
# Reuse the runner's native architecture build when available instead
Expand All @@ -46,7 +46,7 @@ runs:
- name: Set up LLDB Python 3.10 on Windows 386
if: runner.os == 'Windows' && inputs.windows-arch == '386'
id: windows_lldb_python_386
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
# LLVM's official 19.1.7 Win32 LLDB links python310.dll. Keep this
# debugger runtime separate from the target Python 3.12 demo library.
Expand All @@ -57,7 +57,7 @@ runs:
- name: Set up LLDB Python 3.11 on Windows ARM64
if: runner.os == 'Windows' && inputs.windows-arch == 'arm64'
id: windows_lldb_python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
# LLVM's official 19.1.7 Windows-on-Arm LLDB links python311.dll.
# 3.11.9 is the final ARM64 artifact in actions/python-versions.
Expand Down
69 changes: 37 additions & 32 deletions .github/actions/setup-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ runs:
- name: Cache full-target Windows LLVM
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc'
id: windows_llvm_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}\llgo-llvm\LLVM-19.1.3-Windows-X64
key: llgo-llvm-19.1.3-full-target-windows-x64-1077267ca353a1e236055ed4b57d6a404d09c40b01bd27dc882870395cdc1aae
# Configuration later installs the selected compiler-rt builtins into
# this tree, so each target architecture must own an immutable cache.
key: llgo-llvm-19.1.3-full-target-windows-${{ inputs.windows-arch }}-1077267ca353a1e236055ed4b57d6a404d09c40b01bd27dc882870395cdc1aae

- name: Install full-target Windows LLVM
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc' && steps.windows_llvm_cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -98,17 +100,10 @@ runs:
Move-Item -LiteralPath $extractedRoot.FullName -Destination $installRoot
Remove-Item -LiteralPath $archive, $tar.FullName

- name: Save full-target Windows LLVM
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc' && steps.windows_llvm_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}\llgo-llvm\LLVM-19.1.3-Windows-X64
key: llgo-llvm-19.1.3-full-target-windows-x64-1077267ca353a1e236055ed4b57d6a404d09c40b01bd27dc882870395cdc1aae

- name: Cache target-native Windows LLVM support
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-arch != 'amd64'
id: windows_target_llvm_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}\llgo-compiler-rt\19.1.7\${{ inputs.windows-arch }}
key: ${{ inputs.windows-arch == 'arm64' && 'llgo-compiler-rt-19.1.7-windows-arm64-08d871c9a20caf0987ede1a4e44d489e28854c9f2fff3da98b486891f4856e05-native-lldb-v1' || 'llgo-compiler-rt-19.1.7-windows-386-3d7044fa307d3183e4ee2a98e12dd0523ced58f1d1c95c5e057694fb75beb51a-native-lldb-v1' }}
Expand Down Expand Up @@ -180,17 +175,10 @@ runs:
}
}

- name: Save target-native Windows LLVM support
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-arch != 'amd64' && steps.windows_target_llvm_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}\llgo-compiler-rt\19.1.7\${{ inputs.windows-arch }}
key: ${{ inputs.windows-arch == 'arm64' && 'llgo-compiler-rt-19.1.7-windows-arm64-08d871c9a20caf0987ede1a4e44d489e28854c9f2fff3da98b486891f4856e05-native-lldb-v1' || 'llgo-compiler-rt-19.1.7-windows-386-3d7044fa307d3183e4ee2a98e12dd0523ced58f1d1c95c5e057694fb75beb51a-native-lldb-v1' }}

- name: Cache Windows MSVC dependencies
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc'
id: windows_vcpkg_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}\llgo-vcpkg\${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}
key: llgo-vcpkg-${{ inputs.windows-arch }}-windows-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}
Expand Down Expand Up @@ -235,13 +223,6 @@ runs:
throw "Installing vcpkg dependencies failed with exit code $LASTEXITCODE"
}

- name: Save Windows MSVC dependencies
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc' && steps.windows_vcpkg_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}\llgo-vcpkg\${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}
key: llgo-vcpkg-${{ inputs.windows-arch }}-windows-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}

- name: Configure standalone Windows LLVM, SDK, and dependencies
if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc'
shell: pwsh
Expand Down Expand Up @@ -684,14 +665,36 @@ runs:
llvm-version: ${{ inputs.llvm-version }}
windows-arch: ${{ inputs.windows-arch }}

- name: Refresh Homebrew metadata on Apple Silicon
if: runner.os == 'macOS' && runner.arch == 'ARM64'
shell: bash
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew update

- name: Install macOS dependencies
if: runner.os == 'macOS'
shell: bash
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew update

# Intel macOS is a Homebrew Tier 3 configuration and newly published
# formulae may have no Intel bottle. Keep its runner-image metadata and
# installed formulae; Apple Silicon refreshes metadata in the step above.
brew_install_missing() {
local formula
local missing=()
for formula in "$@"; do
if ! brew list --versions "${formula}" >/dev/null; then
missing+=("${formula}")
fi
done
if (( ${#missing[@]} > 0 )); then
brew install "${missing[@]}"
fi
}

# Install LLVM if requested
if [[ "${{ inputs.install-llvm }}" == "true" ]]; then
llvm_formula="llvm@${{inputs.llvm-version}}"
Expand All @@ -709,7 +712,7 @@ runs:
esac
done < <(brew list --formula)

brew install "${llvm_formula}" "${lld_formula}"
brew_install_missing "${llvm_formula}" "${lld_formula}"
brew link --force --overwrite "${llvm_formula}" "${lld_formula}"
llvm_bin="$(brew --prefix "${llvm_formula}")/bin"
lld_bin="$(brew --prefix "${lld_formula}")/bin"
Expand All @@ -726,7 +729,7 @@ runs:
fi

# Install common dependencies
brew install bdw-gc openssl libffi libuv
brew_install_missing bdw-gc openssl libffi libuv
brew link --overwrite libffi

# Install optional deps for demos.
Expand All @@ -736,10 +739,12 @@ runs:
cjson # for github.com/goplus/lib/c/cjson
sqlite # for github.com/goplus/lib/c/sqlite
)
brew install "${opt_deps[@]}"
brew_install_missing "${opt_deps[@]}"

brew install python@3.12 || true # for github.com/goplus/lib/py
brew link --overwrite python@3.12
# Python is optional and is used only by github.com/goplus/lib/py.
if brew_install_missing python@3.12; then
brew link --overwrite python@3.12 || true
fi

- name: Install Ubuntu dependencies
if: runner.os == 'Linux'
Expand Down
30 changes: 25 additions & 5 deletions .github/actions/setup-embed-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@ description: "Install dependencies required for embedded QEMU tests"
runs:
using: "composite"
steps:
- name: Refresh Homebrew metadata on Apple Silicon
if: runner.os == 'macOS' && runner.arch == 'ARM64'
shell: bash
env:
HOMEBREW_NO_AUTO_UPDATE: 1
run: brew update

- name: Install macOS embedded dependencies
if: runner.os == 'macOS'
shell: bash
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
run: |
brew update
brew install sdl2
# Preserve runner-provided packages on Intel, where Homebrew no longer
# guarantees bottles. Apple Silicon refreshes metadata in the step above.
brew list --versions sdl2 >/dev/null || brew install sdl2

- name: Install Ubuntu embedded dependencies
if: runner.os == 'Linux'
Expand All @@ -20,13 +29,24 @@ runs:
sudo apt-get update
sudo apt-get install -y libsdl2-2.0-0 libslirp0

- name: Cache ESP QEMU toolchains
id: esp_qemu_cache
uses: actions/cache@v6
with:
path: .cache/qemu
key: esp-qemu-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.github/workflows/install-esp-qemu.sh') }}

- name: Install ESP QEMU toolchains
if: steps.esp_qemu_cache.outputs.cache-hit != 'true'
shell: bash
run: |
chmod +x .github/workflows/install-esp-qemu.sh
QEMU_DIR=".cache/qemu"
.github/workflows/install-esp-qemu.sh "$QEMU_DIR"
qemu_bin="${PWD}/${QEMU_DIR}/bin"
.github/workflows/install-esp-qemu.sh .cache/qemu

- name: Add ESP QEMU to PATH
shell: bash
run: |
qemu_bin="${PWD}/.cache/qemu/bin"
if [[ "$RUNNER_OS" == Windows ]]; then
# Git Bash understands /d/... paths, but LLGo launches QEMU through
# Windows CreateProcess and therefore needs a native path.
Expand Down
12 changes: 3 additions & 9 deletions .github/actions/setup-goreleaser/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,23 @@ runs:
uses: ./.github/actions/setup-go
- name: Restore Linux sysroot cache
id: cache-linux-sysroot
uses: actions/cache/restore@v5
uses: actions/cache/restore@v6
with:
path: .sysroot/linux.tar.gz
key: ${{ inputs.linux-cache-key }}
- name: Populate Linux sysroot
run: tar -xzvf .sysroot/linux.tar.gz -C .sysroot
shell: bash
- name: Restore ESP Clang cache
- name: Cache ESP Clang
id: cache-esp-clang
uses: actions/cache/restore@v5
uses: actions/cache@v6
with:
path: ${{ inputs.esp-clang-cache-path }}
key: esp-clang-${{ hashFiles('.github/workflows/download_esp_clang.sh') }}
- name: Download ESP Clang (if cache miss)
if: steps.cache-esp-clang.outputs.cache-hit != 'true'
run: bash .github/workflows/download_esp_clang.sh
shell: bash
- name: Save ESP Clang cache
if: steps.cache-esp-clang.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ${{ inputs.esp-clang-cache-path }}
key: esp-clang-${{ hashFiles('.github/workflows/download_esp_clang.sh') }}
- name: Check file
run: tree .sysroot
shell: bash
44 changes: 8 additions & 36 deletions .github/actions/setup-llvm-mingw/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ runs:
;;
esac

- name: Restore llvm-mingw
- name: Cache llvm-mingw
if: runner.os == 'Windows'
id: llvm_mingw_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}\llvm-mingw\20250114\ucrt-x86_64
key: llvm-mingw-20250114-ucrt-x86_64-9395d95c089611e6cd728c9a07219ffc5ac706e0c719833a2f7e64a706a81541
Expand Down Expand Up @@ -80,17 +80,10 @@ runs:
}
Move-Item -LiteralPath $source.FullName -Destination $installRoot

- name: Save llvm-mingw
if: runner.os == 'Windows' && steps.llvm_mingw_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}\llvm-mingw\20250114\ucrt-x86_64
key: llvm-mingw-20250114-ucrt-x86_64-9395d95c089611e6cd728c9a07219ffc5ac706e0c719833a2f7e64a706a81541

- name: Restore llvm-mingw target dependencies
- name: Cache llvm-mingw target dependencies
if: runner.os == 'Windows'
id: llvm_mingw_vcpkg_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}\llgo-mingw-vcpkg\${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}\386
key: llgo-llvm-mingw-20250114-ucrt-386-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}
Expand Down Expand Up @@ -132,13 +125,6 @@ runs:
throw "Installing llvm-mingw 386 dependencies failed with exit code $LASTEXITCODE"
}

- name: Save llvm-mingw target dependencies
if: runner.os == 'Windows' && steps.llvm_mingw_vcpkg_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}\llgo-mingw-vcpkg\${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}\386
key: llgo-llvm-mingw-20250114-ucrt-386-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}

- name: Configure llvm-mingw target
if: runner.os == 'Windows'
shell: pwsh
Expand Down Expand Up @@ -232,10 +218,10 @@ runs:
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_MINGW_TARGET_TRIPLE=i686-w64-windows-gnu"
Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_MINGW_TARGET_VCPKG_ROOT=$vcpkgRoot"

- name: Restore cross-host llvm-mingw
- name: Cache cross-host llvm-mingw
if: runner.os != 'Windows' && env.LLGO_MINGW_CROSS_ROOT == ''
id: cross_host_llvm_mingw_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}/llvm-mingw/20250114/ucrt-${{ runner.os }}-${{ runner.arch }}
key: llvm-mingw-20250114-ucrt-${{ runner.os }}-${{ runner.arch }}-${{ runner.os == 'macOS' && '80b2e7ade71ba2dfe9e8d27fe47ae5738b1fb8d34e057faa2beef3070392f2d6' || 'a16f52dee819797248e6c7d63b8b1e50a92119f45767ecd8e9633d1733b896e2' }}
Expand Down Expand Up @@ -284,17 +270,10 @@ runs:
fi
mv "$source_root" "$install_root"

- name: Save cross-host llvm-mingw
if: runner.os != 'Windows' && env.LLGO_MINGW_CROSS_ROOT == '' && steps.cross_host_llvm_mingw_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}/llvm-mingw/20250114/ucrt-${{ runner.os }}-${{ runner.arch }}
key: llvm-mingw-20250114-ucrt-${{ runner.os }}-${{ runner.arch }}-${{ runner.os == 'macOS' && '80b2e7ade71ba2dfe9e8d27fe47ae5738b1fb8d34e057faa2beef3070392f2d6' || 'a16f52dee819797248e6c7d63b8b1e50a92119f45767ecd8e9633d1733b896e2' }}

- name: Restore cross-host target dependencies
- name: Cache cross-host target dependencies
if: runner.os != 'Windows'
id: cross_host_vcpkg_cache
uses: actions/cache/restore@v4
uses: actions/cache@v6
with:
path: ${{ runner.tool_cache }}/llgo-mingw-vcpkg/${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}/${{ runner.os }}-${{ runner.arch }}/${{ inputs.windows-arch }}
key: llgo-llvm-mingw-20250114-ucrt-${{ runner.os }}-${{ runner.arch }}-${{ inputs.windows-arch }}-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}
Expand Down Expand Up @@ -342,13 +321,6 @@ runs:
"--x-install-root=$install_root" \
--clean-after-build

- name: Save cross-host target dependencies
if: runner.os != 'Windows' && steps.cross_host_vcpkg_cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}/llgo-mingw-vcpkg/${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}/${{ runner.os }}-${{ runner.arch }}/${{ inputs.windows-arch }}
key: llgo-llvm-mingw-20250114-ucrt-${{ runner.os }}-${{ runner.arch }}-${{ inputs.windows-arch }}-${{ hashFiles('.github/windows/vcpkg/vcpkg.json') }}

- name: Configure cross-host llvm-mingw target
if: runner.os != 'Windows'
shell: bash
Expand Down
Loading
Loading