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

[Mac] Linking intermittently fails to find openssl symbols #414

Open
JohanLorenzo opened this issue Apr 22, 2016 · 19 comments · Fixed by #433
Open

[Mac] Linking intermittently fails to find openssl symbols #414

JohanLorenzo opened this issue Apr 22, 2016 · 19 comments · Fixed by #433
Labels

Comments

@JohanLorenzo
Copy link
Contributor

JohanLorenzo commented Apr 22, 2016

It occurs roughly 30% of the time on Travis. It can be repro locally.

note: Undefined symbols for architecture x86_64:
  "_EVP_PKEY_derive_init", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_derive_shared_key::h175d3dfd94a1d47a in foxbox.0.o
  "_EVP_PKEY_derive_set_peer", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_derive_shared_key::h175d3dfd94a1d47a in foxbox.0.o
  "_EVP_PKEY_derive", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_derive_shared_key::h175d3dfd94a1d47a in foxbox.0.o
  "_EVP_PKEY_keygen", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_key_pair::h143d2d5e829af360 in foxbox.0.o
  "_EVP_PKEY_CTX_new", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_key_pair::h143d2d5e829af360 in foxbox.0.o
      foxbox::adapters::webpush::crypto::ecdh_derive_shared_key::h175d3dfd94a1d47a in foxbox.0.o
  "_EVP_PKEY_keygen_init", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_key_pair::h143d2d5e829af360 in foxbox.0.o
  "_EVP_PKEY_CTX_free", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_params::hb8c098bbe81f8a8c in foxbox.0.o
      foxbox::adapters::webpush::crypto::ecdh_generate_key_pair::h143d2d5e829af360 in foxbox.0.o
      foxbox::adapters::webpush::crypto::ecdh_derive_shared_key::h175d3dfd94a1d47a in foxbox.0.o
  "_EVP_PKEY_CTX_ctrl", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_params::hb8c098bbe81f8a8c in foxbox.0.o
  "_EVP_PKEY_CTX_new_id", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_params::hb8c098bbe81f8a8c in foxbox.0.o
  "_EVP_PKEY_paramgen", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_params::hb8c098bbe81f8a8c in foxbox.0.o
  "_EVP_PKEY_paramgen_init", referenced from:
      foxbox::adapters::webpush::crypto::ecdh_generate_params::hb8c098bbe81f8a8c in foxbox.0.o
ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Example: https://travis-ci.org/fxbox/foxbox/jobs/124982733#L460

Rusting up to the latest nightly wouldn't solve the problem. See this job for instance

@samgiles
Copy link
Contributor

The weird thing about this is the linker seems to use the "right thing"™.

@samgiles
Copy link
Contributor

samgiles commented Apr 25, 2016

I've been able to reproduce this with this:

