Faild build On OSX 10.11(Elp) #255

Closed
imiskolee opened this Issue Aug 19, 2015 · 42 comments

Comments

@imiskolee

failed to run custom build command for openssl-sys v0.6.4
Process didn't exit successfully: /Users/misko/developer/rust_projects/aws-simple-sdk.rs/target/debug/build/openssl-sys-149f6ef08ad7404d/build-script-build (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto
cargo:rustc-link-lib=z
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
CARGO_MANIFEST_DIR = Some("/Users/misko/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.6.4")
OUT_DIR = Some("/Users/misko/developer/rust_projects/aws-simple-sdk.rs/target/debug/build/openssl-sys-149f6ef08ad7404d/out")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
debug 0
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
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" "-c" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-o" "/Users/misko/developer/rust_projects/aws-simple-sdk.rs/target/debug/build/openssl-sys-149f6ef08ad7404d/out/src/openssl_shim.o" "/Users/misko/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.6.4/src/openssl_shim.c"

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

--- stderr
/Users/misko/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.6.4/src/openssl_shim.c:1:10: fatal error: 'openssl/hmac.h' file not found

include <openssl/hmac.h>

     ^

1 error generated.
thread '

' panicked at 'explicit panic', /Users/misko/.cargo/registry/src/github.com-1ecc6299db9ec823/gcc-0.3.13/src/lib.rs:510

@robertlong

This comment has been minimized.

Show comment
Hide comment
@robertlong

robertlong Aug 20, 2015

I'm also seeing the same issue on OSX 10.11

failed to run custom build command for `openssl-sys v0.6.4`
Process didn't exit successfully: `/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto
cargo:rustc-link-lib=z
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
CARGO_MANIFEST_DIR = Some("/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4")
OUT_DIR = Some("/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/out")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
debug 0
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
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" "-c" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-o" "/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/out/src/openssl_shim.o" "/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4/src/openssl_shim.c"


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



--- stderr
/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4/src/openssl_shim.c:1:10: fatal error: 'openssl/hmac.h' file not found
#include <openssl/hmac.h>
         ^
1 error generated.
thread '<main>' panicked at 'explicit panic', /Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/gcc-0.3.11/src/lib.rs:514
stack backtrace:
   1:        0x10ff0f1b5 - sys::backtrace::write::h6ddc342d792b0e00eys
   2:        0x10ff18740 - panicking::on_panic::h958ebf4d6905d53emex
   3:        0x10fed1762 - rt::unwind::begin_unwind_inner::hbd872a23a0e4a7d76Hw
   4:        0x10fe2c9cc - rt::unwind::begin_unwind::h4878656591332600981
   5:        0x10fe25ed0 - fail::h760db72685f0b7d0COa
   6:        0x10fe36058 - run::h77877c702f7c820fKHa
   7:        0x10fe2f9a9 - Config::compile_object::h7f3ab7454f729dd6ema
   8:        0x10fe293fb - Config::compile::h7653fa0ba387c0b8Rha
   9:        0x10fdf88a7 - build_openssl_shim::h5076206d24a8328fSfa
  10:        0x10fdf1043 - main::h53a555fd2c70138diaa
  11:        0x10ff17fad - __rust_try
  12:        0x10ff196cd - rt::lang_start::ha6eaa4ada71a9cdbh9w
  13:        0x10fe0064e - main

I'm also seeing the same issue on OSX 10.11

failed to run custom build command for `openssl-sys v0.6.4`
Process didn't exit successfully: `/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-search=native=/usr/lib
cargo:rustc-link-lib=ssl
cargo:rustc-link-lib=crypto
cargo:rustc-link-lib=z
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
CARGO_MANIFEST_DIR = Some("/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4")
OUT_DIR = Some("/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/out")
OPT_LEVEL = Some("0")
PROFILE = Some("debug")
debug 0
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
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" "-c" "-ffunction-sections" "-fdata-sections" "-g" "-m64" "-fPIC" "-o" "/Users/robertlong/workspace/eve/runtime/target/debug/build/openssl-sys-765ddf9de3c5179c/out/src/openssl_shim.o" "/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4/src/openssl_shim.c"


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



--- stderr
/Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/openssl-sys-0.6.4/src/openssl_shim.c:1:10: fatal error: 'openssl/hmac.h' file not found
#include <openssl/hmac.h>
         ^
