deps: require zlib 1.2+

This commit is contained in:
Aofei Sheng
2024-07-31 08:56:03 +08:00
parent d2cb96a9e5
commit 45b4315842
3 changed files with 37 additions and 22 deletions

View File

@@ -18,7 +18,7 @@ jobs:
- macos-latest - macos-latest
- ubuntu-24.04 - ubuntu-24.04
llvm: [18] llvm: [18]
runs-on: ${{ matrix.os }} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -26,17 +26,37 @@ jobs:
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
run: | run: |
brew update brew update
brew install llvm@${{ matrix.llvm }} pkg-config bdw-gc openssl cjson sqlite python@3.12 brew install llvm@${{matrix.llvm}} pkg-config bdw-gc openssl
echo "$(brew --prefix llvm@${{ matrix.llvm }})/bin" >> $GITHUB_PATH echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
# Install optional deps for demos.
#
# NOTE: Keep this list updated as new deps are introduced.
opt_deps=(
cjson # for github.com/goplus/llgo/c/cjson
sqlite # for github.com/goplus/llgo/c/sqlite
python@3.12 # for github.com/goplus/llgo/py
)
brew install "${opt_deps[@]}"
- name: Install dependencies - name: Install dependencies
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
run: | run: |
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{ matrix.llvm }} main" | sudo tee /etc/apt/sources.list.d/llvm.list echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{matrix.llvm}} main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update sudo apt-get update
sudo apt-get install -y llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }} lld-${{ matrix.llvm }} pkg-config libgc-dev libssl-dev libcjson-dev libsqlite3-dev python3.12-dev sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev
echo "/usr/lib/llvm-${{ matrix.llvm }}/bin" >> $GITHUB_PATH echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
# Install optional deps for demos.
#
# NOTE: Keep this list updated as new deps are introduced.
opt_deps=(
libcjson-dev # for github.com/goplus/llgo/c/cjson
libsqlite3-dev # for github.com/goplus/llgo/c/sqlite
python3.12-dev # for github.com/goplus/llgo/py
)
sudo apt-get install -y "${opt_deps[@]}"
- name: Clang information - name: Clang information
run: | run: |
@@ -66,13 +86,13 @@ jobs:
- name: LLGO tests - name: LLGO tests
if: matrix.os != 'ubuntu-latest' if: matrix.os != 'ubuntu-latest'
run: | run: |
echo "Test result on ${{ matrix.os }} with LLVM ${{ matrix.llvm }}" > result.md echo "Test result on ${{matrix.os}} with LLVM ${{matrix.llvm}}" > result.md
LLGOROOT=$PWD bash .github/workflows/test_llgo.sh bash .github/workflows/test_llgo.sh
- name: Test _demo and _pydemo - name: Test _demo and _pydemo
run: | run: |
set +e set +e
LLGOROOT=$PWD bash .github/workflows/test_demo.sh bash .github/workflows/test_demo.sh
exit 0 exit 0
- name: Show test result - name: Show test result
@@ -83,10 +103,10 @@ jobs:
if: false if: false
with: with:
filePath: result.md filePath: result.md
comment_tag: test-result-on-${{ matrix.os }}-with-llvm-${{ matrix.llvm }} comment_tag: test-result-on-${{matrix.os}}-with-llvm-${{matrix.llvm}}
- name: Upload coverage reports to Codecov - name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{secrets.CODECOV_TOKEN}}
slug: goplus/llgo slug: goplus/llgo

View File

@@ -1,8 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -e
export LLGOROOT=$PWD
testcmd=/tmp/test testcmd=/tmp/test
llgo build -o $testcmd ./c/bdwgc/_test llgo build -o $testcmd ./c/bdwgc/_test
cases=$($testcmd) cases=$($testcmd)

View File

@@ -317,8 +317,7 @@ Here are the Go packages that can be imported correctly:
- [pkg-config 0.29+](https://www.freedesktop.org/wiki/Software/pkg-config/) - [pkg-config 0.29+](https://www.freedesktop.org/wiki/Software/pkg-config/)
- [bdwgc/libgc 8.0+](https://www.hboehm.info/gc/) - [bdwgc/libgc 8.0+](https://www.hboehm.info/gc/)
- [OpenSSL 3.0+](https://www.openssl.org/) - [OpenSSL 3.0+](https://www.openssl.org/)
- [cJSON 1.7+](https://github.com/DaveGamble/cJSON) (optional, for [github.com/goplus/llgo/c/cjson](https://pkg.go.dev/github.com/goplus/llgo/c/cjson)) - [zlib 1.2+](https://www.zlib.net)
- [SQLite 3](https://www.sqlite.org) (optional, for [github.com/goplus/llgo/c/sqlite](https://pkg.go.dev/github.com/goplus/llgo/c/sqlite))
- [Python 3.12+](https://www.python.org) (optional, for [github.com/goplus/llgo/py](https://pkg.go.dev/github.com/goplus/llgo/py)) - [Python 3.12+](https://www.python.org) (optional, for [github.com/goplus/llgo/py](https://pkg.go.dev/github.com/goplus/llgo/py))
## How to install ## How to install
@@ -328,10 +327,9 @@ Follow these steps to generate the `llgo` command (its usage is the same as the
### on macOS ### on macOS
```sh ```sh
brew update # execute if needed brew update
brew install llvm@18 pkg-config bdw-gc openssl brew install llvm@18 pkg-config bdw-gc openssl
brew install cjson sqlite python@3.12 # optional brew install python@3.12 # optional
export PATH=$(brew --prefix llvm@18)/bin:$PATH # you may want to add this to your shell RC file, e.g. ~/.zshrc
go install -v github.com/goplus/llgo/cmd/llgo@latest go install -v github.com/goplus/llgo/cmd/llgo@latest
``` ```
@@ -340,10 +338,9 @@ go install -v github.com/goplus/llgo/cmd/llgo@latest
```sh ```sh
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-18 main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update # execute if needed sudo apt-get update
sudo apt-get install -y llvm-18-dev clang-18 lld-18 pkg-config libgc-dev libssl-dev sudo apt-get install -y llvm-18-dev clang-18 lld-18 pkg-config libgc-dev libssl-dev zlib1g-dev
sudo apt-get install -y libcjson-dev libsqlite3-dev python3.12-dev # optional sudo apt-get install -y python3.12-dev # optional
export PATH=/usr/lib/llvm-18/bin:$PATH # you may want to add this to your shell RC file, e.g. ~/.bashrc
go install -v github.com/goplus/llgo/cmd/llgo@latest go install -v github.com/goplus/llgo/cmd/llgo@latest
``` ```