rustc src/main.rs --crate-name foxbox --crate-type bin -g --out-dir /Users/sam/code/mozilla/foxbox/target/debug --emit=dep-info,link -L dependency=/Users/sam/code/mozilla/foxbox/target/debug -L dependency=/Users/sam/code/mozilla/foxbox/target/debug/deps --extern time=/Users/sam/code/mozilla/foxbox/target/debug/deps/libtime-71756e48b8b5b73b.rlib --extern foxbox_taxonomy=/Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_taxonomy-95e42626655afe5a.rlib --extern iron=/Users/sam/code/mozilla/foxbox/target/debug/deps/libiron-030140f5d06b3f9b.rlib --extern libc=/Users/sam/code/mozilla/foxbox/target/debug/deps/liblibc-30c6b6751f89189b.rlib --extern unicase=/Users/sam/code/mozilla/foxbox/target/debug/deps/libunicase-2e75ae83bf996d47.rlib --extern mio=/Users/sam/code/mozilla/foxbox/target/debug/deps/libmio-2f74fcaa3855d4d7.rlib --extern rusqlite=/Users/sam/code/mozilla/foxbox/target/debug/deps/librusqlite-174bbbed3cbc60bd.rlib --extern openzwave_adapter=/Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_adapter-af90f0fcc92eaf6a.rlib --extern clippy=/Users/sam/code/mozilla/foxbox/target/debug/deps/libclippy-97fa05f18e912c01.dylib --extern get_if_addrs=/Users/sam/code/mozilla/foxbox/target/debug/deps/libget_if_addrs-04ee712a8f52aa2e.rlib --extern openssl=/Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl-d6a062adf7371fa2.rlib --extern mount=/Users/sam/code/mozilla/foxbox/target/debug/deps/libmount-ab593c7f7630056f.rlib --extern timer=/Users/sam/code/mozilla/foxbox/target/debug/deps/libtimer-621925c22f6c5c0c.rlib --extern env_logger=/Users/sam/code/mozilla/foxbox/target/debug/deps/libenv_logger-54fa0d25029b02ef.rlib --extern rand=/Users/sam/code/mozilla/foxbox/target/debug/deps/librand-c724acb3942597d1.rlib --extern ws=/Users/sam/code/mozilla/foxbox/target/debug/deps/libws-19c3c9b728f5620c.rlib --extern nix=/Users/sam/code/mozilla/foxbox/target/debug/deps/libnix-820c8dac842e4b15.rlib --extern url=/Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-8ed8652dd12957ed.rlib --extern log=/Users/sam/code/mozilla/foxbox/target/debug/deps/liblog-342ffb7444a9471d.rlib --extern foxbox_users=/Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_users-6e77a44a7e9617ca.rlib --extern serde_json=/Users/sam/code/mozilla/foxbox/target/debug/deps/libserde_json-6edc82d6f60f8983.rlib --extern iron_cors=/Users/sam/code/mozilla/foxbox/target/debug/deps/libiron_cors-ab1307d876c26e6e.rlib --extern staticfile=/Users/sam/code/mozilla/foxbox/target/debug/deps/libstaticfile-cde1ec256cec3188.rlib --extern router=/Users/sam/code/mozilla/foxbox/target/debug/deps/librouter-7b4231f02a8668d7.rlib --extern transformable_channels=/Users/sam/code/mozilla/foxbox/target/debug/deps/libtransformable_channels-201b63da869b7630.rlib --extern tls=/Users/sam/code/mozilla/foxbox/target/debug/deps/libtls-4dc6df5fa1cac162.rlib --extern uuid=/Users/sam/code/mozilla/foxbox/target/debug/deps/libuuid-5650c0ca096e22f0.rlib --extern hyper=/Users/sam/code/mozilla/foxbox/target/debug/deps/libhyper-0138d6aa106ddfd5.rlib --extern chrono=/Users/sam/code/mozilla/foxbox/target/debug/deps/libchrono-b7e7e442a0c8b7fb.rlib --extern docopt_macros=/Users/sam/code/mozilla/foxbox/target/debug/deps/libdocopt_macros-d4e707f687cb7e7d.dylib --extern multicast_dns=/Users/sam/code/mozilla/foxbox/target/debug/deps/libmulticast_dns-546a6fa7308632e7.rlib --extern serde=/Users/sam/code/mozilla/foxbox/target/debug/deps/libserde-3a777b14c091f0d1.rlib --extern crypto=/Users/sam/code/mozilla/foxbox/target/debug/deps/libcrypto-bae5fed23a1cbaaf.rlib --extern serde_macros=/Users/sam/code/mozilla/foxbox/target/debug/deps/libserde_macros-eba2c386ff2377e8.dylib --extern openssl_sys=/Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl_sys-5e5868bf50eed157.rlib --extern foxbox_thinkerbell=/Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_thinkerbell-acaa64c52b2a7eca.rlib --extern xml=/Users/sam/code/mozilla/foxbox/target/debug/deps/libxml-4a9c7626f62b4c0d.rlib --extern rustc_serialize=/Users/sam/code/mozilla/foxbox/target/debug/deps/librustc_serialize-3bc953984ed46e7f.rlib --extern docopt=/Users/sam/code/mozilla/foxbox/target/debug/deps/libdocopt-bb161c0e33785889.rlib -L /usr/lib -L native=/Users/sam/code/mozilla/foxbox/target/debug/build/openssl-367a67cf98647b2e/out -L native=/usr/local/opt/openssl/lib -L native=/Users/sam/code/mozilla/foxbox/target/debug/build/openssl-sys-extras-892acb0099c5f8f7/out -L native=/Users/sam/code/mozilla/foxbox/target/debug/build/openzwave-sys-aa2fac941bf1da6a/out -L native=/Users/sam/.multirust/toolchains/nightly-2016-04-10/cargo/git/checkouts/openzwave-rust-3fdf6c635691fa96/master/openzwave-sys/open-zwave -L native=/Users/sam/code/mozilla/foxbox/target/debug/build/rust-crypto-ee392cda555c7573/out