1 error generated.
thread '<main>' panicked at 'explicit panic', /Users/robertlong/.multirust/toolchains/nightly-2015-08-10/cargo/registry/src/github.com-0a35038f75765ae4/gcc-0.3.11/src/lib.rs:514
stack backtrace:
   1:        0x10ff0f1b5 - sys::backtrace::write::h6ddc342d792b0e00eys
   2:        0x10ff18740 - panicking::on_panic::h958ebf4d6905d53emex
   3:        0x10fed1762 - rt::unwind::begin_unwind_inner::hbd872a23a0e4a7d76Hw
   4:        0x10fe2c9cc - rt::unwind::begin_unwind::h4878656591332600981
   5:        0x10fe25ed0 - fail::h760db72685f0b7d0COa
   6:        0x10fe36058 - run::h77877c702f7c820fKHa
   7:        0x10fe2f9a9 - Config::compile_object::h7f3ab7454f729dd6ema
   8:        0x10fe293fb - Config::compile::h7653fa0ba387c0b8Rha
   9:        0x10fdf88a7 - build_openssl_shim::h5076206d24a8328fSfa
  10:        0x10fdf1043 - main::h53a555fd2c70138diaa
  11:        0x10ff17fad - __rust_try
  12:        0x10ff196cd - rt::lang_start::ha6eaa4ada71a9cdbh9w
  13:        0x10fe0064e - main
@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Aug 20, 2015

Owner

It looks like OSX 10.11 doesn't ship with openssl anymore. You'll need to install your own copy I guess.

Owner

sfackler commented Aug 20, 2015

It looks like OSX 10.11 doesn't ship with openssl anymore. You'll need to install your own copy I guess.

@imiskolee

This comment has been minimized.

Show comment
Hide comment
@imiskolee

imiskolee Aug 21, 2015

i fix it as:
first,i compliing openssl-sys success.
than, compliing openssl it success.

i fix it as:
first,i compliing openssl-sys success.
than, compliing openssl it success.

@paulrouget

This comment has been minimized.

Show comment
Hide comment
@paulrouget

paulrouget Aug 21, 2015

This worked for me (when building Servo):

export OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2d_1/include/

This worked for me (when building Servo):

export OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2d_1/include/
@back2mach

This comment has been minimized.

Show comment
Hide comment
@back2mach

back2mach Sep 27, 2015

I install the openssl using Homebrew, and the this works for me:
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include

I install the openssl using Homebrew, and the this works for me:
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include

@ogham

This comment has been minimized.

Show comment
Hide comment
@ogham

ogham Oct 1, 2015

I had to do both of the following to get it to work, rather than just the first one (fish, not bash). Not sure what is up with that, but if the above by itself doesn't work, try this!

set -x OPENSSL_INCLUDE_DIR /usr/local/opt/openssl/include
set -x OPENSSL_ROOT_DIR /usr/local/opt/openssl
$ brew info openssl
openssl: stable 1.0.2d (bottled)

ogham commented Oct 1, 2015

I had to do both of the following to get it to work, rather than just the first one (fish, not bash). Not sure what is up with that, but if the above by itself doesn't work, try this!

set -x OPENSSL_INCLUDE_DIR /usr/local/opt/openssl/include
set -x OPENSSL_ROOT_DIR /usr/local/opt/openssl
$ brew info openssl
openssl: stable 1.0.2d (bottled)
@larsbergstrom

This comment has been minimized.

Show comment
Hide comment
@larsbergstrom

larsbergstrom Oct 2, 2015

Contributor

I also had success doing brew link --force openssl - that was enough to get Servo building for me again. The OSX update perhaps reset a bunch of symlinks?

Contributor

larsbergstrom commented Oct 2, 2015

I also had success doing brew link --force openssl - that was enough to get Servo building for me again. The OSX update perhaps reset a bunch of symlinks?

@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Oct 2, 2015

Owner

OSX doesn't ship OpenSSL headers anymore starting with El Capitan.

Owner

sfackler commented Oct 2, 2015

OSX doesn't ship OpenSSL headers anymore starting with El Capitan.

@k4rtik

This comment has been minimized.

Show comment
Hide comment
@k4rtik

k4rtik Oct 8, 2015

Same observation as #255 (comment), relinking openssl with brew fixed the build for me as well.

k4rtik commented Oct 8, 2015

Same observation as #255 (comment), relinking openssl with brew fixed the build for me as well.

@k4rtik

This comment has been minimized.

Show comment
Hide comment
@k4rtik

k4rtik Oct 8, 2015

But probably it's not the best solution to this problem, as brew doctor produces a new warning now:

$ brew doctor
[...]
Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
    openssl

