From 52a77f9efbf6220a05edf9ca2f92bbf322f93f50 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Tue, 4 Mar 2025 09:58:21 +0800 Subject: [PATCH 1/2] runtime: fix libunwind to compatible with homebrew linux --- c/debug/_wrap/debug.c | 2 ++ c/debug/debug.go | 4 ++-- runtime/internal/clite/debug/_wrap/debug.c | 2 ++ runtime/internal/clite/debug/debug.go | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/c/debug/_wrap/debug.c b/c/debug/_wrap/debug.c index 4b11a191..32d87903 100644 --- a/c/debug/_wrap/debug.c +++ b/c/debug/_wrap/debug.c @@ -1,6 +1,8 @@ #if defined(__linux__) #define UNW_LOCAL_ONLY +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #endif diff --git a/c/debug/debug.go b/c/debug/debug.go index 16e00eea..76260b0d 100644 --- a/c/debug/debug.go +++ b/c/debug/debug.go @@ -11,8 +11,8 @@ import ( ) const ( - LLGoPackage = "link" - LLGoFiles = "_wrap/debug.c" + LLGoPackage = "link: $(llvm-config --ldflags --libs); -lunwind" + LLGoFiles = "$(llvm-config --cflags): _wrap/debug.c" ) type Info struct { diff --git a/runtime/internal/clite/debug/_wrap/debug.c b/runtime/internal/clite/debug/_wrap/debug.c index 4b11a191..32d87903 100644 --- a/runtime/internal/clite/debug/_wrap/debug.c +++ b/runtime/internal/clite/debug/_wrap/debug.c @@ -1,6 +1,8 @@ #if defined(__linux__) #define UNW_LOCAL_ONLY +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #endif diff --git a/runtime/internal/clite/debug/debug.go b/runtime/internal/clite/debug/debug.go index 10e3a41e..48a27649 100644 --- a/runtime/internal/clite/debug/debug.go +++ b/runtime/internal/clite/debug/debug.go @@ -11,8 +11,8 @@ import ( ) const ( - LLGoPackage = "link" - LLGoFiles = "_wrap/debug.c" + LLGoPackage = "link: $(llvm-config --ldflags --libs); -lunwind" + LLGoFiles = "$(llvm-config --cflags): _wrap/debug.c" ) type Info struct { From 77376087db37ccfafed8440c9cf892115a92e197 Mon Sep 17 00:00:00 2001 From: Li Jie Date: Tue, 4 Mar 2025 11:20:16 +0800 Subject: [PATCH 2/2] ci: optimize model download to avoid Huggingface blocking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Download the LLaMA model as a separate job and share it as an artifact to prevent repeated downloads from Huggingface which could lead to rate limiting or blocking. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/llgo.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml index d111f67b..08fe6249 100644 --- a/.github/workflows/llgo.yml +++ b/.github/workflows/llgo.yml @@ -10,7 +10,23 @@ on: branches: [ "**" ] jobs: + download-model: + runs-on: ubuntu-latest + steps: + - name: Download model file + run: | + mkdir -p ./_demo/llama2-c + wget -P ./_demo/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/llama2-c/stories15M.bin + retention-days: 1 + llgo: + needs: download-model continue-on-error: true strategy: matrix: @@ -26,9 +42,13 @@ jobs: uses: ./.github/actions/setup-deps with: llvm-version: ${{matrix.llvm}} + - name: Download model artifact + uses: actions/download-artifact@v4 + with: + name: llama2-model + path: ./_demo/llama2-c/ - name: Install further optional dependencies for demos run: | - wget -P ./_demo/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin py_deps=( numpy # for github.com/goplus/llgo/py/numpy torch # for github.com/goplus/llgo/py/torch @@ -112,7 +132,6 @@ jobs: llvm-version: ${{matrix.llvm}} - name: Install further optional dependencies for demos run: | - wget -P ./_demo/llama2-c https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin py_deps=( numpy # for github.com/goplus/llgo/py/numpy torch # for github.com/goplus/llgo/py/torch