Skip to content

Commit

Permalink
Fixed some build errors...
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Mar 11, 2020
1 parent 073b528 commit 37d69c8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
exclude = [".circleci/*", ".gitignore"]

[lib]
crate-type = ["staticlib"]
crate-type = ["dylib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[badges]
Expand Down
15 changes: 3 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all build build-rust build-go test docker-image docker-build docker-image-centos7

DOCKER_TAG := 0.6.3
DOCKER_TAG := 0.7.0
USER_ID := $(shell id -u)
USER_GROUP = $(shell id -g)

Expand All @@ -23,7 +23,7 @@ build: build-rust build-go

# don't strip for now, for better error reporting
# build-rust: build-rust-release strip
build-rust: build-rust-static
build-rust: build-rust-release

# use debug build for quick testing
build-rust-debug:
Expand All @@ -32,18 +32,9 @@ build-rust-debug:

# use release build to actually ship - smaller and much faster
build-rust-release:
# RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --features backtraces --target x86_64-unknown-linux-musl
cargo build --release --features backtraces
rm -f api/libgo_cosmwasm.{a,$(DLL_EXT)}
RUSTFLAGS="-C target-feature=-crt-static -C link-args=-fPIC" cargo build --release --target x86_64-unknown-linux-musl
cp target/release/libgo_cosmwasm.$(DLL_EXT) api

# static is like release, but bigger, but much more portable (doesn't depend on host libraries)
build-rust-static:
RUSTFLAGS="-C target-feature=-crt-static" rustup run nightly cargo build --release --features backtraces --target x86_64-unknown-linux-musl
rm -f api/libgo_cosmwasm.{a,$(DLL_EXT)}
cp target/x86_64-unknown-linux-musl/release/libgo_cosmwasm.a api


install-release-tools:
sudo apt install musl-tools
rustup target add x86_64-unknown-linux-musl
Expand Down
1 change: 1 addition & 0 deletions api/lib.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package api


// #cgo LDFLAGS: -Wl,-rpath,${SRCDIR} -L${SRCDIR} -lgo_cosmwasm
// #include <stdlib.h>
// #include "bindings.h"
Expand Down

0 comments on commit 37d69c8

Please sign in to comment.