cretz / tor-static

Helpers to build Tor statically
MIT License
85 stars 37 forks source link

Unable to verify build on Mac osx 10.15 #30

Open yamamushi opened 4 years ago

yamamushi commented 4 years ago

After building with (which didn't fail with any errors, and appears to have completed successfully because of the "Done building all" message after it finished):

CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go run build.go -verbose build-all

Then running

go get -u github.com/cretz/bine/tor

I'm still unable to actually run the provided tests (or any other examples using embedded tor):

$ go test -v build_test.go -tor.verbose
# github.com/cretz/bine/process/embedded/tor-0.3.5
Undefined symbols for architecture x86_64:
  "_libscrypt_scrypt", referenced from:
      _secret_to_key_compute_key in libtor-crypt-ops.a(libtor_crypt_ops_a-crypto_s2k.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
FAIL    command-line-arguments [build failed]
FAIL

Here is the output of show-libs:

$ go run build.go show-libs
-Ltor/src/core -ltor-app
-Ltor/src/lib -ltor-compress -ltor-evloop -ltor-tls -ltor-crypt-ops -lcurve25519_donna -ltor-geoip -ltor-process -ltor-time -ltor-fs -ltor-encoding -ltor-sandbox -ltor-container -ltor-net -ltor-thread -ltor-memarea -ltor-math -ltor-meminfo -ltor-osinfo -ltor-log -ltor-lock -ltor-fdio -ltor-string -ltor-term -ltor-smartlist-core -ltor-malloc -ltor-wallclock -ltor-err -ltor-intmath -ltor-ctime -ltor-trace
-Ltor/src/ext/keccak-tiny -lkeccak-tiny
-Ltor/src/ext/ed25519/ref10 -led25519_ref10
-Ltor/src/ext/ed25519/donna -led25519_donna
-Ltor/src/trunnel -lor-trunnel
-Llibevent/dist/lib -levent
-Lxz/dist/lib -llzma
-Lzlib/dist/lib -lz
-Lopenssl/dist/lib -lssl -lcrypto
yamamushi commented 4 years ago

It's also probably worth pointing out that the Travis builds for osx seem to have been failing for the past few months :)

https://travis-ci.org/cretz/tor-static/jobs/605723231

cretz commented 4 years ago

Hrmm, yeah I do all my work on Windows and Linux, so I haven't worked with macOS (I usually have a friend verify macOS). I see https://github.com/zcoinofficial/zcoin/issues/352 references a similar bug and says it was a system issue. At first glance it appears to be a libscrypt issue. Can you install libscrypt-dev and retry? Technically I think Tor is suppose to be able to build and run fine without scrypt present (it's optional), but it appears something is requiring it here. Anything you can find while debugging would be appreciated.

coupez commented 4 years ago

Actually, I had this same issue and it turned out to be because I had tor (and thus libscrypt) installed via brew. After uninstalling libscrypt (brew uninstall libscrypt) I could build my application.