and

cc -m64 -L /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib /Users/sam/code/mozilla/foxbox/target/debug/foxbox.0.o -o /Users/sam/code/mozilla/foxbox/target/debug/foxbox -Wl,-dead_strip -nodefaultlibs -L /Users/sam/code/mozilla/foxbox/target/debug -L /Users/sam/code/mozilla/foxbox/target/debug/deps -L /usr/lib -L /Users/sam/code/mozilla/foxbox/target/debug/build/openssl-367a67cf98647b2e/out -L /usr/local/opt/openssl/lib -L /Users/sam/code/mozilla/foxbox/target/debug/build/openssl-sys-extras-892acb0099c5f8f7/out -L /Users/sam/code/mozilla/foxbox/target/debug/build/openzwave-sys-aa2fac941bf1da6a/out -L /Users/sam/.multirust/toolchains/nightly-2016-04-10/cargo/git/checkouts/openzwave-rust-3fdf6c635691fa96/master/openzwave-sys/open-zwave -L /Users/sam/code/mozilla/foxbox/target/debug/build/rust-crypto-ee392cda555c7573/out -L /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib -l upnp /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_adapter-af90f0fcc92eaf6a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libget_if_addrs-04ee712a8f52aa2e.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_users-6e77a44a7e9617ca.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libiron_cors-ab1307d876c26e6e.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnix-820c8dac842e4b15.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmulticast_dns-546a6fa7308632e7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libws-19c3c9b728f5620c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libenv_logger-54fa0d25029b02ef.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libdocopt-bb161c0e33785889.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libjwt-f0321a64b372a700.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmio-2f74fcaa3855d4d7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbytes-2fbbdda5bbde5111.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnix-b32558dd955ccdf5.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmiow-ba6e9462e2153813.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnet2-559ba40c19f23b6a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libwinapi-42bc588a308ea664.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libws2_32-2f1486c4a679970f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libstrsim-7ec45c0f17103caa.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libxml-4a9c7626f62b4c0d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburlencoded-6533c5812dfae2bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbodyparser-b483bd4ce8bf70e4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-8f3a72597d799863.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtls-4dc6df5fa1cac162.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmktemp-9a8e0479ed5ebb2a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-d06009685951cc56.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libip-f5294d306c5e5c51.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librouter-7b4231f02a8668d7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libroute_recognizer-d498a0086c418cc4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libstaticfile-cde1ec256cec3188.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmount-d8b63956a0ae9034.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libslab-22c48cf3d25bac5c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmount-ab593c7f7630056f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsequence_trie-00072ea8be8f33bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libregex-a51d4cf4c0db8c6c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libthread_local-f2c1cfb0d717958d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libaho_corasick-13668caf93db7fdf.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmemchr-eee90be3d2b5052f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libthread_id-ed3f7011bd9c5aa2.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libregex_syntax-fca6b3d9bd2fccee.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsha1-c425125a7e359086.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbyteorder-8ad3fd7ac7478b9a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_thinkerbell-acaa64c52b2a7eca.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_taxonomy-95e42626655afe5a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtransformable_channels-201b63da869b7630.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsublock-8d1766a790a0c5c5.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librusqlite-174bbbed3cbc60bd.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibsqlite3_sys-f35d4b013c8b0194.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libserde_json-6edc82d6f60f8983.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libstring_cache-f778c0f667839a40.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libdebug_unreachable-ec2fe2296ce40c81.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunreachable-bc14e2c0e4546da4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libserde-3a777b14c091f0d1.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libphf_shared-d029ae6892b0fb46.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-d88a99e5825ec8bf.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_stateful-cf16021e4f4a0aa6.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave-838cda4ce99eb110.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libitertools-c7aba225c495f9d3.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_sys-dcbe050cf490846a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libuuid-5650c0ca096e22f0.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libvoid-e0a8882c9c925513.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcfg_if-0a8d2242d60f8925.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libkernel32-757937e2863677bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libutf8_ranges-a6119bc781af556b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtimer-621925c22f6c5c0c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libchrono-b7e7e442a0c8b7fb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libpwhash-84a2bacb6eed5026.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcrypto-bae5fed23a1cbaaf.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibc-5eb0f3d71076a4bc.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libc_linked_list-ff0b7ecfb8e6ce0d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libpersistent-d202c20885f8e9fb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libiron-030140f5d06b3f9b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhyper-0138d6aa106ddfd5.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liberror-104d955ec44f5893.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcookie-276cf5002a04c35b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl-d6a062adf7371fa2.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtime-71756e48b8b5b73b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtraitobject-3d4dcec5d1662e96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-b378ff20d60f43f8.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libconduit_mime_types-46cd83f432dffe61.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblanguage_tags-1cb52046c41cf66a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicase-2e75ae83bf996d47.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmodifier-932fdf4731542a6e.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtypeable-1604229584d39a42.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsolicit-8f0dfee0deffeb96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmime-b67d6d6511d55d94.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblazy_static-5853c3b37be48a6a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-8ed8652dd12957ed.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicode_normalization-f33127ef3e902b05.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libuuid-4661ec327561dea0.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librand-c724acb3942597d1.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhttparse-9ed9b694220e1406.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblazy_static-5e6d9f365bf63baa.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhpack-320332c60c4dfc72.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblog-342ffb7444a9471d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libserde-db1be5227e810a92.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicode_bidi-7a56a7dec369a022.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libplugin-444bd670a4e5a6a7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtypemap-71d41707b27a594c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunsafe_any-558bd65478773c01.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtraitobject-33ecb530d17570ac.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum-98981edb917831dc.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_iter-5766581f7597a504.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_integer-8f7844108d7e0eab.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_traits-14a2d70fdb554c2a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl_sys_extras-e04a13dc85856c73.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl_sys-5e5868bf50eed157.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librustc_serialize-3bc953984ed46e7f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_cpus-a5254d7bdb51bb96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibc-30c6b6751f89189b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmatches-030a774745cc4f96.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/libstd-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/libcollections-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/librand-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/liballoc-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/liblibc-18402db3.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-10/lib/rustlib/x86_64-apple-darwin/lib/libcore-18402db3.rlib -l sqlite3 -l sqlite3 -l sqlite3 -framework IOKit -framework CoreFoundation -l c++ -l c -l m -l ssl -l crypto -l System -l pthread -l c -l m -l compiler-rt

