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

Failed to build OpenSSL on El Capitan #69

Closed
zkirill opened this issue Feb 28, 2016 · 5 comments
Closed

Failed to build OpenSSL on El Capitan #69

zkirill opened this issue Feb 28, 2016 · 5 comments

Comments

@zkirill
Copy link

zkirill commented Feb 28, 2016

When running cargo build I was getting this error.

failed to run custom build command for `openssl v0.7.6`
Process didn't exit successfully: `/Users/.../Developer/hello_world/target/debug/build/openssl-09576f2f9776fa80/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
TARGET = Some("x86_64-apple-darwin")
debug=true opt-level=0
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CC_x86_64-apple-darwin = None
CC_x86_64_apple_darwin = None
HOST_CC = None
CC = None
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CFLAGS_x86_64-apple-darwin = None
CFLAGS_x86_64_apple_darwin = None
HOST_CFLAGS = None
CFLAGS = None
running: "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-o" "/Users/.../Developer/hello_world/target/debug/build/openssl-09576f2f9776fa80/out/src/c_helpers.o" "-c" "src/c_helpers.c"
ExitStatus(ExitStatus(256))


command did not execute successfully, got: exit code: 1



--- stderr
src/c_helpers.c:1:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^
1 error generated.
thread '<main>' panicked at 'explicit panic', /Users/.../.cargo/registry/src/github.aaakk.us.kg-88ac128001ac3a9a/gcc-0.3.25/src/lib.rs:818

Fixed by the following:

$ brew uninstall --force openssl
$ brew install openssl
$ brew link --force openssl
$ cargo clean
$ cargo build

Fix from http://stackoverflow.com/questions/30818391/gem-eventmachine-fatal-error-openssl-ssl-h-file-not-found#comment55942148_33956405

Hope that this saves someone else some time.

@geyang
Copy link

geyang commented Aug 7, 2016

Hi, I am running into the same problem. The brew link --force solution does not work with the newest home-brew anymore.

There is an issue under rust-openssl. We might be able to update this package once that is updated.

@geyang
Copy link

geyang commented Aug 8, 2016

The temporary solution is to source the following environment parameters:

export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include

@ax330d
Copy link

ax330d commented Aug 10, 2016

Maybe there is a way to disable openssl? My build is still failing with solutions mentioned before:

<bitflags macros>:89:15: 90:32 error: use of unstable library feature 'op_assign_traits': recently added (see issue #28235)
<bitflags macros>:89  # [ inline ] fn bitor_assign ( & mut self , other : $ BitFlags ) {
<bitflags macros>:90 self . bits |= other . bits ; } } impl $ crate:: __core:: ops:: BitXor for $
<bitflags macros>:8:24: 10:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
<bitflags macros>:134:1: 136:63 note: in this expansion of bitflags! (defined in <bitflags macros>)
/Users/user/.cargo/registry/src/github.aaakk.us.kg-88ac128001ac3a9a/openssl-0.7.14/src/ssl/mod.rs:71:1: 119:2 note: in this expansion of bitflags! (defined in <bitflags macros>)
$ rustc -V
rustc 1.7.0 (a5d1e7a59 2016-02-29)

@illegalprime
Copy link
Collaborator

Hi all,
Sorry for the issues. This seems to be an openssl issue, rather than an issue with this crate. See here: sfackler/rust-openssl#255. From reading it I would either manually link the header to /usr/include or whatever the path is on OSX (I'm on a Linux box). Or use this, which seemed to help: DEP_OPENSSL_INCLUDE=$(brew --prefix openssl)/include cargo build.

@ax330d brings up a good point in that it might be nice to be able to disable openssl, we could work on this feature if it alleviates this issue a bit.

@illegalprime
Copy link
Collaborator

closing this, if you are having trouble because openssl is too old, follow #80 for progress on that.

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

No branches or pull requests

4 participants