k4rtik commented Oct 8, 2015

But probably it's not the best solution to this problem, as brew doctor produces a new warning now:

$ brew doctor
[...]
Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
    openssl
@tpberntsen

This comment has been minimized.

Show comment
Hide comment
@tpberntsen

tpberntsen Oct 8, 2015

Same problem here on Mac OS X 10.11 (El Capitan). Running brew link --force openssl (as mentioned elsewhere in this thread) solved the problem, and things compiled beautifully.

Same problem here on Mac OS X 10.11 (El Capitan). Running brew link --force openssl (as mentioned elsewhere in this thread) solved the problem, and things compiled beautifully.

@DrewHood

This comment has been minimized.

Show comment
Hide comment
@DrewHood

DrewHood Oct 17, 2015

Hey folks, same issue. Unfortunately the Homebrew solution didn't work for me. Anyone have any other ideas?

Hey folks, same issue. Unfortunately the Homebrew solution didn't work for me. Anyone have any other ideas?

@killercup

This comment has been minimized.

Show comment
Hide comment
@killercup

killercup Oct 18, 2015

brew link --force openssl worked for me on OS X 10.11. Might be good to mention this in Servo's Readme.

brew link --force openssl worked for me on OS X 10.11. Might be good to mention this in Servo's Readme.

@imiskolee

This comment has been minimized.

Show comment
Hide comment
@imiskolee

imiskolee Oct 19, 2015

thinks.is fix.

thinks.is fix.

@imiskolee imiskolee closed this Oct 19, 2015

@untitaker untitaker referenced this issue in untitaker/mysteryshack Nov 2, 2015

Closed

Build fails on Mac OS X 10.11 #7

@iszak

This comment has been minimized.

Show comment
Hide comment
@iszak

iszak Dec 8, 2015

I tried all the suggestions in this ticket, I am using homebrew via boxen so my openssl is installed under /opt/boxen/homebrew/Cellar/openssl/1.0.2e/include/ on OS X 10.11.2 (El Capitan) and this solved it for me

export C_INCLUDE_PATH=/opt/boxen/homebrew/Cellar/openssl/1.0.2e/include

I am posting this in an effort to help any others seeking to find a solution

iszak commented Dec 8, 2015

I tried all the suggestions in this ticket, I am using homebrew via boxen so my openssl is installed under /opt/boxen/homebrew/Cellar/openssl/1.0.2e/include/ on OS X 10.11.2 (El Capitan) and this solved it for me

export C_INCLUDE_PATH=/opt/boxen/homebrew/Cellar/openssl/1.0.2e/include

I am posting this in an effort to help any others seeking to find a solution

@Alsmile

This comment has been minimized.

Show comment
Hide comment
@Alsmile

Alsmile Dec 10, 2015

I fix it as:
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include

Alsmile commented Dec 10, 2015

I fix it as:
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include

@ar-jan

This comment has been minimized.

Show comment
Hide comment
@ar-jan

ar-jan Dec 14, 2015

I have the same problem on Ubuntu 14.04, any ideas what to do there?

I have this:
$ /usr/bin/openssl version
OpenSSL 1.0.1f 6 Jan 2014

Though which openssl points to my Anaconda installation, /home/arjan/Programs/anaconda3/bin/openssl (OpenSSL 1.0.1k 8 Jan 2015).

ar-jan commented Dec 14, 2015

I have the same problem on Ubuntu 14.04, any ideas what to do there?

I have this:
$ /usr/bin/openssl version
OpenSSL 1.0.1f 6 Jan 2014

Though which openssl points to my Anaconda installation, /home/arjan/Programs/anaconda3/bin/openssl (OpenSSL 1.0.1k 8 Jan 2015).

@ar-jan

This comment has been minimized.

Show comment
Hide comment
@ar-jan

ar-jan Dec 14, 2015

Never mind, my issue was while installing Eve, and there I found a solution, sudo apt-get install libssl-dev.

ar-jan commented Dec 14, 2015

Never mind, my issue was while installing Eve, and there I found a solution, sudo apt-get install libssl-dev.

@herrernst

This comment has been minimized.

Show comment
Hide comment
@herrernst

herrernst Dec 16, 2015

As iszak mentioned, I too had to export C_INCLUDE_PATH on OS X 10.11.2, just exporting OPENSSL_INCLUDE_DIR had no effect.

As iszak mentioned, I too had to export C_INCLUDE_PATH on OS X 10.11.2, just exporting OPENSSL_INCLUDE_DIR had no effect.

@andrewtj