I'll take a look at this while it's not intermittent for me.

@JohanLorenzo
Copy link
Contributor Author

JohanLorenzo commented Apr 26, 2016

@julienw and I managed to reproduce the problem while working on #430. We discovered that -L /usr/lib is sometimes defined before -L native=/usr/local/opt/openssl/lib (which is the case in sam's command line).

On Mac OS X, the documentation of ld reads:

Directories specified with -L are searched in the order they appear on the command line and before the default search path.

@julienw pointed out that /usr/lib shouldn't be defined as a custom search path. After a grep usr/lib target/debug/build/*/output, we found out that rusqlite specifically defines that path as one to search in. As a consequence, we need to find out why pkg_config doesn't work with rusqlite.

A temporary workaround could be to define the env variable SQLITE3_LIB_DIR so we don't have to deal with /usr/lib anymore.

I propose we define that variable in the MacOSX job on travis, and we document it in the README., Then we would be able to fix rusqlite.

@JohanLorenzo JohanLorenzo self-assigned this Apr 26, 2016
@julienw
Copy link
Contributor

julienw commented Apr 26, 2016

So the root cause is: rust-lang/pkg-config-rs#11

@julienw
Copy link
Contributor

julienw commented Apr 26, 2016

A workaround could be to install libsqlite3 through brew so that pkg-config does not givesystem libs.

@julienw
Copy link
Contributor

julienw commented Apr 26, 2016

As a consequence, we need to find out why pkg_config doesn't work with rusqlite.

This was not clear above: actually pkg-config works perfectly, but because libsqlite3 is installed in the system (as opposed as using brew) and the pkg-config rust crate uses PKG_CONFIG_ALLOW_SYSTEM_LIBS, we end up with this -L/usr/lib.

@cr
Copy link
Contributor

cr commented May 4, 2016

It seems like this is way easier to trigger when switching between cargo test and cargo build.

@julienw
Copy link
Contributor

julienw commented May 9, 2016

is this still happening to you @cr ?

@cr
Copy link
Contributor

cr commented May 9, 2016

Yes, I still see it every now and then with latest master. @julienw

@julienw
Copy link
Contributor

