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

fix: update proofs release to latest #146

Merged
merged 11 commits into from
Oct 28, 2020
11 changes: 5 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
gobin: $HOME/.local/bin
version: 1.23.8
- run:
command: make go-lint
command: LD_LIBRARY_PATH="/tmp/__fil-hwloc/lib" make go-lint
build_and_test_linux_cgo_bindings:
parameters:
run_leak_detector:
Expand Down Expand Up @@ -213,7 +213,7 @@ commands:
go version
- run:
name: Install other dependencies with Homebrew
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config md5sha1sum jq
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install pkg-config md5sha1sum jq hwloc
- run:
name: Install Rust toolchain
command: |
Expand Down Expand Up @@ -312,16 +312,15 @@ commands:
steps:
- run:
name: Run leak detector
command: make cgo-leakdetect
command: LD_LIBRARY_PATH="/tmp/__fil-hwloc/lib" make cgo-leakdetect
no_output_timeout: 60m

- run:
name: Run the Rust tests
command: cd rust && FIL_PROOFS_PARAMETER_CACHE="${HOME}/filecoin-proof-parameters/" RUST_LOG=info cargo test --all --release && cd ..
command: cd rust && FIL_PROOFS_PARAMETER_CACHE="${HOME}/filecoin-proof-parameters/" RUSTFLAGS="-L/tmp/__fil-hwloc/lib -lhwloc" RUST_LOG=info LD_LIBRARY_PATH="/tmp/__fil-hwloc/lib" cargo test --all --release && cd ..
no_output_timeout: 60m
- run:
name: Run the Go tests
command: GODEBUG=cgocheck=2 RUST_LOG=info go test -p 1 -timeout 60m
command: CGO_LDFLAGS="-L/tmp/__fil-hwloc/lib -lhwloc" LD_LIBRARY_PATH="/tmp/__fil-hwloc/lib" GODEBUG=cgocheck=2 RUST_LOG=info go test -p 1 -timeout 60m
no_output_timeout: 60m
compile_tests:
steps:
Expand Down
7 changes: 3 additions & 4 deletions bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

package ffi

import (
"github.com/filecoin-project/filecoin-ffi/generated"
)

// #cgo LDFLAGS: ${SRCDIR}/libfilcrypto.a
// #cgo pkg-config: ${SRCDIR}/filcrypto.pc
// #include "./filcrypto.h"
import "C"
import (
"github.com/filecoin-project/filecoin-ffi/generated"
)

// Hash computes the digest of a message
func Hash(message Message) Digest {
Expand Down
4 changes: 2 additions & 2 deletions filcrypto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ GENERATOR:
Includes:
- ../filcrypto.h
FlagGroups:
- {name: LDFLAGS, flags: ["-L${SRCDIR}/.. -lfilcrypto"]}
- {name: pkg-config, flags: ["${SRCDIR}/../filcrypto.pc"]}
- {name: LDFLAGS, flags: ["-L${SRCDIR}/.. -lfilcrypto -L/tmp/__fil-hwloc/lib -lhwloc"]}
- {name: pkg-config, flags: ["${SRCDIR}/../filcrypto.pc --static"]}

PARSER:
Defines:
Expand Down
4 changes: 2 additions & 2 deletions generated/cgo_helpers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/const.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions install-filcrypto
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,23 @@ build_from_source() {
local __repo_sha1=$(git rev-parse HEAD)
local __repo_sha1_truncated="${__repo_sha1:0:16}"

if [ "$(uname)" = "Linux" ]; then
# Install hwloc2 on Linux dependency from source.
HWLOC_PACKAGE="hwloc-2.3.0"
HWLOC_DOWNLOAD_URL="https://download.open-mpi.org/release/hwloc/v2.3/hwloc-2.3.0.tar.gz"
HWLOC_INSTALL_DIR="/tmp/__fil-hwloc"
rm -rf ${HWLOC_INSTALL_DIR}

curl ${HWLOC_DOWNLOAD_URL} --location --output /tmp/${HWLOC_PACKAGE}.tar.gz
pushd /tmp/
tar -xf ${HWLOC_PACKAGE}.tar.gz
rm -f /tmp/${HWLOC_PACKAGE}.tar.gz
cd ${HWLOC_PACKAGE}
./configure --prefix=${HWLOC_INSTALL_DIR} && make && make install
popd
rm -rf /tmp/${HWLOC_PACKAGE}
fi

(>&2 echo "building from source @ ${__repo_sha1_truncated}")

if ! [ -x "$(command -v cargo)" ]; then
Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

RUST_LOG=info go test -count=1 ./... && cd rust && cargo test --release --all && cd ..
RUST_LOG=info go test --ldflags '-extldflags "-L/tmp/__fil-hwloc/lib -lhwloc"' -count=1 ./... && cd rust && cargo test --release --all && cd ..
Loading