Skip to content

Commit a259723

Browse files
authored
Merge pull request #527 from damiannolan/damian/build-directives
imp: allow cgo while disabling libwasmvm linking
2 parents fcbfbff + bcde382 commit a259723

File tree

11 files changed

+1069
-1040
lines changed

11 files changed

+1069
-1040
lines changed

.circleci/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,25 @@ jobs:
201201
- run:
202202
name: Test package "cosmwasm" without cgo
203203
command: CGO_ENABLED=0 go test .
204+
205+
# Build types and cosmwasm with libwasmvm linking disabled
206+
nolink_libwasmvm:
207+
docker:
208+
- image: cimg/go:1.21.4
209+
steps:
210+
- checkout
211+
- run:
212+
name: Build package "types" with libwasmvm linking disabled
213+
command: go build -tags "nolink_libwasmvm" ./types
214+
- run:
215+
name: Build package "cosmwasm" with libwasmvm linking disabled
216+
command: go build -tags "nolink_libwasmvm" .
217+
- run:
218+
name: Test package "types" with libwasmvm linking disabled
219+
command: go test -tags "nolink_libwasmvm" ./types
220+
- run:
221+
name: Test package "cosmwasm" with libwasmvm linking disabled
222+
command: go test -tags "nolink_libwasmvm" .
204223

205224
tidy-go:
206225
docker:
@@ -433,6 +452,7 @@ workflows:
433452
- libwasmvm_audit
434453
- format-go
435454
- wasmvm_no_cgo
455+
- nolink_libwasmvm
436456
- tidy-go
437457
- format-scripts
438458
- lint-scripts

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ go build .
9090
CGO_ENABLED=0 go build .
9191
```
9292

93+
In the case that it may be desirable to compile with cgo, but with libwasmvm linking disabled an additional build tag is available.
94+
95+
```sh
96+
# Build with CGO, but with libwasmvm linking disabled
97+
go build -tags "nolink_libwasmvm"
98+
```
99+
93100
## Supported Platforms
94101

95102
See [COMPILER_VERSIONS.md](docs/COMPILER_VERSIONS.md) for information on Go and

ibc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build cgo
1+
//go:build cgo && !nolink_libwasmvm
22

33
package cosmwasm
44

0 commit comments

Comments
 (0)