Skip to content

Commit

Permalink
chore: remove cgo in go lib
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Sep 18, 2024
1 parent 9289f10 commit 26242cb
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 942 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,6 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.22
- uses: korandoru/setup-zig@v1
with:
zig-version: master
- name: Set output
id: macos_sdk
run: echo "path=$(xcrun --show-sdk-path)" >> $GITHUB_OUTPUT
- name: Go cross compile test on Windows
run: |
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC='zig cc -target x86_64-windows-gnu' go build ./...
- name: Go cross compile test on Linux
run: |
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC='zig cc -target x86_64-linux-musl' go build ./...
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC='zig cc -target aarch64-linux-musl' go build ./...
- name: Go cross compile test on Macos
run: |
export SDK_PATH=$(xcrun --show-sdk-path)
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 CC='zig cc -target x86_64-macos-none -F'"${SDK_PATH}"'/System/Library/Frameworks' go build ./...
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 CC='zig cc -target aarch64-macos-none -F'"${SDK_PATH}"'/System/Library/Frameworks' go build ./...
env:
SDK_PATH: ${{ steps.macos_sdk.outputs.path }}
go-version: 1.23
- name: Go test
run: go test ./...
2 changes: 1 addition & 1 deletion .github/workflows/nodejs-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
path: nodejs/*.node

macos:
runs-on: macos-latest
runs-on: macos-12
strategy:
matrix:
settings:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zig-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
working-directory: "zig"
strategy:
matrix:
os: [macos-12, macos-latest, ubuntu-latest, windows-latest]
os: [macos-12, macos-latest, ubuntu-20.04, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
13 changes: 13 additions & 0 deletions go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# KCL Artifact Library for Go

## Developing

### Prerequisites

+ Go 1.23+

### Build and Test

```shell
go test ./...
```
Binary file removed go/lib/windows-arm64/static/libkclvm_cli_cdylib.a
Binary file not shown.
41 changes: 0 additions & 41 deletions go/native/cgo.go

This file was deleted.

187 changes: 0 additions & 187 deletions go/native/client.go

This file was deleted.

Loading

0 comments on commit 26242cb

Please sign in to comment.