This comment has been minimized.

Show comment
Hide comment
@andrewtj

andrewtj Dec 16, 2015

@herrernst Try cargo clean and then build with OPENSSL_INCLUDE_DIR and OPENSSL_LIB_DIR set. See #316 for further commentary on why you should set both.

@herrernst Try cargo clean and then build with OPENSSL_INCLUDE_DIR and OPENSSL_LIB_DIR set. See #316 for further commentary on why you should set both.

@herrernst

This comment has been minimized.

Show comment
Hide comment
@herrernst

herrernst Dec 16, 2015

@andrewtj You're right, thanks.

@andrewtj You're right, thanks.

@bahrunnur bahrunnur referenced this issue in tldr-pages/tldr Jan 3, 2016

Merged

Add Rust client to README.md #551

@toddself toddself referenced this issue in brianloveswords/hookshot Jan 4, 2016

Closed

Update requirements in readme #31

@tamird

This comment has been minimized.

Show comment
Hide comment
@tamird

tamird Jan 11, 2016

This is still an issue; it was not helped by brew link.

DEP_OPENSSL_INCLUDE=$(brew --prefix openssl)/include cargo run did the trick.

tamird commented Jan 11, 2016

This is still an issue; it was not helped by brew link.

DEP_OPENSSL_INCLUDE=$(brew --prefix openssl)/include cargo run did the trick.

@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Jan 11, 2016

Owner

@tamird did you cargo clean after brew linking?

Owner

sfackler commented Jan 11, 2016

@tamird did you cargo clean after brew linking?

@tamird

This comment has been minimized.

Show comment
Hide comment
@tamird

tamird Jan 11, 2016

I hadn't. I just repeated the procedure; cargo clean after brew link indeed fixed this. I don't quite understand why, though. Environment state is being compiled into the build script?

tamird commented Jan 11, 2016

I hadn't. I just repeated the procedure; cargo clean after brew link indeed fixed this. I don't quite understand why, though. Environment state is being compiled into the build script?

@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Jan 11, 2016

Owner

openssl-sys's build script determines the location of openssl's headers and Cargo will pass them onto dependent crates via the DEP_OPENSSL_INCLUDE environment variable. If the headers are missing, openssl-sys will compile successfully but forward the wrong vlaue of DEP_OPENSSL_INCLUDE along to downstream crates. If we force openssl-sys to rebuild, it'll pass along the correct configuration.

Owner

sfackler commented Jan 11, 2016

openssl-sys's build script determines the location of openssl's headers and Cargo will pass them onto dependent crates via the DEP_OPENSSL_INCLUDE environment variable. If the headers are missing, openssl-sys will compile successfully but forward the wrong vlaue of DEP_OPENSSL_INCLUDE along to downstream crates. If we force openssl-sys to rebuild, it'll pass along the correct configuration.

@polyfractal polyfractal referenced this issue in polyfractal/playground Jan 13, 2016

Open

Failed build when executing cargo build #1

@dendisuhubdy dendisuhubdy referenced this issue in laurentluce/twilio-cplusplus Jan 25, 2016

Open

Using OpenSSL #2

@solidsnack

This comment has been minimized.

Show comment
Hide comment
@solidsnack

solidsnack Mar 6, 2016

Worked for me:

export C_INCLUDE_PATH=/usr/local/Cellar/openssl/1.0.2f/include

Worked for me:

export C_INCLUDE_PATH=/usr/local/Cellar/openssl/1.0.2f/include
@KodrAus

This comment has been minimized.

Show comment
Hide comment
@KodrAus

KodrAus Mar 7, 2016

No combination of the above suggestions seem to be working for me... I either get a link error for openssl/hmac.h in openssl-sys-extras v0.7.6 or a link error for openssl/ssl.h in openssl v0.7.6

KodrAus commented Mar 7, 2016

No combination of the above suggestions seem to be working for me... I either get a link error for openssl/hmac.h in openssl-sys-extras v0.7.6 or a link error for openssl/ssl.h in openssl v0.7.6

@seangrogg

This comment has been minimized.

Show comment
Hide comment
@seangrogg

seangrogg Mar 11, 2016

Fixed with Alsmile's recommendation:

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

Fixed with Alsmile's recommendation:

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

This comment has been minimized.

Show comment
Hide comment
@kometen

kometen Mar 19, 2016

Fixed with Alsmile's recommendation using macports:

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

kometen commented Mar 19, 2016

Fixed with Alsmile's recommendation using macports:

export DEP_OPENSSL_INCLUDE=/opt/local/include         
export OPENSSL_INCLUDE_DIR=/opt/local/include         
@KodrAus

This comment has been minimized.

Show comment
Hide comment
@KodrAus

KodrAus Mar 26, 2016

I couldn't get any suggestions to work, but a clean install of OSX 10.11 with brew link --force openssl did fix this for me.

KodrAus commented Mar 26, 2016

I couldn't get any suggestions to work, but a clean install of OSX 10.11 with brew link --force openssl did fix this for me.

@denen99

This comment has been minimized.

Show comment
Hide comment
@denen99

denen99 Apr 6, 2016

I had to update CLFAGS with

export CFLAGS="-I /usr/local/opt/openssl/include"

denen99 commented Apr 6, 2016

I had to update CLFAGS with

export CFLAGS="-I /usr/local/opt/openssl/include"

@alexreidy

This comment has been minimized.

Show comment
Hide comment
@alexreidy

alexreidy Jun 4, 2016

Thanks guys. I first tried the brew link to no avail, but compilation succeeded after the exports.

brew link --force openssl
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include 
export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include

This was on Yosemite 10.10.5

Thanks guys. I first tried the brew link to no avail, but compilation succeeded after the exports.

brew link --force openssl
export OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include 
export DEP_OPENSSL_INCLUDE=/usr/local/opt/openssl/include

This was on Yosemite 10.10.5

@e-oz

This comment has been minimized.

Show comment
Hide comment
@e-oz

e-oz Jul 11, 2016

@larsbergstrom thank you very much, your advice about brew link --force openssl is still valid, even in Sierra. @sfackler please consider to add this line as 4 line into readme instruction.

e-oz commented Jul 11, 2016

@larsbergstrom thank you very much, your advice about brew link --force openssl is still valid, even in Sierra. @sfackler please consider to add this line as 4 line into readme instruction.

@pcwalton

This comment has been minimized.

Show comment
Hide comment
@pcwalton

pcwalton Aug 3, 2016

Upstream Homebrew seems to refuse to link it anymore. :(

pcwalton commented Aug 3, 2016

Upstream Homebrew seems to refuse to link it anymore. :(

@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Aug 3, 2016

Owner

Yay!

I'm working on adjusting some APIs to hopefully allow openssl to build without requiring headers to be installed for the basic feature set. Should make it "just work" on OSX.

Owner

sfackler commented Aug 3, 2016

Yay!

I'm working on adjusting some APIs to hopefully allow openssl to build without requiring headers to be installed for the basic feature set. Should make it "just work" on OSX.

@episodeyang

This comment has been minimized.

Show comment
Hide comment
@episodeyang

episodeyang Aug 7, 2016

upstream homebrew refuse to link.

brew --version
Homebrew 0.9.9 (git revision b8ce1; last commit 2016-08-06)
Homebrew/homebrew-core (git revision fea8; last commit 2016-08-06)

upstream homebrew refuse to link.

brew --version
Homebrew 0.9.9 (git revision b8ce1; last commit 2016-08-06)
Homebrew/homebrew-core (git revision fea8; last commit 2016-08-06)

@illegalprime illegalprime referenced this issue in websockets-rs/rust-websocket Aug 18, 2016

Closed

Failed to build OpenSSL on El Capitan #69

@hngnaig

This comment has been minimized.

Show comment
Hide comment
@hngnaig

hngnaig Sep 20, 2016

I use macOS Sierra and zsh
i add two line in to .zshrc and it work perfectly

export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib

hngnaig commented Sep 20, 2016

I use macOS Sierra and zsh
i add two line in to .zshrc and it work perfectly

export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib

@gil0mendes gil0mendes referenced this issue in servo/servo Sep 29, 2016

Closed

Build fails on macOS Sierra #13491

@morriswinkler

This comment has been minimized.

Show comment
Hide comment
@morriswinkler

morriswinkler Oct 5, 2016

One solution would be to check for the OS version and if it fails then print the paragraph from the Readme.md#L34-L40 that explains how to build under OSX 10.11. This is how other people deal with this kind of problem until there is a real fix.

This would have certainly saved me 5 minutes of my life, and after checking the options, i conclude that exporting Env vars is the most elegant solution in the moment.

morriswinkler commented Oct 5, 2016

One solution would be to check for the OS version and if it fails then print the paragraph from the Readme.md#L34-L40 that explains how to build under OSX 10.11. This is how other people deal with this kind of problem until there is a real fix.

This would have certainly saved me 5 minutes of my life, and after checking the options, i conclude that exporting Env vars is the most elegant solution in the moment.

@sfackler

This comment has been minimized.

Show comment
Hide comment
@sfackler

sfackler Oct 6, 2016

Owner

Yep, that would definitely be a reasonable thing to do. Want to open a PR?

Owner

sfackler commented Oct 6, 2016

Yep, that would definitely be a reasonable thing to do. Want to open a PR?

@morriswinkler

This comment has been minimized.

Show comment
Hide comment
@morriswinkler

morriswinkler Oct 6, 2016

I am fairly new to Rust and it is 4 o'clock in the morning.

How would I catch the c compiler exit() return value from the build.rs main().
Is that even possible, otherwise I would check for the pkg-config path and then
check for the environment variables, if both is not to be found panic.

I just checked my 10.9 installation and found

/usr/local/Cellar/openssl/1.0.2d_1/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2f/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2h_1/include/openssl/ssl.h

so pkg-config then check if ssl.h is to be found in any of

pkg-config include paths

/usr/include/openssl/ssl.h 
/usr/local/include/openssl/ssl.h

now check the env for

OPENSSL_INCLUDE_DIR
OPENSSL_LIB_DIR

if all of that returned false or empty then panic.

Any suggestion on how to catch the llvm error.

morriswinkler commented Oct 6, 2016

I am fairly new to Rust and it is 4 o'clock in the morning.

How would I catch the c compiler exit() return value from the build.rs main().
Is that even possible, otherwise I would check for the pkg-config path and then
check for the environment variables, if both is not to be found panic.

I just checked my 10.9 installation and found

/usr/local/Cellar/openssl/1.0.2d_1/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2f/include/openssl/ssl.h
/usr/local/Cellar/openssl/1.0.2h_1/include/openssl/ssl.h

so pkg-config then check if ssl.h is to be found in any of

pkg-config include paths

/usr/include/openssl/ssl.h 
/usr/local/include/openssl/ssl.h

now check the env for

OPENSSL_INCLUDE_DIR
OPENSSL_LIB_DIR

if all of that returned false or empty then panic.

Any suggestion on how to catch the llvm error.

@dashed

This comment has been minimized.

Show comment
Hide comment
@dashed

dashed Nov 1, 2016

For lurkers, on El Capitan (osx) I needed to add the following in my .bash_profile:

export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
export DEP_OPENSSL_INCLUDE=`brew --prefix openssl`/include

dashed commented Nov 1, 2016

For lurkers, on El Capitan (osx) I needed to add the following in my .bash_profile:

export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
export DEP_OPENSSL_INCLUDE=`brew --prefix openssl`/include

nbigaouette added a commit to nbigaouette/gitlab-api-rs that referenced this issue Dec 7, 2016

pkgw added a commit to tectonic-typesetting/tectonic that referenced this issue Jan 8, 2017

.travis.yml: further attempt to fix the Travis CI
Turns out the OpenSSL problem on OSX is well known:
sfackler/rust-openssl#255 . Trying the most recent
and comprehensive-looking suggestion.
@learnopengles

This comment has been minimized.

Show comment
Hide comment
@learnopengles

learnopengles Jan 13, 2017

This worked for me on MacPorts:

export OPENSSL_INCLUDE_DIR=/opt/local/include
export OPENSSL_LIB_DIR=/opt/local/lib

I do seem to be running into some kind of conflict with libgit2_sys (rust-lang/cargo#3538); I've seen similar bugs opened but not yet sure what the actual cause is. The problem does go away when using brew instead of macports.

This worked for me on MacPorts:

export OPENSSL_INCLUDE_DIR=/opt/local/include
export OPENSSL_LIB_DIR=/opt/local/lib

I do seem to be running into some kind of conflict with libgit2_sys (rust-lang/cargo#3538); I've seen similar bugs opened but not yet sure what the actual cause is. The problem does go away when using brew instead of macports.

@komamitsu komamitsu referenced this issue in komamitsu/treasuredata_fdw Mar 23, 2017

Closed

openssl version on mac? #10

@pkgw pkgw referenced this issue in Homebrew/homebrew-core Jul 8, 2017

Closed

tectonic 0.1.6 (new formula) #14575

4 of 6 tasks complete

@gorup gorup referenced this issue in inre/rust-mq Jan 23, 2018

Open

Openssl failures on mac #28

@csb19815 csb19815 referenced this issue in CommuteStream/tflgtfs Jul 17, 2018

Open

Compilation on newer OSX #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment