Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Build/documentation issue #18

Closed
duosearch opened this issue Jul 20, 2016 · 24 comments
Closed

Build/documentation issue #18

duosearch opened this issue Jul 20, 2016 · 24 comments

Comments

@duosearch
Copy link
Contributor

duosearch commented Jul 20, 2016

I've followed the README.md to the letter, but failed. How can I get openbazaar-go to run?

Justins-MacBook-Air:ob-go justin$ go get github.com/OpenBazaar/openbazaar-go
    # github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher
src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/sqlite3-binding.c:16824:10: fatal error: 'openssl/rand.h' file not found

I suggest making README.md slightly more verbose with instructions on installing dependencies. (My understanding was there would be a focus on documentation for OB2.0.)

@hoffmabc
Copy link
Member

Download OpenSSL source and put the openssl folder in the $GOPATH/src/github.com/xeodou/go-sqlcipher folder and try again.

@duosearch
Copy link
Contributor Author

Thanks for the speedy response @hoffmabc. My attempt so far based on your comment:

cd $GOPATH
git clone https://github.com/openssl/openssl
mkdir -p $GOPATH/src/github.com/xeodou/go-sqlcipher/
mv openssl/ $GOPATH/src/github.com/xeodou/go-sqlcipher/
go get github.com/OpenBazaar/openbazaar-go

Same error... Can you post specific shell commands?

@tyler-smith
Copy link
Member

If you use Homebrew this should work:

brew install openssl
brew link openssl --force

Then try again: go get github.com/OpenBazaar/openbazaar-go

@duosearch
Copy link
Contributor Author

@tyler-smith Same error:

Justins-MacBook-Air:ob-go justin$ brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12M
Justins-MacBook-Air:ob-go justin$ brew link openssl --force
Linking /usr/local/Cellar/openssl/1.0.2h_1... 1601 symlinks created
Justins-MacBook-Air:ob-go justin$ go get github.com/OpenBazaar/openbazaar-go
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher
src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/sqlite3-binding.c:16824:10: fatal error: 'openssl/rand.h' file not found

@hoffmabc
Copy link
Member

hoffmabc commented Jul 20, 2016

wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar xzvf openssl-1.0.1t.tar.gz
cd openssl-1.0.1t
cp -rf include/openssl $GOPATH/src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/
go get github.com/OpenBazaar/openbazaar-go

@duosearch
Copy link
Contributor Author

@hoffmabc Oh man, this looked so promising because go get github.com/OpenBazaar/openbazaar-go took a lot more time. But it failed again...

[lots and lots of stuff]
( :; LIBDEPS="${LIBDEPS:--Wl,-search_paths_first -L.. -lssl -L.. -lcrypto  }"; LDCMD="${LDCMD:-cc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=clienthellotest} clienthellotest.o ${LIBDEPS} )
cc -I.. -I../include  -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM   -c -o dummytest.o dummytest.c
( :; LIBDEPS="${LIBDEPS:--Wl,-search_paths_first -L.. -lssl -L.. -lcrypto  }"; LDCMD="${LDCMD:-cc}"; LDFLAGS="${LDFLAGS:--DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM}"; LIBPATH=`for x in $LIBDEPS; do echo $x; done | sed -e 's/^ *-L//;t' -e d | uniq`; LIBPATH=`echo $LIBPATH | sed -e 's/ /:/g'`; LD_LIBRARY_PATH=$LIBPATH:$LD_LIBRARY_PATH ${LDCMD} ${LDFLAGS} -o ${APPNAME:=dummytest} dummytest.o ${LIBDEPS} )
making all in tools...
make[1]: Nothing to be done for `all'.
Justins-MacBook-Air:openssl-1.0.1t justin$ go get github.com/OpenBazaar/openbazaar-go
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher
../github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/sqlite3-binding.c:16824:10: fatal error: 'openssl/rand.h' file not found
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
../github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string

@hoffmabc
Copy link
Member

is the openssl folder with the headers sitting in that go-sqlcipher folder?

@hoffmabc
Copy link
Member

hoffmabc commented Jul 20, 2016

Oops I made a mistake copy that openssl folder here instead

$GOPATH/src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/

@hoffmabc
Copy link
Member

image

@duosearch
Copy link
Contributor Author

Ok, things seem to be moving forward. Now I only get a single warning?/error? and it's thinking.

go get github.com/OpenBazaar/openbazaar-go
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
../github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string

But then continuing the README.md instructions I fall flat

Justins-MacBook-Air:ob-go justin$ go run openbazaard.go start
stat openbazaard.go: no such file or directory

@hoffmabc
Copy link
Member

oh you need to move into the main folder
$GOPATH/src/github.com/OpenBazaar/openbazaar-go

@duosearch
Copy link
Contributor Author

We're getting there 👍 Now what?

Justins-MacBook-Air:openbazaar-go justin$ go run openbazaard.go start
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string

@hoffmabc
Copy link
Member

Now we ask @cpacia to help, because I've not seen thato ne.

@duosearch
Copy link
Contributor Author

Ok. If that's of any help, here is my go version

Justins-MacBook-Air:openbazaar-go justin$ go version
go version go1.6.3 darwin/amd64

@cpacia
Copy link
Member

cpacia commented Jul 20, 2016

Ok I have a bug to fix

@cpacia
Copy link
Member

cpacia commented Jul 20, 2016

should be ok now

@duosearch
Copy link
Contributor Author

This still doesn't work for me. Maybe I need to force a pull somehow?

Justins-MacBook-Air:openbazaar-go justin$ go get github.com/OpenBazaar/openbazaar-go
# github.com/OpenBazaar/openbazaar-go/vendor/github.com/ipfs/go-ipfs/core/corehttp
vendor/github.com/ipfs/go-ipfs/core/corehttp/gateway_handler.go:241: invalid operation: ! string

P.S. I don't have reopen rights.

@hoffmabc
Copy link
Member

Did you do another go get?

@duosearch
Copy link
Contributor Author

Yes, I'm doing another go get, and still getting the same error. Strange.

@tyler-smith
Copy link
Member

Tell go get you want to update not just finish installing.

go get -u github.com/OpenBazaar/openbazaar-go

@JustinDrake
Copy link
Contributor

@tyler-smith Thanks, that's what I was missing 👍

@davalb
Copy link
Contributor

davalb commented Jul 24, 2016

Hi, I tried @hoffmabc 's solution:

wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar xzvf openssl-1.0.1t.tar.gz
cd openssl-1.0.1t
cp -rf include/openssl $GOPATH/src/github.com/OpenBazaar/openbazaar-go/vendor/github.com/xeodou/go-sqlcipher/
go get github.com/OpenBazaar/openbazaar-go

But there is no openssl folder in openssl-1.0.1t/include. The include-folder is completely empty. Am I looking in the wrong place?

@hoffmabc
Copy link
Member

Did you compile OpenSSL?
'''
make
'''

@davalb
Copy link
Contributor

davalb commented Jul 25, 2016

No, I didn't. I just tried, but I get the following error (OSX 10.11.4 El Capitan):

making all in crypto...
make[1]: *** No rule to make target `../include/openssl/bio.h', needed by `cryptlib.o'.  Stop.
make: *** [build_crypto] Error 1

I googled the error, but couldn't find a solution for this problem. It probably is more an OpenSSL problem right?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants