Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enhance kcl-go cgo build tags #368

Merged
merged 1 commit into from
Aug 12, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/main_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ jobs:
with:
go-version: 1.22

- name: CGO_ENABLED=0 go test
run: CGO_ENABLED=0 go test ./...

- name: CGO_ENABLED=1 go test
run: CGO_ENABLED=1 go test ./...

# Parallel tests
- run: go test -v -coverprofile=profile.cov ./...
- uses: shogo82148/actions-goveralls@v1
Expand Down
3 changes: 3 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package kcl_test

import (
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !rpc
// +build !rpc
//go:build cgo
// +build cgo

package main

Expand Down
3 changes: 3 additions & 0 deletions kcl_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package kcl_test

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/kcl/api_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !rpc
// +build !rpc
//go:build !rpc && cgo
// +build !rpc,cgo

package kcl

Expand Down
4 changes: 2 additions & 2 deletions pkg/kcl/rpc_service.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build rpc
// +build rpc
//go:build rpc || !cgo
// +build rpc !cgo

package kcl

Expand Down
4 changes: 2 additions & 2 deletions pkg/kcl/service.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !rpc
// +build !rpc
//go:build !rpc && cgo
// +build !rpc,cgo

package kcl

Expand Down
3 changes: 3 additions & 0 deletions pkg/native/loader.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build cgo
// +build cgo

package native

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/api.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package plugin

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/api_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package plugin

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/error.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package plugin

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/hello_plugin/api.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package hello_plugin

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/hello_plugin/api_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package hello_plugin

import (
Expand Down
4 changes: 4 additions & 0 deletions pkg/plugin/spec.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Copyright The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package plugin

import (
Expand Down
3 changes: 3 additions & 0 deletions pkg/plugin/utils_c_string.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 The KCL Authors. All rights reserved.

//go:build cgo
// +build cgo

package plugin

// #include <stdlib.h>
Expand Down