filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.85k stars 1.27k forks source link

Duplicate symbol errors occur with both require go-ethereum and lotus release/v1.20.0 #10146

Closed imxyb closed 1 year ago

imxyb commented 1 year ago

Checklist

Lotus component

Lotus Version

release/v1.20.0

Describe the Bug

os: mac os golang version: 1.19

I need to require in the go-ethereum sdk to parse the events of the fvm contract, and also the lotus sdk, this is my go.mod:

module api-server

go 1.19

require (
    **github.com/ethereum/go-ethereum v1.10.26
    github.com/filecoin-project/lotus v1.20.0-hyperpsace-0119**

    github.com/gin-contrib/cors v1.4.0
    github.com/gin-gonic/gin v1.8.2
    github.com/go-playground/validator/v10 v10.11.1
    github.com/goccy/go-json v0.10.0
    github.com/imxyb/solc-go v0.0.0-20221118052323-46126dce43fa
    github.com/jinzhu/configor v1.2.1
    github.com/lib/pq v1.10.7
    github.com/sirupsen/logrus v1.8.1
    github.com/spf13/cobra v0.0.5
    github.com/swaggo/files v1.0.0
    github.com/swaggo/gin-swagger v1.5.3
    github.com/swaggo/swag v1.8.10
    github.com/tidwall/gjson v1.14.4
    xorm.io/xorm v1.3.2
)

require (
    github.com/BurntSushi/toml v1.1.0 // indirect
    github.com/DataDog/zstd v1.4.5 // indirect
    github.com/GeertJohan/go.incremental v1.0.0 // indirect
    github.com/GeertJohan/go.rice v1.0.3 // indirect
    github.com/KyleBanks/depth v1.2.1 // indirect
    github.com/PuerkitoBio/purell v1.1.1 // indirect
    github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
    github.com/StackExchange/wmi v1.2.1 // indirect
    github.com/akavel/rsrc v0.8.0 // indirect
    github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
    github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
    github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
    github.com/daaku/go.zipexe v1.0.2 // indirect
    github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
    github.com/filecoin-project/go-address v1.1.0 // indirect
    github.com/filecoin-project/go-amt-ipld/v2 v2.1.0 // indirect
    github.com/filecoin-project/go-amt-ipld/v3 v3.1.0 // indirect
    github.com/filecoin-project/go-amt-ipld/v4 v4.0.0 // indirect
    github.com/filecoin-project/go-bitfield v0.2.4 // indirect
    github.com/filecoin-project/go-cbor-util v0.0.1 // indirect
    github.com/filecoin-project/go-crypto v0.0.1 // indirect
    github.com/filecoin-project/go-data-transfer v1.15.2 // indirect
    github.com/filecoin-project/go-fil-markets v1.25.2 // indirect
    github.com/filecoin-project/go-hamt-ipld v0.1.5 // indirect
    github.com/filecoin-project/go-hamt-ipld/v2 v2.0.0 // indirect
    github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0 // indirect
    github.com/filecoin-project/go-padreader v0.0.1 // indirect
    github.com/filecoin-project/go-state-types v0.10.0-alpha-9.0.20230118014411-cf80be872456 // indirect
    github.com/filecoin-project/go-statestore v0.2.0 // indirect
    github.com/filecoin-project/specs-actors v0.9.15 // indirect
    github.com/filecoin-project/specs-actors/v2 v2.3.6 // indirect
    github.com/filecoin-project/specs-actors/v3 v3.1.2 // indirect
    github.com/filecoin-project/specs-actors/v4 v4.0.2 // indirect
    github.com/filecoin-project/specs-actors/v5 v5.0.6 // indirect
    github.com/filecoin-project/specs-actors/v6 v6.0.2 // indirect
    github.com/filecoin-project/specs-actors/v7 v7.0.1 // indirect
    github.com/fsnotify/fsnotify v1.5.4 // indirect
    github.com/fxamacker/cbor v1.5.1 // indirect
    github.com/gbrlsnchs/jwt/v3 v3.0.1 // indirect
    github.com/gin-contrib/sse v0.1.0 // indirect
    github.com/go-logr/logr v1.2.3 // indirect
    github.com/go-logr/stdr v1.2.2 // indirect
    github.com/go-ole/go-ole v1.2.5 // indirect
    github.com/go-openapi/jsonpointer v0.19.5 // indirect
    github.com/go-openapi/jsonreference v0.19.6 // indirect
    github.com/go-openapi/spec v0.20.4 // indirect
    github.com/go-openapi/swag v0.19.15 // indirect
    github.com/go-playground/locales v0.14.0 // indirect
    github.com/go-playground/universal-translator v0.18.0 // indirect
    github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
    github.com/gogo/protobuf v1.3.2 // indirect
    github.com/golang/mock v1.6.0 // indirect
    github.com/golang/snappy v0.0.4 // indirect
    github.com/google/uuid v1.3.0 // indirect
    github.com/gorilla/websocket v1.5.0 // indirect
    github.com/hannahhoward/cbor-gen-for v0.0.0-20200817222906-ea96cece81f1 // indirect
    github.com/hannahhoward/go-pubsub v0.0.0-20200423002714-8d62886cc36e // indirect
    github.com/hashicorp/errwrap v1.1.0 // indirect
    github.com/hashicorp/go-multierror v1.1.1 // indirect
    github.com/hashicorp/go-version v1.6.0 // indirect
    github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
    github.com/icza/backscanner v0.0.0-20210726202459-ac2ffc679f94 // indirect
    github.com/imroc/req/v3 v3.25.0 // indirect
    github.com/inconshreveable/mousetrap v1.0.0 // indirect
    github.com/ipfs/bbloom v0.0.4 // indirect
    github.com/ipfs/go-block-format v0.0.3 // indirect
    github.com/ipfs/go-blockservice v0.4.0 // indirect
    github.com/ipfs/go-cid v0.3.2 // indirect
    github.com/ipfs/go-datastore v0.6.0 // indirect
    github.com/ipfs/go-graphsync v0.13.2 // indirect
    github.com/ipfs/go-ipfs-blockstore v1.2.0 // indirect
    github.com/ipfs/go-ipfs-cmds v0.7.0 // indirect
    github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect
    github.com/ipfs/go-ipfs-exchange-interface v0.2.0 // indirect
    github.com/ipfs/go-ipfs-files v0.1.1 // indirect
    github.com/ipfs/go-ipfs-http-client v0.4.0 // indirect
    github.com/ipfs/go-ipfs-util v0.0.2 // indirect
    github.com/ipfs/go-ipld-cbor v0.0.6 // indirect
    github.com/ipfs/go-ipld-format v0.4.0 // indirect
    github.com/ipfs/go-ipld-legacy v0.1.1 // indirect
    github.com/ipfs/go-log v1.0.5 // indirect
    github.com/ipfs/go-log/v2 v2.5.1 // indirect
    github.com/ipfs/go-merkledag v0.8.1 // indirect
    github.com/ipfs/go-metrics-interface v0.0.1 // indirect
    github.com/ipfs/go-path v0.3.0 // indirect
    github.com/ipfs/go-unixfs v0.4.0 // indirect
    github.com/ipfs/go-verifcid v0.0.2 // indirect
    github.com/ipfs/interface-go-ipfs-core v0.7.0 // indirect
    github.com/ipld/go-car v0.4.0 // indirect
    github.com/ipld/go-codec-dagpb v1.5.0 // indirect
    github.com/ipld/go-ipld-prime v0.18.0 // indirect
    github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect
    github.com/jbenet/goprocess v0.1.4 // indirect
    github.com/jessevdk/go-flags v1.5.0 // indirect
    github.com/josharian/intern v1.0.0 // indirect
    github.com/jpillora/backoff v1.0.0 // indirect
    github.com/json-iterator/go v1.1.12 // indirect
    github.com/klauspost/cpuid/v2 v2.1.1 // indirect
    github.com/leodido/go-urn v1.2.1 // indirect
    github.com/libp2p/go-buffer-pool v0.1.0 // indirect
    github.com/libp2p/go-libp2p v0.23.2 // indirect
    github.com/libp2p/go-libp2p-core v0.20.1 // indirect
    github.com/libp2p/go-libp2p-pubsub v0.8.2 // indirect
    github.com/libp2p/go-msgio v0.2.0 // indirect
    github.com/libp2p/go-openssl v0.1.0 // indirect
    github.com/lucas-clemente/quic-go v0.29.1 // indirect
    github.com/magefile/mage v1.9.0 // indirect
    github.com/mailru/easyjson v0.7.6 // indirect
    github.com/marten-seemann/qpack v0.2.1 // indirect
    github.com/marten-seemann/qtls-go1-16 v0.1.5 // indirect
    github.com/marten-seemann/qtls-go1-17 v0.1.2 // indirect
    github.com/marten-seemann/qtls-go1-18 v0.1.2 // indirect
    github.com/marten-seemann/qtls-go1-19 v0.1.0 // indirect
    github.com/mattn/go-isatty v0.0.16 // indirect
    github.com/mattn/go-pointer v0.0.1 // indirect
    github.com/miekg/dns v1.1.50 // indirect
    github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
    github.com/minio/sha256-simd v1.0.0 // indirect
    github.com/mitchellh/go-homedir v1.1.0 // indirect
    github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
    github.com/modern-go/reflect2 v1.0.2 // indirect
    github.com/mr-tron/base58 v1.2.0 // indirect
    github.com/multiformats/go-base32 v0.1.0 // indirect
    github.com/multiformats/go-base36 v0.1.0 // indirect
    github.com/multiformats/go-multiaddr v0.7.0 // indirect
    github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
    github.com/multiformats/go-multibase v0.1.1 // indirect
    github.com/multiformats/go-multicodec v0.6.0 // indirect
    github.com/multiformats/go-multihash v0.2.1 // indirect
    github.com/multiformats/go-varint v0.0.6 // indirect
    github.com/nkovacs/streamquote v1.0.0 // indirect
    github.com/nxadm/tail v1.4.8 // indirect
    github.com/onsi/ginkgo v1.16.5 // indirect
    github.com/opentracing/opentracing-go v1.2.0 // indirect
    github.com/pelletier/go-toml/v2 v2.0.6 // indirect
    github.com/pkg/errors v0.9.1 // indirect
    github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
    github.com/raulk/clock v1.1.0 // indirect
    github.com/rs/cors v1.7.0 // indirect
    github.com/russross/blackfriday/v2 v2.1.0 // indirect
    github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
    github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
    github.com/spaolacci/murmur3 v1.1.0 // indirect
    github.com/spf13/pflag v1.0.3 // indirect
    github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
    github.com/tidwall/match v1.1.1 // indirect
    github.com/tidwall/pretty v1.2.1 // indirect
    github.com/tklauser/go-sysconf v0.3.5 // indirect
    github.com/tklauser/numcpus v0.2.2 // indirect
    github.com/ugorji/go/codec v1.2.7 // indirect
    github.com/urfave/cli/v2 v2.16.3 // indirect
    github.com/valyala/bytebufferpool v1.0.0 // indirect
    github.com/valyala/fasttemplate v1.0.1 // indirect
    github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba // indirect
    github.com/whyrusleeping/cbor-gen v0.0.0-20221021053955-c138aae13722 // indirect
    github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee // indirect
    github.com/x448/float16 v0.8.4 // indirect
    github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
    go.opencensus.io v0.23.0 // indirect
    go.opentelemetry.io/otel v1.11.1 // indirect
    go.opentelemetry.io/otel/trace v1.11.1 // indirect
    go.uber.org/atomic v1.10.0 // indirect
    go.uber.org/multierr v1.8.0 // indirect
    go.uber.org/zap v1.23.0 // indirect
    golang.org/x/crypto v0.5.0 // indirect
    golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b // indirect
    golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
    golang.org/x/net v0.5.0 // indirect
    golang.org/x/sys v0.4.0 // indirect
    golang.org/x/text v0.6.0 // indirect
    golang.org/x/tools v0.1.12 // indirect
    golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
    google.golang.org/protobuf v1.28.1 // indirect
    gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
    gopkg.in/yaml.v2 v2.4.0 // indirect
    lukechampine.com/blake3 v1.1.7 // indirect
    rogchap.com/v8go v0.7.0 // indirect
    xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 // indirect
)

when run go build will happen:

/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64/link: running clang++ failed: exit status 1
duplicate symbol '_secp256k1GoPanicError' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000037.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000083.o
duplicate symbol '_secp256k1GoPanicIllegal' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000037.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000083.o
duplicate symbol '_secp256k1_context_destroy' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_seckey_verify' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_verify' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_convert' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_nonce_function_default' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_serialize_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_serialize_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_parse_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_parse_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recover' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_serialize_der' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_parse_der' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_sign' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ext_scalar_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_privkey_tweak_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_pubkey_tweak_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_context_set_error_callback' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o

Logging Information

/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64/link: running clang++ failed: exit status 1
duplicate symbol '_secp256k1GoPanicError' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000037.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000083.o
duplicate symbol '_secp256k1GoPanicIllegal' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000037.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000083.o
duplicate symbol '_secp256k1_context_destroy' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_seckey_verify' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_verify' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_convert' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_nonce_function_default' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_serialize_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_serialize_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recoverable_signature_parse_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_parse_compact' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_recover' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_serialize_der' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_signature_parse_der' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ecdsa_sign' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ext_scalar_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_privkey_tweak_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_ec_pubkey_tweak_mul' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o
duplicate symbol '_secp256k1_context_set_error_callback' in:
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000040.o
    /var/folders/83/_tqcdtx525v55plwg2qq8rnw0000gn/T/go-link-2323596402/000086.o

Repo Steps

  1. run go build
  2. occur error
raulk commented 1 year ago

Related to https://github.com/filecoin-project/go-address/issues/16.

raulk commented 1 year ago

The issue is that Lotus depends on github.com/filecoin-project/go-crypto, which imports github.com/ipsn/go-secp256k. The latter is just the secp256k1 Cgo package extracted from go-ethereum as a standalone library. When you import go-ethereum and lotus at the same time, you bring into scope both Cgo secp256k1 libraries, which ends up doubly exporting those symbols.

raulk commented 1 year ago

Perhaps a surgical replace directive could coalesce both imports into a single one -- but I don't think replace directives work at a package level. I belive the OP is just the Lotus RPC client and the Ethereum RPC client. It's a bit suss anyway that Go doesn't tree-shake to realise that it doesn't actually need to import the crypto parts (or does it?). Also, both Lotus and go-ethereum could afford to offer client libraries just for RPC interaction.