julienw commented May 9, 2016

@cr
Copy link
Contributor

cr commented May 10, 2016

Yes, but not following these results in a very different and permanent error.

@isabelrios
Copy link
Contributor

Hi, I am also seeing this issue even following those steps before launching foxbox.

@julienw
Copy link
Contributor

julienw commented May 10, 2016

So you still see the same error than in #414 (comment) ?

@JohanLorenzo
Copy link
Contributor Author

JohanLorenzo commented May 10, 2016

@cr @isabelrios, when the next failure occurs, could you paste the output of these commands?

echo "$SQLITE3_LIB_DIR"
cargo build --verbose # let's see if the order is similar to https://github.com/fxbox/foxbox/issues/414#issuecomment-214258407 

@isabelrios
Copy link
Contributor

@julienw, yes, not always but I can see it.
Sure @JohanLorenzo, I will paste that information

@samgiles
Copy link
Contributor

samgiles commented May 10, 2016

@JohanLorenzo I just saw this, but on trying to re-run I achieved success

$ source tools/mac-os-x-setup.source.sh
$ echo $SQLITE3_LIB_DIR
/usr/local/opt/sqlite/lib

The linker arguments this time:

cc -m64 -L /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib /Users/sam/code/mozilla/foxbox/target/debug/foxbox.0.o -o /Users/sam/code/mozilla/foxbox/target/debug/foxbox -Wl,-dead_strip -nodefaultlibs -L /Users/sam/code/mozilla/foxbox/target/debug -L /Users/sam/code/mozilla/foxbox/target/debug/deps -L /usr/local/Cellar/libupnp/1.6.19/lib -L /usr/lib -L /usr/local/opt/openssl/lib -L /Users/sam/code/mozilla/foxbox/target/debug/build/openssl-367a67cf98647b2e/out -L /Users/sam/code/mozilla/foxbox/target/debug/build/openssl-sys-extras-892acb0099c5f8f7/out -L /Users/sam/code/mozilla/foxbox/target/debug/build/rust-crypto-ee392cda555c7573/out -L /Users/sam/code/mozilla/foxbox/target/debug/build/openzwave-sys-aa2fac941bf1da6a/out -L /Users/sam/code/mozilla/foxbox/target/debug/build/openzwave-sys-aa2fac941bf1da6a/out/open-zwave -L /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib -l upnp -l upnp -l threadutil -l ixml /Users/sam/code/mozilla/foxbox/target/debug/deps/libstaticfile-a390d056b6777175.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_thinkerbell-acaa64c52b2a7eca.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmulticast_dns-546a6fa7308632e7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libws-9351b3aa8da9a4f4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmio-2f74fcaa3855d4d7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libslab-22c48cf3d25bac5c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmiow-ba6e9462e2153813.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmount-d8b63956a0ae9034.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsequence_trie-00072ea8be8f33bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libxml-a444840e842f2c36.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-1b9f7576da940a38.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtls-4dc6df5fa1cac162.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmktemp-9a8e0479ed5ebb2a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnix-b32558dd955ccdf5.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-d06009685951cc56.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libget_if_addrs-04ee712a8f52aa2e.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libc_linked_list-ff0b7ecfb8e6ce0d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_users-b17c121f44a42b88.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librouter-7b4231f02a8668d7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburlencoded-6533c5812dfae2bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libiron_cors-bcfbff19a08eef03.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libroute_recognizer-d498a0086c418cc4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libpwhash-84a2bacb6eed5026.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnix-820c8dac842e4b15.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbytes-2fbbdda5bbde5111.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libdocopt-bb161c0e33785889.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libstrsim-7ec45c0f17103caa.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsha1-c425125a7e359086.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbyteorder-8ad3fd7ac7478b9a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libenv_logger-54fa0d25029b02ef.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libregex-2e80053c0bc79b68.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libaho_corasick-763321738616ae26.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmemchr-eee90be3d2b5052f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libthread_local-714e7c87f8641cbc.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libthread_id-ed3f7011bd9c5aa2.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libutf8_ranges-a6119bc781af556b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_adapter-af90f0fcc92eaf6a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_stateful-cf16021e4f4a0aa6.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave-838cda4ce99eb110.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libitertools-c7aba225c495f9d3.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenzwave_sys-dcbe050cf490846a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libfoxbox_taxonomy-95e42626655afe5a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsublock-8d1766a790a0c5c5.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtransformable_channels-201b63da869b7630.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librusqlite-174bbbed3cbc60bd.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-d88a99e5825ec8bf.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibsqlite3_sys-f35d4b013c8b0194.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libstring_cache-ff2df319d2671c9c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libdebug_unreachable-e2d232c4ed5ce96c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libphf_shared-d029ae6892b0fb46.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-8f3a72597d799863.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libuuid-5650c0ca096e22f0.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunreachable-bc14e2c0e4546da4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libvoid-e0a8882c9c925513.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnet2-559ba40c19f23b6a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libkernel32-757937e2863677bb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libwinapi-42bc588a308ea664.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libws2_32-2f1486c4a679970f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcfg_if-0a8d2242d60f8925.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libregex_syntax-fca6b3d9bd2fccee.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtimer-621925c22f6c5c0c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libchrono-086951ef1dea2712.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libjwt-f0321a64b372a700.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcrypto-bae5fed23a1cbaaf.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibc-5eb0f3d71076a4bc.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libip-f5294d306c5e5c51.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbodyparser-b483bd4ce8bf70e4.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libpersistent-d202c20885f8e9fb.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libiron-a24810b773927e28.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liberror-104d955ec44f5893.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhyper-8783e630ef040c44.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libplugin-444bd670a4e5a6a7.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libcookie-b2e1d689a1ae5738.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_cpus-a5254d7bdb51bb96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-3c116f81be85494f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblanguage_tags-1cb52046c41cf66a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liburl-8ed8652dd12957ed.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtraitobject-3d4dcec5d1662e96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libserde_json-6edc82d6f60f8983.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libserde-8b9072b32862ba74.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtypemap-71d41707b27a594c.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunsafe_any-558bd65478773c01.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmime-70929d5d5f4a3c77.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libidna-cfd533a97becc7e1.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicode_normalization-f33127ef3e902b05.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libconduit_mime_types-46cd83f432dffe61.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicase-2e75ae83bf996d47.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum-98981edb917831dc.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_iter-5766581f7597a504.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_integer-8f7844108d7e0eab.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libunicode_bidi-7a56a7dec369a022.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtypeable-1604229584d39a42.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblazy_static-5e6d9f365bf63baa.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl-d6a062adf7371fa2.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblazy_static-a81b08a56ec46bff.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libbitflags-b378ff20d60f43f8.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtraitobject-33ecb530d17570ac.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librustc_serialize-3bc953984ed46e7f.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl_sys_extras-e04a13dc85856c73.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libopenssl_sys-5e5868bf50eed157.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmodifier-932fdf4731542a6e.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libnum_traits-14a2d70fdb554c2a.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libtime-71756e48b8b5b73b.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhttparse-9ed9b694220e1406.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libuuid-ad64362ac96e59a8.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/librand-c724acb3942597d1.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblibc-38919d24e617a235.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libsolicit-8f0dfee0deffeb96.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libhpack-320332c60c4dfc72.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/liblog-342ffb7444a9471d.rlib /Users/sam/code/mozilla/foxbox/target/debug/deps/libmatches-030a774745cc4f96.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/libstd-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/libcollections-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/librand-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/liballoc-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/liblibc-cb705824.rlib /Users/sam/.multirust/toolchains/nightly-2016-04-29/lib/rustlib/x86_64-apple-darwin/lib/libcore-cb705824.rlib -framework IOKit -framework CoreFoundation -l c++ -l sqlite3 -l sqlite3 -l sqlite3 -l c -l m -l ssl -l crypto -l System -l pthread -l c -l m -l compiler-rt

Couldn't reproduce to get more than that I'm afraid.

@JohanLorenzo
Copy link
Contributor Author

@samgiles -L /usr/lib is still in front of -L /usr/local/opt/openssl/lib. The linker doesn't use sqlite located at /usr/local/opt/sqlite/lib. My current guesses are:

  • either $SQLITE3_LIB_DIR is not used in this particular context
  • or it's unset somewhere in the middle

@samgiles
Copy link
Contributor

Indeed, if it happens again, I'll investigate further.

@JohanLorenzo
Copy link
Contributor Author

Following up. Have any of you guys encountered that problem for the past month?

If not, would you be okay if we closed that issue?

@JohanLorenzo JohanLorenzo removed their assignment Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants