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

Can't install openresty on macOS 10.15 #10

Closed
nickpola opened this issue Oct 14, 2019 · 29 comments
Closed

Can't install openresty on macOS 10.15 #10

nickpola opened this issue Oct 14, 2019 · 29 comments

Comments

@nickpola
Copy link

OS: macOS 10.15
==== Can't install openresty on macOS 10.15,Error info is here ====
==> Installing openresty/brew/openresty
==> Downloading https://openresty.org/download/openresty-1.15.8.2.tar.gz
Already downloaded: /Users/ryan/Library/Caches/Homebrew/downloads/4395089f0fd423261d4f1124b7beb0f69e1121e59d399e89eaa6e25b641333bc--openresty-1.15.8.2.tar.gz
==> ./configure -j4 --prefix=/usr/local/Cellar/openresty/1.15.8.2 --pid-path=/usr/local/var/run/openresty.pid --lock-path=/usr/local/var/run/op
Last 15 lines from /Users/ryan/Library/Logs/Homebrew/openresty/01.configure:
CC lib_init.o
CC luajit.o
HOSTLINK host/minilua
DYNASM host/buildvm_arch.h
HOSTCC host/buildvm.o
HOSTLINK host/buildvm
BUILDVM lj_vm.S
BUILDVM lj_ffdef.h
BUILDVM lj_bcdef.h
BUILDVM lj_folddef.h
make[1]: *** [lj_folddef.h] Segmentation fault: 11
make[1]: *** Deleting file `lj_folddef.h'
make[1]: *** Waiting for unfinished jobs....
make: *** [default] Error 2
ERROR: failed to run command: gmake -j4 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/openresty/homebrew-brew/issues

@codecodingg
Copy link

Mac os 10.15 upgrade openresty 1.15.8.1 -> 1.15.8.2 fail
==> Downloading https://openresty.org/download/openresty-1.15.8.2.tar.gz
Already downloaded: /Users/lunicornxiao/Library/Caches/Homebrew/downloads/4395089f0fd423261d4f1124b7beb0f69e1121e59d399e89eaa6e25b641333bc--openresty-1.15.8.2.tar.gz
==> ./configure -j12 --prefix=/usr/local/Cellar/openresty/1.15.8.2 --pid-path=/usr/local/var/run/openresty.pid --lock-path=/usr/local/var/run/openresty.lock --conf-p
Last 15 lines from /Users/lunicornxiao/Library/Logs/Homebrew/openresty/01.configure:
DYNASM host/buildvm_arch.h
HOSTCC host/buildvm.o
HOSTLINK host/buildvm
BUILDVM lj_vm.S
BUILDVM lj_ffdef.h
BUILDVM lj_folddef.h
BUILDVM lj_bcdef.h
BUILDVM lj_recdef.h
BUILDVM lj_libdef.h
BUILDVM jit/vmdef.lua
make[1]: *** [lj_folddef.h] Segmentation fault: 11
make[1]: *** Deleting file `lj_folddef.h'
make[1]: *** Waiting for unfinished jobs....
make: *** [default] Error 2
ERROR: failed to run command: gmake -j12 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

@hipsrinoky
Copy link

hipsrinoky commented Oct 17, 2019

I have same problem.
This reason seems to be caused by Issues of Xcode11.1.
neovim/neovim#11192 (comment)
macports/macports-ports#5472 (comment)
It seems to be fixed on Xcode11.2(It still in beta version now)

--added--
This is clang bug with checking stack at compile. And need to add '-fno-stack-check' parameter at CFLAGS.
Which is better adding the parameter in openresty/util/configure or homebrew-core/Formula/luajit.rb ?
(OR Which is faster to be merged?)

@hipsrinoky
Copy link

hipsrinoky commented Oct 18, 2019

Hack for install on Catalina. (It is a temporary hack because of that I don't know to check OS version in configure file.)

if ($platform eq 'macosx') {
my $v = $ENV{MACOSX_DEPLOYMENT_TARGET};
if (!defined $v || $v !~ /^\d+.\d+$/) {
$v = sw_vers -productVersion;
if (defined $v && $v =~ /^\s*(\d+.\d+)/) {
$ENV{MACOSX_DEPLOYMENT_TARGET} = $1;
#warn "MACOSX_DEPLOYMENT_TARGET = $1";
}
}
#hipsrinoky added
#hack for osx10.15
$extra_opts .= " CFLAGS='-fno-stack-check'";
}

@agentzh
Copy link
Member

agentzh commented Oct 18, 2019

I don't have a macOS 10.5 to test. Could anyone contribute a pull request to the openresty/openresty github repo so that I can simply merge? Many thanks!

@agentzh
Copy link
Member

agentzh commented Oct 18, 2019

I'm also wondering if we could simply ship binaries in our homebrew repo so that people don't have to bother fighting Xcode toolchain bugs :) Just a thought.

@hipsrinoky
Copy link

I don't have a macOS 10.5 to test. Could anyone contribute a pull request to the openresty/openresty github repo so that I can simply merge? Many thanks!

Is there some way to check current OS version in openresty/configure file?
(EX.
$extra_opts .= " CFLAGS='-fno-stack-check'" if DevelopmentTools.clang_build_version >= 1010;
or
$OS == "dawin19"
and others.
)
I can send pull request soon when I fixed that.

@zqiangli
Copy link

make[1]: *** [lj_folddef.h] Segmentation fault: 11
make[1]: *** Deleting file `lj_folddef.h'
make[1]: *** Waiting for unfinished jobs....
make: *** [default] Error 2
ERROR: failed to run command: gmake -j12 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

HOMEBREW_VERSION: 2.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2bf8015bc44878d432fb9da4f11e1d8abcef8f32
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 1112da1c9b6e8e6eba6747f20c824da5009da999
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CACHE: /Users/robin/Library/Caches/Homebrew
HOMEBREW_LOGS: /Users/robin/Library/Logs/Homebrew
CPU: dodeca-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.21.0 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.0_221
macOS: 10.15-x86_64
CLT: 11.0.0.0.1.1567737322
Xcode: 11.1
CLT headers: 11.0.0.0.1.1567737322

@dfkfhv
Copy link

dfkfhv commented Oct 22, 2019

Same:

$ brew install openresty/brew/openresty --verbose

==> ./configure -j8 --prefix=/usr/local/Cellar/openresty/1.15.8.2 --pid-path=/usr/local/var/run/openresty.pid --lock-path=/usr/local/var/run/openresty.lock --conf-path=/usr/local/etc/openresty/nginx.conf --http-log-path=/usr/local/var/log/nginx/access.log --error-log-path=/usr/local/var/log/nginx/error.log --with-cc-opt=-I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openresty-openssl/include --with-ld-opt=-L/usr/local/lib -L/usr/local/opt/pcre/lib -L/usr/local/opt/openresty-openssl/lib --with-pcre-jit --without-http_rds_json_module --without-http_rds_csv_module --without-lua_rds_parser --with-ipv6 --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_geoip_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-luajit-xcflags=-DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT --with-dtrace-probes
platform: macosx (darwin)
cp -rp bundle/ build
cd build
cd LuaJIT-2.1-20190507
INFO: found -msse4.2 in cc.
gmake -j8 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit
==== Building LuaJIT 2.1.0-beta3 ====
/Library/Developer/CommandLineTools/usr/bin/make -C src
HOSTCC    host/minilua.o
HOSTCC    host/buildvm_asm.o
HOSTCC    host/buildvm_peobj.o
HOSTCC    host/buildvm_lib.o
HOSTCC    host/buildvm_fold.o
CC        lj_gc.o
CC        lj_char.o
CC        lj_obj.o
CC        lj_buf.o
CC        lj_str.o
CC        lj_tab.o
CC        lj_func.o
CC        lj_udata.o
CC        lj_meta.o
CC        lj_debug.o
CC        lj_state.o
CC        lj_vmevent.o
CC        lj_vmmath.o
CC        lj_strscan.o
CC        lj_strfmt.o
CC        lj_strfmt_num.o
CC        lj_api.o
CC        lj_profile.o
CC        lj_lex.o
CC        lj_parse.o
CC        lj_bcread.o
CC        lj_bcwrite.o
CC        lj_load.o
CC        lj_ir.o
CC        lj_opt_mem.o
CC        lj_opt_narrow.o
CC        lj_opt_dce.o
CC        lj_opt_loop.o
CC        lj_opt_split.o
CC        lj_opt_sink.o
CC        lj_mcode.o
CC        lj_snap.o
CC        lj_asm.o
CC        lj_trace.o
CC        lj_gdbjit.o
CC        lj_ctype.o
CC        lj_cdata.o
CC        lj_cconv.o
CC        lj_ccall.o
CC        lj_ccallback.o
CC        lj_carith.o
CC        lj_clib.o
CC        lj_cparse.o
CC        lj_lib.o
CC        lj_alloc.o
CC        lib_aux.o
CC        lib_package.o
CC        lib_init.o
CC        luajit.o
HOSTLINK  host/minilua
DYNASM    host/buildvm_arch.h
HOSTCC    host/buildvm.o
HOSTLINK  host/buildvm
BUILDVM   lj_vm.S
BUILDVM   lj_ffdef.h
BUILDVM   lj_bcdef.h
BUILDVM   lj_folddef.h
BUILDVM   lj_recdef.h
BUILDVM   lj_libdef.h
BUILDVM   jit/vmdef.lua
make[1]: *** [lj_folddef.h] Segmentation fault: 11
make[1]: *** Deleting file `lj_folddef.h'
make[1]: *** Waiting for unfinished jobs....
make: *** [default] Error 2
ERROR: failed to run command: gmake -j8 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

==> Formula
Tap: openresty/brew
Path: /usr/local/Homebrew/Library/Taps/openresty/homebrew-brew/Formula/openresty.rb
==> Configuration
HOMEBREW_VERSION: 2.1.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2bf8015bc44878d432fb9da4f11e1d8abcef8f32
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 80c190fa2d7b283c857a0e1bfb70a03a9ca11587
Core tap last commit: 63 minutes ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.23.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 13, 1.8.0_232
macOS: 10.15-x86_64
CLT: 11.0.0.0.1.1567737322
Xcode: N/A
CLT headers: 11.0.0.0.1.1567737322
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j8
CMAKE_PREFIX_PATH: /usr/local/opt/openresty-openssl:/usr/local
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/libxml2:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/geoip/lib/pkgconfig:/usr/local/opt/openresty-openssl/lib/pkgconfig:/usr/local/opt/pcre/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.15
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/geoip/bin:/usr/local/opt/openresty-openssl/bin:/usr/local/opt/pcre/bin:/usr/bin:/bin:/usr/sbin:/sbin

Error: openresty/brew/openresty 1.15.8.2 did not build
Logs:
     /Users/123/Library/Logs/Homebrew/openresty/00.options.out
     /Users/123/Library/Logs/Homebrew/openresty/01.configure.cc
     /Users/123/Library/Logs/Homebrew/openresty/01.configure

@jason-zuo
Copy link

i have the same problems ;
ERROR: failed to run command: gmake -j8 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/openresty/homebrew-brew/issues

These open issues may also help:
Can't install openresty on macOS 10.15 #10
Fails to install OpenResty #5
The openresty-debug package should use openresty-openssl-debug instead #3

@hipsrinoky
Copy link

XCode has been updated to version 11.2, And 'brew install openresty' will work. Try it!

@jason-zuo
Copy link

@hipsrinoky I try it, but it not work for me,failed to run command: gmake -j8 TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.2/luajit

@TinkoLiu
Copy link

TinkoLiu commented Nov 4, 2019

Not working for me neither.

make[1]: *** [lj_folddef.h] Segmentation fault: 11
make[1]: *** Deleting file `lj_folddef.h'
make[1]: *** Waiting for unfinished jobs....
make: *** [default] Error 2
ERROR: failed to run command: gmake TARGET_STRIP=@: CCDEBUG=-g XCFLAGS='-msse4.2 -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT' CC=cc PREFIX=/usr/local/Cellar/openresty/1.15.8.1/luajit

macOS 10.15.1

Xcode 11.2 (11B52)

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@ewalk153
Copy link

ewalk153 commented Nov 4, 2019

Looks like this ties to an issue resolved in LuaJIT: LuaJIT/LuaJIT#518

Solution was to pass -fno-stack-check to the build to work around a regression in XCode 11 https://forums.developer.apple.com/thread/121887:

macports/macports-ports@29d7df9

# Workaround for Xcode 11 issue
# https://forums.developer.apple.com/thread/121887
# Current information is that this should be fixed in Xcode 11.2
if { ([vercmp ${os.major} 19] >= 0) && ([vercmp $xcodeversion 11.2] < 0) } {
    if {[string match clang ${configure.compiler}]} {
        configure.cc-append -fno-stack-check
    }
}

@meunierd
Copy link

meunierd commented Nov 4, 2019

Adding ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.14' to the the formula gets it to build, but attempting to run it instantly throws a SIGABRT. Same is true of passing -f-no-stack-check, you'll get a build but it'll crash.

@nooop3
Copy link

nooop3 commented Nov 7, 2019

Thanks @hipsrinoky , for quick fix by brew edit openresty/brew/openresty and add \ -fno-stack-check in with-luajit-xcflags line.

@chenyongze
Copy link

brew edit openresty
Add ENV['CFLAGS']='-fno-stack-check' at the start of the install def

@jason-zuo
Copy link

@nooop3 yes this work for me

@cute-angelia
Copy link

....

-fno-stack-check was deleted from homebrew/core in commit e4cc1ca401:
ansible@2.0: delete

@yeetk
Copy link

yeetk commented Nov 27, 2019

brew edit openresty
Add ENV['CFLAGS']='-fno-stack-check' at the start of the install def

this work for me, thanks!

@BigYoungs
Copy link

brew edit openresty/brew/openresty
找到此行:--with-luajit-xcflags,最后增加内容:\ -fno-stack-check
改完后: --with-luajit-xcflags=-DLUAJIT_NUMMODE=2\ -DLUAJIT_ENABLE_LUA52COMPAT\ -fno-stack-check

然后重开一个窗口,重新执行:brew install openresty/brew/openresty

@a652
Copy link

a652 commented Dec 1, 2019

Thanks @hipsrinoky , for quick fix by brew edit openresty/brew/openresty and add \ -fno-stack-check in with-luajit-xcflags line.

This worked for me!

@bpzhang
Copy link

bpzhang commented Dec 4, 2019

XCode has been updated to version 11.2, And 'brew install openresty' will work. Try it!

doesn't work!!!

@i6u
Copy link

i6u commented Dec 4, 2019

try it out

Kong/homebrew-kong#121 (comment)

@zhenglaizhang
Copy link

brew edit openresty/brew/openresty
找到此行:--with-luajit-xcflags,最后增加内容:\ -fno-stack-check
改完后: --with-luajit-xcflags=-DLUAJIT_NUMMODE=2\ -DLUAJIT_ENABLE_LUA52COMPAT\ -fno-stack-check

然后重开一个窗口,重新执行:brew install openresty/brew/openresty

this works for me, awesome!

@zhangchenguang231x
Copy link

I have same question ,you can update new command line tools in here ,i have solved

@agentzh
Copy link
Member

agentzh commented Mar 20, 2020

I committed a fix to our official brew today as per the discussion here. Will some of you help test it out on your side please? I only have 10.14 and 10.12 macOS systems locally. Thanks!

@agentzh
Copy link
Member

agentzh commented Mar 20, 2020

BTW, I also upgraded our openresty-openssl brew package to OpenSSL 1.1.0l. We'll move further onto OpenSSL 1.1.1 for the next OpenResty release (1.17.8.1).

@nooop3
Copy link

nooop3 commented Mar 23, 2020

Openresty had been upgrade to 1.15.8.3 on 10.15.3 macOS system by brew. It works normally. Thanks @agentzh .

@gebing
Copy link

gebing commented Apr 3, 2020

OpenSSL 1.1.0l can not download.

==> Downloading https://www.openssl.org/source/openssl-1.1.0l.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://dl.bintray.com/homebrew/mirror/openssl-1.1.0l.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "openresty-openssl"
Download failed: https://dl.bintray.com/homebrew/mirror/openssl-1.1.0l.tar.gz

denji pushed a commit to denji/homebrew-nginx that referenced this issue Apr 7, 2020
bugfix: worked around XCode tool chain bugs reported in openresty#10
openresty{,-debug}: added -jN to ./configure as well.
feature: fixed the parallel build of openssl and its mirror url.

Resolved: #378
denji pushed a commit to denji/homebrew-nginx that referenced this issue Apr 7, 2020
bugfix: worked around XCode tool chain bugs reported in openresty#10
openresty{,-debug}: added -jN to ./configure as well.
feature: fixed the parallel build of openssl and its mirror url.

Resolved: #378
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