From 35e9ffe31e2cc7477cb3e4d7e628b34aa140a931 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 14:34:17 +0800 Subject: [PATCH 01/15] ci:remove macos llvm download when release --- .github/actions/setup-goreleaser/action.yml | 11 - .github/workflows/doc.yml | 179 ----------- .github/workflows/fmt.yml | 37 --- .github/workflows/go.yml | 61 ---- .github/workflows/llgo.yml | 299 ------------------- .github/workflows/populate_darwin_sysroot.sh | 40 --- .github/workflows/release-build.yml | 36 +-- .github/workflows/targets.yml | 47 --- 8 files changed, 2 insertions(+), 708 deletions(-) delete mode 100644 .github/workflows/doc.yml delete mode 100644 .github/workflows/fmt.yml delete mode 100644 .github/workflows/go.yml delete mode 100644 .github/workflows/llgo.yml delete mode 100755 .github/workflows/populate_darwin_sysroot.sh delete mode 100644 .github/workflows/targets.yml diff --git a/.github/actions/setup-goreleaser/action.yml b/.github/actions/setup-goreleaser/action.yml index 644388db..19bb308c 100644 --- a/.github/actions/setup-goreleaser/action.yml +++ b/.github/actions/setup-goreleaser/action.yml @@ -1,9 +1,6 @@ name: "Setup GoReleaser" description: "Setup GoReleaser environment" inputs: - darwin-cache-key: - description: "Darwin sysroot cache key" - required: true linux-cache-key: description: "Linux sysroot cache key" required: true @@ -14,20 +11,12 @@ runs: uses: actions/setup-go@v5 with: go-version: 1.24.x - - name: Restore Darwin sysroot cache - id: cache-darwin-sysroot - uses: actions/cache/restore@v4 - with: - path: .sysroot/darwin.tar.gz - key: ${{ inputs.darwin-cache-key }} - name: Restore Linux sysroot cache id: cache-linux-sysroot uses: actions/cache/restore@v4 with: path: .sysroot/linux.tar.gz key: ${{ inputs.linux-cache-key }} - - name: Populate Darwin sysroot - run: tar -xzvf .sysroot/darwin.tar.gz -C .sysroot shell: bash - name: Populate Linux sysroot run: tar -xzvf .sysroot/linux.tar.gz -C .sysroot diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml deleted file mode 100644 index 6b4ec81c..00000000 --- a/.github/workflows/doc.yml +++ /dev/null @@ -1,179 +0,0 @@ -name: Docs - -on: - push: - branches: - - "**" - - "!dependabot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - doc_verify: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v5 - - - name: Set up Node.js - uses: actions/setup-node@v5 - with: - node-version: "20" - - - name: Install embedme - run: npm install -g embedme - - - name: Verify README.md embedded code - run: embedme --verify README.md - - - name: Link Checker - id: lychee - uses: lycheeverse/lychee-action@v2 - with: - args: --max-concurrency 3 --retry-wait-time 15 README.md - - remote_install: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh - - local_install: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.23" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - - - name: Install llgo with tools - run: | - set -e - set -x - git() { - if [ "$1" = "clone" ]; then - # do nothing because we already have the branch - cd .. - else - command git "$@" - fi - } - source doc/_readme/scripts/install_llgo.sh - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh - - local_install_full: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - - name: Set up Go - uses: actions/setup-go@v6 - with: - go-version: "1.23" - - - name: Install dependencies on macOS - if: startsWith(matrix.os, 'macos') - run: | - set -e - set -x - source doc/_readme/scripts/install_macos.sh - - - name: Install dependencies on Ubuntu - if: startsWith(matrix.os, 'ubuntu') - run: | - set -e - set -x - source doc/_readme/scripts/install_ubuntu.sh - echo "PATH=/usr/lib/llvm-19/bin:$PATH" >> $GITHUB_ENV - - - name: Install llgo with tools - run: | - set -e - set -x - git() { - if [ "$1" = "clone" ]; then - # do nothing because we already have the branch - cd .. - else - command git "$@" - fi - } - source doc/_readme/scripts/install_full.sh - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test doc code blocks - run: | - set -e - set -x - source doc/_readme/scripts/run.sh diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml deleted file mode 100644 index b29aa066..00000000 --- a/.github/workflows/fmt.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Format Check - -on: - push: - branches: - - "**" - - "!dependabot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - fmt: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@v5 - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Check formatting - run: | - for dir in . runtime; do - pushd $dir - if [ -n "$(go fmt ./... | grep -v xgo_autogen.go)" ]; then - echo "Some files are not properly formatted. Please run 'go fmt ./...'" - exit 1 - fi - popd - done - echo "All files are properly formatted." diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index df6ff534..00000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Go - -on: - push: - branches: - - "**" - - "!dependabot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - test: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Clang information - run: | - echo $PATH - which clang - clang --version - - - name: Set up Go - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Build - run: go build -v ./... - - - name: Test - if: ${{!startsWith(matrix.os, 'macos')}} - run: go test ./... - - - name: Test with coverage - if: startsWith(matrix.os, 'macos') - run: go test -coverprofile="coverage.txt" -covermode=atomic ./... - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{secrets.CODECOV_TOKEN}} diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml deleted file mode 100644 index 56d1b905..00000000 --- a/.github/workflows/llgo.yml +++ /dev/null @@ -1,299 +0,0 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: LLGo - -on: - push: - branches: - - "**" - - "!dependabot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - download-model: - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - name: Download model file - run: | - mkdir -p ./_demo/c/llama2-c - wget -P ./_demo/c/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin - - - name: Upload model as artifact - uses: actions/upload-artifact@v4 - with: - name: llama2-model - path: ./_demo/c/llama2-c/stories15M.bin - retention-days: 1 - - llgo: - needs: download-model - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - llvm: [19] - go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - name: Download model artifact - uses: actions/download-artifact@v5 - with: - name: llama2-model - path: ./_demo/c/llama2-c/ - - name: Download platform-specific demo libs - run: | - if ${{ startsWith(matrix.os, 'macos') }}; then - DEMO_PKG="cargs_darwin_arm64.zip" - else - DEMO_PKG="cargs_linux_amd64.zip" - fi - - mkdir -p ./_demo/c/cargs/libs - cd ./_demo/c/cargs/libs - wget https://github.com/goplus/llpkg/releases/download/cargs/v1.0.0/${DEMO_PKG} - unzip ${DEMO_PKG} - - # Process pc template files - replace {{.Prefix}} with actual path - ACTUAL_PREFIX="$(pwd)" - for tmpl in lib/pkgconfig/*.pc.tmpl; do - pc_file="${tmpl%.tmpl}" - sed "s|{{.Prefix}}|${ACTUAL_PREFIX}|g" "$tmpl" > "$pc_file" - done - - echo "PKG_CONFIG_PATH=${ACTUAL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV - - name: Install further optional dependencies for demos - run: | - py_deps=( - numpy # for github.com/goplus/lib/py/numpy - torch # for github.com/goplus/lib/py/torch - ) - pip3.12 install --break-system-packages "${py_deps[@]}" - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: actions/setup-go@v6 - with: - go-version: ${{matrix.go}} - - - name: Test demo without RPATH (expect failure) - run: | - echo "Testing demo without RPATH (should fail)..." - export LLGO_FULL_RPATH=false - pkg-config --libs cargs - if (cd ./_demo/c/cargs && llgo run .); then - echo "ERROR: cargs demo should have failed without RPATH!" - exit 1 - else - echo "✓ cargs demo correctly failed without RPATH" - fi - - - name: Test demos - run: | - # TODO(lijie): force python3-embed to be linked with python-3.12-embed - # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch - # Will remove this after pytorch is fixed. - pcdir=$HOME/pc - mkdir -p $pcdir - libdir=$(pkg-config --variable=libdir python-3.12-embed) - echo "libdir: $libdir" - ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc - export PKG_CONFIG_PATH=$pcdir:${PKG_CONFIG_PATH} - export LLGO_FULL_RPATH=true - bash .github/workflows/test_demo.sh - - - name: Test C header generation - run: | - echo "Testing C header generation in different build modes..." - cd _demo/go/export - chmod +x test.sh - ./test.sh - - - name: _xtool build tests - run: | - cd _xtool - llgo build -v ./... - - - name: Show test result - run: cat result.md - - - name: LLDB tests - if: ${{startsWith(matrix.os, 'macos')}} - run: | - echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}" - bash _lldb/runtest.sh -v - - test: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - llvm: [19] - go: ["1.24.2"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - name: Install further optional dependencies for demos - run: | - py_deps=( - numpy # for github.com/goplus/lib/py/numpy - torch # for github.com/goplus/lib/py/torch - ) - pip3.12 install --break-system-packages "${py_deps[@]}" - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: actions/setup-go@v6 - with: - go-version: ${{matrix.go}} - - - name: run llgo test - run: | - llgo test ./... - - hello: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: [ubuntu-24.04, macos-latest] - llvm: [19] - go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go 1.23 for building llgo - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install llgo - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Set up Go for testing - uses: ./.github/actions/setup-go - with: - go-version: ${{matrix.go}} - - - name: Test Hello World with go.mod 1.21 - if: startsWith(matrix.go, '1.21') || startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.21" - - - name: Test Hello World with go.mod 1.22 - if: startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.22" - - - name: Test Hello World with go.mod 1.23 - if: startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.23" - - - name: Test Hello World with go.mod 1.24 - if: startsWith(matrix.go, '1.24') - uses: ./.github/actions/test-helloworld - with: - go-version: ${{matrix.go}} - mod-version: "1.24" - - cross-compile: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: [macos-latest] - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go for building llgo - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install wamr - run: | - git clone https://github.com/bytecodealliance/wasm-micro-runtime.git - mkdir wasm-micro-runtime/product-mini/platforms/darwin/build - cd wasm-micro-runtime/product-mini/platforms/darwin/build - cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 .. - make -j8 - echo "$PWD" >> $GITHUB_PATH - - - name: Install llgo - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Test Cross Compilation (wasm) - shell: bash - working-directory: _demo/c - run: | - echo "Testing cross-compilation wasm with Go 1.24.2" - - # Compile for wasm architecture - GOOS=wasip1 GOARCH=wasm llgo build -o hello -tags=nogc -v ./helloc - - # Check file type - file hello.wasm - - # Run the wasm binary using llgo_wasm - iwasm --stack-size=819200000 --heap-size=800000000 hello.wasm diff --git a/.github/workflows/populate_darwin_sysroot.sh b/.github/workflows/populate_darwin_sysroot.sh deleted file mode 100755 index f0eaaab4..00000000 --- a/.github/workflows/populate_darwin_sysroot.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -set -e - -TMPDIR="$(mktemp -d)" -export TMPDIR -trap 'rm -rf "${TMPDIR}"' EXIT - -DARWIN_AMD64_LLVM_PREFIX=.sysroot/darwin/amd64/usr/local/opt/llvm@19 -DARWIN_ARM64_LLVM_PREFIX=.sysroot/darwin/arm64/opt/homebrew/opt/llvm@19 -mkdir -p "${DARWIN_AMD64_LLVM_PREFIX}" "${DARWIN_ARM64_LLVM_PREFIX}" - -BREW_LLVM_FORMULA_JSON="$(mktemp)" -curl -fsSL https://formulae.brew.sh/api/formula/llvm@19.json > "${BREW_LLVM_FORMULA_JSON}" -BREW_LLVM_AMD64_BOTTLE_URL=$(jq -r '.bottle.stable.files.sonoma.url' "${BREW_LLVM_FORMULA_JSON}") -BREW_LLVM_ARM64_BOTTLE_URL=$(jq -r '.bottle.stable.files.arm64_sonoma.url' "${BREW_LLVM_FORMULA_JSON}") -curl -fsSL -H "Authorization: Bearer QQ==" "${BREW_LLVM_AMD64_BOTTLE_URL}" | tar -xzf - --strip-components=2 -C "${DARWIN_AMD64_LLVM_PREFIX}" -curl -fsSL -H "Authorization: Bearer QQ==" "${BREW_LLVM_ARM64_BOTTLE_URL}" | tar -xzf - --strip-components=2 -C "${DARWIN_ARM64_LLVM_PREFIX}" - -patch_homebrew_lib_dir() { - local LIB_DIR="$1" - local HOMEBREW_PREFIX="$2" - for DYLIB_FILE in "${LIB_DIR}"/*.dylib; do - if [[ -f "${DYLIB_FILE}" ]]; then - ID=$(otool -D "${DYLIB_FILE}" | grep '@@HOMEBREW_PREFIX@@' | awk '{print $1}') - if [[ -n "${ID}" ]]; then - NEW_ID=${ID/'@@HOMEBREW_PREFIX@@'/${HOMEBREW_PREFIX}} - install_name_tool -id "${NEW_ID}" "${DYLIB_FILE}" - fi - - DEPS=$(otool -L "${DYLIB_FILE}" | grep '@@HOMEBREW_PREFIX@@' | awk '{print $1}') - for DEP in ${DEPS}; do - NEW_DEP=${DEP/'@@HOMEBREW_PREFIX@@'/${HOMEBREW_PREFIX}} - install_name_tool -change "${DEP}" "${NEW_DEP}" "${DYLIB_FILE}" - done - fi - done -} -patch_homebrew_lib_dir "${DARWIN_AMD64_LLVM_PREFIX}/lib" /usr/lib -patch_homebrew_lib_dir "${DARWIN_ARM64_LLVM_PREFIX}/lib" /opt/homebrew diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 15c64c53..8aa98321 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -15,7 +15,6 @@ jobs: setup: runs-on: ubuntu-latest outputs: - darwin-cache-key: ${{ steps.cache-keys.outputs.darwin-key }} linux-cache-key: ${{ steps.cache-keys.outputs.linux-key }} steps: - name: Check out code @@ -23,36 +22,8 @@ jobs: - name: Calculate cache keys id: cache-keys run: | - DARWIN_KEY="darwin-sysroot-${{ hashFiles('.github/workflows/populate_darwin_sysroot.sh', '.github/workflows/release-build.yml') }}-v1.0.0" LINUX_KEY="linux-sysroot-${{ hashFiles('.github/workflows/populate_linux_sysroot.sh', '.github/workflows/release-build.yml') }}-v1.0.0" - echo "darwin-key=$DARWIN_KEY" >> $GITHUB_OUTPUT echo "linux-key=$LINUX_KEY" >> $GITHUB_OUTPUT - populate-darwin-sysroot: - runs-on: macos-latest - timeout-minutes: 30 - needs: setup - steps: - - name: Check out code - uses: actions/checkout@v5 - - name: Check Darwin sysroot cache - id: cache-darwin-sysroot - uses: actions/cache/restore@v4 - with: - path: .sysroot/darwin.tar.gz - key: ${{ needs.setup.outputs.darwin-cache-key }} - lookup-only: true - - name: Populate Darwin sysroot - if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true' - run: bash .github/workflows/populate_darwin_sysroot.sh - - name: Create Darwin sysroot tarball - if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true' - run: tar -czvf .sysroot/darwin.tar.gz -C .sysroot darwin - - name: Save Darwin sysroot cache - if: steps.cache-darwin-sysroot.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: .sysroot/darwin.tar.gz - key: ${{ needs.setup.outputs.darwin-cache-key }} populate-linux-sysroot: runs-on: ubuntu-latest needs: setup @@ -86,14 +57,13 @@ jobs: key: ${{ needs.setup.outputs.linux-cache-key }} build: runs-on: ubuntu-latest - needs: [setup, populate-darwin-sysroot, populate-linux-sysroot] + needs: [setup, populate-linux-sysroot] steps: - name: Check out code uses: actions/checkout@v5 - name: Set up Release uses: ./.github/actions/setup-goreleaser with: - darwin-cache-key: ${{ needs.setup.outputs.darwin-cache-key }} linux-cache-key: ${{ needs.setup.outputs.linux-cache-key }} - name: Run GoReleaser (Build & Test) env: @@ -206,8 +176,7 @@ jobs: mod-version: ${{ matrix.go-mod-version }} release: - needs: - [setup, test-artifacts, populate-darwin-sysroot, populate-linux-sysroot] + needs: [setup, test-artifacts, populate-linux-sysroot] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: @@ -218,7 +187,6 @@ jobs: - name: Set up Release uses: ./.github/actions/setup-goreleaser with: - darwin-cache-key: ${{ needs.setup.outputs.darwin-cache-key }} linux-cache-key: ${{ needs.setup.outputs.linux-cache-key }} - name: Run GoReleaser (Release) env: diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml deleted file mode 100644 index 0da8acb0..00000000 --- a/.github/workflows/targets.yml +++ /dev/null @@ -1,47 +0,0 @@ - -name: Targets - -on: - push: - branches: - - "**" - - "!dependabot/**" - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - llgo: - continue-on-error: true - timeout-minutes: 30 - strategy: - matrix: - os: - - macos-latest - - ubuntu-24.04 - llvm: [19] - runs-on: ${{matrix.os}} - steps: - - uses: actions/checkout@v5 - - name: Install dependencies - uses: ./.github/actions/setup-deps - with: - llvm-version: ${{matrix.llvm}} - - - name: Set up Go for build - uses: ./.github/actions/setup-go - with: - go-version: "1.24.2" - - - name: Install - run: | - go install ./... - echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV - - - name: Build targets - run: | - cd _demo/embed/targetsbuild - bash build.sh From 21e7d62c7d28f8a5af87070039a68b0f0b9b5423 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 14:46:00 +0800 Subject: [PATCH 02/15] ci:rm unuse shell decl --- .github/actions/setup-goreleaser/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/setup-goreleaser/action.yml b/.github/actions/setup-goreleaser/action.yml index 19bb308c..f8f5cef8 100644 --- a/.github/actions/setup-goreleaser/action.yml +++ b/.github/actions/setup-goreleaser/action.yml @@ -17,7 +17,6 @@ runs: with: path: .sysroot/linux.tar.gz key: ${{ inputs.linux-cache-key }} - shell: bash - name: Populate Linux sysroot run: tar -xzvf .sysroot/linux.tar.gz -C .sysroot shell: bash From bb8e81fb9bb7e2d3dab5596bae8c1c54c208280e Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 15:02:00 +0800 Subject: [PATCH 03/15] ci:rm linux llvm download --- .github/workflows/populate_linux_sysroot.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index b41d3252..52212862 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -22,7 +22,6 @@ apt-get install -y lsb-release gnupg2 wget rsync echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - apt-get update -apt-get install -y llvm-19-dev error() { echo -e "\$1" >&2 From 7180f203667620623e4404fc4c9182d678aa851c Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 15:24:21 +0800 Subject: [PATCH 04/15] ci:build-essential --- .github/workflows/populate_linux_sysroot.sh | 1 + .goreleaser.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index 52212862..85a1c873 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -18,6 +18,7 @@ export DEBIAN_FRONTEND=noninteractive apt-get update apt-get install -y lsb-release gnupg2 wget rsync +apt-get install -y build-essential echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - diff --git a/.goreleaser.yaml b/.goreleaser.yaml index bbd0104c..79a2f801 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -55,12 +55,12 @@ builds: ldflags: - -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}} - -X github.com/goplus/llgo/internal/env.buildTime={{.Date}} - - '-extldflags=-Wl,-rpath,$ORIGIN/../crosscompile/clang/lib' + - "-extldflags=-Wl,-rpath,$ORIGIN/../crosscompile/clang/lib" env: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 + - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -73,12 +73,12 @@ builds: ldflags: - -X github.com/goplus/llgo/internal/env.buildVersion=v{{.Version}} - -X github.com/goplus/llgo/internal/env.buildTime={{.Date}} - - '-extldflags=-Wl,-rpath,$ORIGIN/../crosscompile/clang/lib' + - "-extldflags=-Wl,-rpath,$ORIGIN/../crosscompile/clang/lib" env: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 + - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From f34ccc1b0cfbf0c104211fe1d10ad6f5dea05299 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 15:36:52 +0800 Subject: [PATCH 05/15] ci:zlib --- .github/workflows/populate_linux_sysroot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index 85a1c873..b2cead2a 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -17,8 +17,8 @@ cat > "${POPULATE_LINUX_SYSROOT_SCRIPT}" << EOF export DEBIAN_FRONTEND=noninteractive apt-get update +apt-get install -y build-essential zlib1g-dev apt-get install -y lsb-release gnupg2 wget rsync -apt-get install -y build-essential echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - From 1811ca12206ba835ec76c0a91f31c976839e46b0 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 15:51:14 +0800 Subject: [PATCH 06/15] ci:-z --- .github/workflows/populate_linux_sysroot.sh | 2 +- .goreleaser.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index b2cead2a..0f3c1e74 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -17,7 +17,7 @@ cat > "${POPULATE_LINUX_SYSROOT_SCRIPT}" << EOF export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y build-essential zlib1g-dev +apt-get install -y build-essential apt-get install -y lsb-release gnupg2 wget rsync echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 79a2f801..b1e7744a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -60,7 +60,7 @@ builds: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 + - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -78,7 +78,7 @@ builds: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 + - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From c24506b7e921a3c8fc04f4fa330acea3f0e77e7a Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 16:05:20 +0800 Subject: [PATCH 07/15] ci:reset sysroot set --- .goreleaser.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b1e7744a..76683301 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -59,8 +59,8 @@ builds: env: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -77,8 +77,8 @@ builds: env: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - - CGO_CPPFLAGS=-I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=-L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From bcadacdf2121676845b8d99f1fb8e5a8ca8a870c Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 16:55:00 +0800 Subject: [PATCH 08/15] gorelease:target triple --- .goreleaser.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 76683301..512049f2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -59,8 +59,8 @@ builds: env: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--target=x86_64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--target=x86_64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -77,8 +77,8 @@ builds: env: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--target=aarch64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--target=aarch64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From 215bba24726a953a43b2131d422fa35ce40f9c7d Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 17:02:14 +0800 Subject: [PATCH 09/15] gorelease:search /usr/lib/arch --- .goreleaser.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 512049f2..60599964 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -59,8 +59,8 @@ builds: env: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - - CGO_CPPFLAGS=--target=x86_64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--target=x86_64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_AMD64}}/usr/lib/x86_64-linux-gnu -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -77,8 +77,8 @@ builds: env: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - - CGO_CPPFLAGS=--target=aarch64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--target=aarch64-linux-gnu --sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -lLLVM-19 -lz + - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_ARM64}}/usr/lib/aarch64-linux-gnu -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From 5f3c1e2de3499585f755d0c5c4072c3915ed46ca Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 17:21:37 +0800 Subject: [PATCH 10/15] gorelease:/usr/lib/arch -> /lib/arch --- .goreleaser.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 60599964..04ec7ce1 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -60,7 +60,7 @@ builds: - CC=x86_64-linux-gnu-gcc - CXX=x86_64-linux-gnu-g++ - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -I{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_AMD64}}/usr/lib/x86_64-linux-gnu -lLLVM-19 -lz + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_AMD64}} -L{{.Env.SYSROOT_LINUX_AMD64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_AMD64}}/lib/x86_64-linux-gnu -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_amd64 @@ -78,7 +78,7 @@ builds: - CC=aarch64-linux-gnu-gcc - CXX=aarch64-linux-gnu-g++ - CGO_CPPFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -I{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS - - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_ARM64}}/usr/lib/aarch64-linux-gnu -lLLVM-19 -lz + - CGO_LDFLAGS=--sysroot={{.Env.SYSROOT_LINUX_ARM64}} -L{{.Env.SYSROOT_LINUX_ARM64}}/crosscompile/clang/lib -L{{.Env.SYSROOT_LINUX_ARM64}}/lib/aarch64-linux-gnu -lLLVM-19 -lz - CGO_LDFLAGS_ALLOW=--sysroot.* targets: - linux_arm64 From 5e6501642d82009544dddfb79cc0ba69341181fe Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 17:35:02 +0800 Subject: [PATCH 11/15] release:instal zlib --- .github/workflows/populate_linux_sysroot.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index 0f3c1e74..13bf502b 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -17,7 +17,7 @@ cat > "${POPULATE_LINUX_SYSROOT_SCRIPT}" << EOF export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y build-essential +apt-get install -y build-essential zlib1g-dev apt-get install -y lsb-release gnupg2 wget rsync echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list @@ -123,6 +123,12 @@ do-sync() { exit \$? } +# Create missing symlinks for development libraries +ln -sf libz.so.1 /lib/x86_64-linux-gnu/libz.so 2>/dev/null || true +ln -sf libz.so.1 /usr/lib/x86_64-linux-gnu/libz.so 2>/dev/null || true +ln -sf libz.so.1 /lib/aarch64-linux-gnu/libz.so 2>/dev/null || true +ln -sf libz.so.1 /usr/lib/aarch64-linux-gnu/libz.so 2>/dev/null || true + do-sync / /sysroot/ EOF chmod +x "${POPULATE_LINUX_SYSROOT_SCRIPT}" From dc587f684d6d61ed4fe19d5ae61839c49ac65f45 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 18:22:21 +0800 Subject: [PATCH 12/15] ci:restore yml --- .github/workflows/doc.yml | 179 ++++++++++++++++++++ .github/workflows/fmt.yml | 37 +++++ .github/workflows/go.yml | 61 +++++++ .github/workflows/llgo.yml | 299 ++++++++++++++++++++++++++++++++++ .github/workflows/targets.yml | 47 ++++++ 5 files changed, 623 insertions(+) create mode 100644 .github/workflows/doc.yml create mode 100644 .github/workflows/fmt.yml create mode 100644 .github/workflows/go.yml create mode 100644 .github/workflows/llgo.yml create mode 100644 .github/workflows/targets.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 00000000..6b4ec81c --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,179 @@ +name: Docs + +on: + push: + branches: + - "**" + - "!dependabot/**" + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + doc_verify: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v5 + + - name: Set up Node.js + uses: actions/setup-node@v5 + with: + node-version: "20" + + - name: Install embedme + run: npm install -g embedme + + - name: Verify README.md embedded code + run: embedme --verify README.md + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + args: --max-concurrency 3 --retry-wait-time 15 README.md + + remote_install: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install dependencies on macOS + if: startsWith(matrix.os, 'macos') + run: | + set -e + set -x + source doc/_readme/scripts/install_macos.sh + + - name: Install dependencies on Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + set -e + set -x + source doc/_readme/scripts/install_ubuntu.sh + + - name: Test doc code blocks + run: | + set -e + set -x + source doc/_readme/scripts/run.sh + + local_install: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.23" + + - name: Install dependencies on macOS + if: startsWith(matrix.os, 'macos') + run: | + set -e + set -x + source doc/_readme/scripts/install_macos.sh + + - name: Install dependencies on Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + set -e + set -x + source doc/_readme/scripts/install_ubuntu.sh + + - name: Install llgo with tools + run: | + set -e + set -x + git() { + if [ "$1" = "clone" ]; then + # do nothing because we already have the branch + cd .. + else + command git "$@" + fi + } + source doc/_readme/scripts/install_llgo.sh + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Test doc code blocks + run: | + set -e + set -x + source doc/_readme/scripts/run.sh + + local_install_full: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.23" + + - name: Install dependencies on macOS + if: startsWith(matrix.os, 'macos') + run: | + set -e + set -x + source doc/_readme/scripts/install_macos.sh + + - name: Install dependencies on Ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + set -e + set -x + source doc/_readme/scripts/install_ubuntu.sh + echo "PATH=/usr/lib/llvm-19/bin:$PATH" >> $GITHUB_ENV + + - name: Install llgo with tools + run: | + set -e + set -x + git() { + if [ "$1" = "clone" ]; then + # do nothing because we already have the branch + cd .. + else + command git "$@" + fi + } + source doc/_readme/scripts/install_full.sh + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Test doc code blocks + run: | + set -e + set -x + source doc/_readme/scripts/run.sh diff --git a/.github/workflows/fmt.yml b/.github/workflows/fmt.yml new file mode 100644 index 00000000..b29aa066 --- /dev/null +++ b/.github/workflows/fmt.yml @@ -0,0 +1,37 @@ +name: Format Check + +on: + push: + branches: + - "**" + - "!dependabot/**" + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + fmt: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Check formatting + run: | + for dir in . runtime; do + pushd $dir + if [ -n "$(go fmt ./... | grep -v xgo_autogen.go)" ]; then + echo "Some files are not properly formatted. Please run 'go fmt ./...'" + exit 1 + fi + popd + done + echo "All files are properly formatted." diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..df6ff534 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,61 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: + - "**" + - "!dependabot/**" + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + llvm: [19] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + + - name: Clang information + run: | + echo $PATH + which clang + clang --version + + - name: Set up Go + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Build + run: go build -v ./... + + - name: Test + if: ${{!startsWith(matrix.os, 'macos')}} + run: go test ./... + + - name: Test with coverage + if: startsWith(matrix.os, 'macos') + run: go test -coverprofile="coverage.txt" -covermode=atomic ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{secrets.CODECOV_TOKEN}} diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml new file mode 100644 index 00000000..56d1b905 --- /dev/null +++ b/.github/workflows/llgo.yml @@ -0,0 +1,299 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: LLGo + +on: + push: + branches: + - "**" + - "!dependabot/**" + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + download-model: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Download model file + run: | + mkdir -p ./_demo/c/llama2-c + wget -P ./_demo/c/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin + + - name: Upload model as artifact + uses: actions/upload-artifact@v4 + with: + name: llama2-model + path: ./_demo/c/llama2-c/stories15M.bin + retention-days: 1 + + llgo: + needs: download-model + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + llvm: [19] + go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + - name: Download model artifact + uses: actions/download-artifact@v5 + with: + name: llama2-model + path: ./_demo/c/llama2-c/ + - name: Download platform-specific demo libs + run: | + if ${{ startsWith(matrix.os, 'macos') }}; then + DEMO_PKG="cargs_darwin_arm64.zip" + else + DEMO_PKG="cargs_linux_amd64.zip" + fi + + mkdir -p ./_demo/c/cargs/libs + cd ./_demo/c/cargs/libs + wget https://github.com/goplus/llpkg/releases/download/cargs/v1.0.0/${DEMO_PKG} + unzip ${DEMO_PKG} + + # Process pc template files - replace {{.Prefix}} with actual path + ACTUAL_PREFIX="$(pwd)" + for tmpl in lib/pkgconfig/*.pc.tmpl; do + pc_file="${tmpl%.tmpl}" + sed "s|{{.Prefix}}|${ACTUAL_PREFIX}|g" "$tmpl" > "$pc_file" + done + + echo "PKG_CONFIG_PATH=${ACTUAL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV + - name: Install further optional dependencies for demos + run: | + py_deps=( + numpy # for github.com/goplus/lib/py/numpy + torch # for github.com/goplus/lib/py/torch + ) + pip3.12 install --break-system-packages "${py_deps[@]}" + + - name: Set up Go for build + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install + run: | + go install ./... + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Set up Go for testing + uses: actions/setup-go@v6 + with: + go-version: ${{matrix.go}} + + - name: Test demo without RPATH (expect failure) + run: | + echo "Testing demo without RPATH (should fail)..." + export LLGO_FULL_RPATH=false + pkg-config --libs cargs + if (cd ./_demo/c/cargs && llgo run .); then + echo "ERROR: cargs demo should have failed without RPATH!" + exit 1 + else + echo "✓ cargs demo correctly failed without RPATH" + fi + + - name: Test demos + run: | + # TODO(lijie): force python3-embed to be linked with python-3.12-embed + # Currently, python3-embed is python-3.13-embed, doesn't work with pytorch + # Will remove this after pytorch is fixed. + pcdir=$HOME/pc + mkdir -p $pcdir + libdir=$(pkg-config --variable=libdir python-3.12-embed) + echo "libdir: $libdir" + ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc + export PKG_CONFIG_PATH=$pcdir:${PKG_CONFIG_PATH} + export LLGO_FULL_RPATH=true + bash .github/workflows/test_demo.sh + + - name: Test C header generation + run: | + echo "Testing C header generation in different build modes..." + cd _demo/go/export + chmod +x test.sh + ./test.sh + + - name: _xtool build tests + run: | + cd _xtool + llgo build -v ./... + + - name: Show test result + run: cat result.md + + - name: LLDB tests + if: ${{startsWith(matrix.os, 'macos')}} + run: | + echo "Test lldb with llgo plugin on ${{matrix.os}} with LLVM ${{matrix.llvm}}" + bash _lldb/runtest.sh -v + + test: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + llvm: [19] + go: ["1.24.2"] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + - name: Install further optional dependencies for demos + run: | + py_deps=( + numpy # for github.com/goplus/lib/py/numpy + torch # for github.com/goplus/lib/py/torch + ) + pip3.12 install --break-system-packages "${py_deps[@]}" + + - name: Set up Go for build + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install + run: | + go install ./... + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Set up Go for testing + uses: actions/setup-go@v6 + with: + go-version: ${{matrix.go}} + + - name: run llgo test + run: | + llgo test ./... + + hello: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: [ubuntu-24.04, macos-latest] + llvm: [19] + go: ["1.21.13", "1.22.12", "1.23.6", "1.24.2"] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + + - name: Set up Go 1.23 for building llgo + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install llgo + run: | + go install ./... + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Set up Go for testing + uses: ./.github/actions/setup-go + with: + go-version: ${{matrix.go}} + + - name: Test Hello World with go.mod 1.21 + if: startsWith(matrix.go, '1.21') || startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') + uses: ./.github/actions/test-helloworld + with: + go-version: ${{matrix.go}} + mod-version: "1.21" + + - name: Test Hello World with go.mod 1.22 + if: startsWith(matrix.go, '1.22') || startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') + uses: ./.github/actions/test-helloworld + with: + go-version: ${{matrix.go}} + mod-version: "1.22" + + - name: Test Hello World with go.mod 1.23 + if: startsWith(matrix.go, '1.23') || startsWith(matrix.go, '1.24') + uses: ./.github/actions/test-helloworld + with: + go-version: ${{matrix.go}} + mod-version: "1.23" + + - name: Test Hello World with go.mod 1.24 + if: startsWith(matrix.go, '1.24') + uses: ./.github/actions/test-helloworld + with: + go-version: ${{matrix.go}} + mod-version: "1.24" + + cross-compile: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: [macos-latest] + llvm: [19] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + + - name: Set up Go for building llgo + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install wamr + run: | + git clone https://github.com/bytecodealliance/wasm-micro-runtime.git + mkdir wasm-micro-runtime/product-mini/platforms/darwin/build + cd wasm-micro-runtime/product-mini/platforms/darwin/build + cmake -D WAMR_BUILD_EXCE_HANDLING=1 -D WAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_SHARED_MEMORY=1 -DWAMR_BUILD_LIB_WASI_THREADS=1 -DWAMR_BUILD_LIB_PTHREAD=1 -DCMAKE_BUILD_TYPE=Debug -DWAMR_BUILD_DEBUG_INTERP=1 .. + make -j8 + echo "$PWD" >> $GITHUB_PATH + + - name: Install llgo + run: | + go install ./... + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Test Cross Compilation (wasm) + shell: bash + working-directory: _demo/c + run: | + echo "Testing cross-compilation wasm with Go 1.24.2" + + # Compile for wasm architecture + GOOS=wasip1 GOARCH=wasm llgo build -o hello -tags=nogc -v ./helloc + + # Check file type + file hello.wasm + + # Run the wasm binary using llgo_wasm + iwasm --stack-size=819200000 --heap-size=800000000 hello.wasm diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml new file mode 100644 index 00000000..0da8acb0 --- /dev/null +++ b/.github/workflows/targets.yml @@ -0,0 +1,47 @@ + +name: Targets + +on: + push: + branches: + - "**" + - "!dependabot/**" + pull_request: + branches: ["**"] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + llgo: + continue-on-error: true + timeout-minutes: 30 + strategy: + matrix: + os: + - macos-latest + - ubuntu-24.04 + llvm: [19] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v5 + - name: Install dependencies + uses: ./.github/actions/setup-deps + with: + llvm-version: ${{matrix.llvm}} + + - name: Set up Go for build + uses: ./.github/actions/setup-go + with: + go-version: "1.24.2" + + - name: Install + run: | + go install ./... + echo "LLGO_ROOT=$GITHUB_WORKSPACE" >> $GITHUB_ENV + + - name: Build targets + run: | + cd _demo/embed/targetsbuild + bash build.sh From 087696e31ba7d12c68b7f7ebeef19f507550bbbc Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Thu, 25 Sep 2025 18:26:11 +0800 Subject: [PATCH 13/15] ci:rm zlib link --- .github/workflows/populate_linux_sysroot.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index 13bf502b..b2cead2a 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -123,12 +123,6 @@ do-sync() { exit \$? } -# Create missing symlinks for development libraries -ln -sf libz.so.1 /lib/x86_64-linux-gnu/libz.so 2>/dev/null || true -ln -sf libz.so.1 /usr/lib/x86_64-linux-gnu/libz.so 2>/dev/null || true -ln -sf libz.so.1 /lib/aarch64-linux-gnu/libz.so 2>/dev/null || true -ln -sf libz.so.1 /usr/lib/aarch64-linux-gnu/libz.so 2>/dev/null || true - do-sync / /sysroot/ EOF chmod +x "${POPULATE_LINUX_SYSROOT_SCRIPT}" From 4cff9bb0a7271e2b2f803e7096b15e35be8bad97 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Fri, 26 Sep 2025 10:51:07 +0800 Subject: [PATCH 14/15] ci:release-build use macos-15-intel instead macos-13 https://github.com/goplus/llgo/pull/1320 --- .github/workflows/release-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 8aa98321..85c44f4b 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -123,7 +123,7 @@ jobs: strategy: matrix: include: - - os: macos-13 + - os: macos-15-intel goos: darwin goarch: amd64 go-version: "1.24.2" From 4a6331c66846cdd868761649cba16b7fddabf390 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Fri, 26 Sep 2025 11:15:56 +0800 Subject: [PATCH 15/15] ci:rm unuse llvm download tool --- .github/actions/setup-deps/action.yml | 10 ++++++---- .github/workflows/populate_linux_sysroot.sh | 7 +------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-deps/action.yml b/.github/actions/setup-deps/action.yml index b0bdb4bc..0ffebeb7 100644 --- a/.github/actions/setup-deps/action.yml +++ b/.github/actions/setup-deps/action.yml @@ -18,14 +18,14 @@ runs: shell: bash run: | brew update - + # Install LLVM if requested if [[ "${{ inputs.install-llvm }}" == "true" ]]; then brew install llvm@${{inputs.llvm-version}} lld@${{inputs.llvm-version}} brew link --overwrite llvm@${{inputs.llvm-version}} lld@${{inputs.llvm-version}} echo "$(brew --prefix llvm@${{inputs.llvm-version}})/bin" >> $GITHUB_PATH fi - + # Install common dependencies brew install bdw-gc openssl libffi libuv brew link --overwrite libffi @@ -36,9 +36,11 @@ runs: opt_deps=( cjson # for github.com/goplus/lib/c/cjson sqlite # for github.com/goplus/lib/c/sqlite - python@3.12 # for github.com/goplus/lib/py ) brew install "${opt_deps[@]}" + + brew install python@3.12 || true # for github.com/goplus/lib/py + brew link --overwrite python@3.12 - name: Install Ubuntu dependencies if: runner.os == 'Linux' shell: bash @@ -53,7 +55,7 @@ runs: else sudo apt-get update fi - + # Install common dependencies sudo apt-get install -y pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev libuv1-dev diff --git a/.github/workflows/populate_linux_sysroot.sh b/.github/workflows/populate_linux_sysroot.sh index b2cead2a..3c802533 100755 --- a/.github/workflows/populate_linux_sysroot.sh +++ b/.github/workflows/populate_linux_sysroot.sh @@ -17,12 +17,7 @@ cat > "${POPULATE_LINUX_SYSROOT_SCRIPT}" << EOF export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y build-essential zlib1g-dev -apt-get install -y lsb-release gnupg2 wget rsync - -echo "deb http://apt.llvm.org/\$(lsb_release -cs)/ llvm-toolchain-\$(lsb_release -cs)-19 main" | tee /etc/apt/sources.list.d/llvm.list -wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -apt-get update +apt-get install -y build-essential zlib1g-dev rsync error() { echo -e "\$1" >&2