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

ZAT will not install on Apple Silicon/M1 processor nor MacOS BigSur #351

Open
agrohs opened this issue Dec 21, 2020 · 8 comments
Open

ZAT will not install on Apple Silicon/M1 processor nor MacOS BigSur #351

agrohs opened this issue Dec 21, 2020 · 8 comments

Comments

@agrohs
Copy link

agrohs commented Dec 21, 2020

Looks like errors in thin version 1.7.2 with XCode 12 prevent ZAT from installing.

@agrohs
Copy link
Author

agrohs commented Dec 21, 2020

Seems that updating the zendesk_apps_tools.gemspec file to:

  s.add_runtime_dependency 'thin',        '~> 1.8.0'

Then changing .ruby-version file to 2.6.3

And running a bundle install to build our local copy of ZAT worked to get around!

@agrohs agrohs changed the title ZAT will not install on Apple Silicon/M1 processor ZAT will not install on Apple Silicon/M1 processor nor MacOS BigSur Dec 28, 2020
@pelargir
Copy link

pelargir commented Dec 28, 2020

Same problem. I'm running Big Sur. Here is the full stack trace:

$ gem install zendesk_apps_tools
Building native extensions. This could take a while...
ERROR:  Error installing zendesk_apps_tools:
	ERROR: Failed to build gem native extension.

    current directory: /Users/pelargir/.rvm/gems/ruby-2.7.2/gems/thin-1.7.2/ext/thin_parser
/Users/pelargir/.rvm/rubies/ruby-2.7.2/bin/ruby -I /Users/pelargir/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20201228-56046-cj876b.rb extconf.rb
checking for main() in -lc... yes
creating Makefile

current directory: /Users/pelargir/.rvm/gems/ruby-2.7.2/gems/thin-1.7.2/ext/thin_parser
make "DESTDIR=" clean

current directory: /Users/pelargir/.rvm/gems/ruby-2.7.2/gems/thin-1.7.2/ext/thin_parser
make "DESTDIR="
compiling parser.c
parser.c:31:18: warning: unused variable 'http_parser_en_main' [-Wunused-const-variable]
static const int http_parser_en_main = 1;
                 ^
1 warning generated.
compiling thin.c
thin.c:242:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(hp);
  ^
thin.c:242:3: note: did you mean 'http_parser_init'?
./parser.h:41:5: note: 'http_parser_init' declared here
int http_parser_init(http_parser *parser);
    ^
thin.c:260:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:277:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:294:3: error: implicit declaration of function 'thin_http_parser_finish' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_finish(http);
  ^
thin.c:294:3: note: did you mean 'Thin_HttpParser_finish'?
thin.c:290:7: note: 'Thin_HttpParser_finish' declared here
VALUE Thin_HttpParser_finish(VALUE self)
      ^
thin.c:296:10: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
thin.c:334:5: error: implicit declaration of function 'thin_http_parser_execute' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    thin_http_parser_execute(http, dptr, dlen, from);
    ^
thin.c:334:5: note: did you mean 'Thin_HttpParser_execute'?
thin.c:317:7: note: 'Thin_HttpParser_execute' declared here
VALUE Thin_HttpParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE start)
      ^
thin.c:338:8: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if(thin_http_parser_has_error(http)) {
       ^
thin.c:338:8: note: did you mean 'http_parser_has_error'?
./parser.h:44:5: note: 'http_parser_has_error' declared here
int http_parser_has_error(http_parser *parser);
    ^
thin.c:359:10: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_has_error(http) ? Qtrue : Qfalse;
         ^
thin.c:374:10: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
9 errors generated.
make: *** [thin.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/pelargir/.rvm/gems/ruby-2.7.2/gems/thin-1.7.2 for inspection.
Results logged to /Users/pelargir/.rvm/gems/ruby-2.7.2/extensions/x86_64-darwin-19/2.7.0/thin-1.7.2/gem_make.out

@xiaoronglv
Copy link

xiaoronglv commented Feb 7, 2021

I have the same issue.

> gem install thin  -v '1.7.2'                                                                                                                 <aws:workstream>
Building native extensions. This could take a while...
ERROR:  Error installing thin:
	ERROR: Failed to build gem native extension.

    current directory: /Users/xiaoronglv/.rvm/gems/ruby-2.6.6/gems/thin-1.7.2/ext/thin_parser
/Users/xiaoronglv/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/xiaoronglv/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210207-9710-1wundk.rb extconf.rb
checking for main() in -lc... yes
creating Makefile

current directory: /Users/xiaoronglv/.rvm/gems/ruby-2.6.6/gems/thin-1.7.2/ext/thin_parser
make "DESTDIR=" clean

current directory: /Users/xiaoronglv/.rvm/gems/ruby-2.6.6/gems/thin-1.7.2/ext/thin_parser
make "DESTDIR="
compiling parser.c
parser.c:31:18: warning: unused variable 'http_parser_en_main' [-Wunused-const-variable]
static const int http_parser_en_main = 1;
                 ^
1 warning generated.
compiling thin.c
thin.c:242:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(hp);
  ^
thin.c:242:3: note: did you mean 'http_parser_init'?
./parser.h:41:5: note: 'http_parser_init' declared here
int http_parser_init(http_parser *parser);
    ^
thin.c:260:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:277:3: error: implicit declaration of function 'thin_http_parser_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_init(http);
  ^
thin.c:294:3: error: implicit declaration of function 'thin_http_parser_finish' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  thin_http_parser_finish(http);
  ^
thin.c:294:3: note: did you mean 'Thin_HttpParser_finish'?
thin.c:290:7: note: 'Thin_HttpParser_finish' declared here
VALUE Thin_HttpParser_finish(VALUE self)
      ^
thin.c:296:10: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
thin.c:334:5: error: implicit declaration of function 'thin_http_parser_execute' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    thin_http_parser_execute(http, dptr, dlen, from);
    ^
thin.c:334:5: note: did you mean 'Thin_HttpParser_execute'?
thin.c:317:7: note: 'Thin_HttpParser_execute' declared here
VALUE Thin_HttpParser_execute(VALUE self, VALUE req_hash, VALUE data, VALUE start)
      ^
thin.c:338:8: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if(thin_http_parser_has_error(http)) {
       ^
thin.c:338:8: note: did you mean 'http_parser_has_error'?
./parser.h:44:5: note: 'http_parser_has_error' declared here
int http_parser_has_error(http_parser *parser);
    ^
thin.c:359:10: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_has_error(http) ? Qtrue : Qfalse;
         ^
thin.c:374:10: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  return thin_http_parser_is_finished(http) ? Qtrue : Qfalse;
         ^
9 errors generated.
make: *** [thin.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/xiaoronglv/.rvm/gems/ruby-2.6.6/gems/thin-1.7.2 for inspection.
Results logged to /Users/xiaoronglv/.rvm/gems/ruby-2.6.6/extensions/x86_64-darwin-19/2.6.0/thin-1.7.2/gem_make.out

image

@kyleleow
Copy link

kyleleow commented Feb 24, 2021

For anyone having the same issues on m1 Macs and if you have no idea how to modify the .gemspec file as suggested, you can install thin version 1.7.2 explicitly using this command:
gem install thin -v 1.7.2 -- --with-cflags="-Wno-error=implicit-function-declaration"

Reference: zendesk article

@gabsong
Copy link

gabsong commented Feb 27, 2021

I also have this error, and I'm on an Intel Mac running MacOS Catalina 10.15.7.

@kyleleow your solution worked, but I think it might be worthwhile looking at this since it does not seem M1 Mac specific.

@bestjane
Copy link

I solved the problem in the following way

 bundle config build.thin --with-cflags="-Wno-error=implicit-function-declaration"
 bundle install

Reference: https://stackoverflow.com/questions/63187613/fail-to-bundle-install-puma-4-3-5-or-gem-puma-with-ruby-2-6-6-on-macos-10-15-6/63201544#63201544

@YuryPatsekhin
Copy link

Hi!
I had the same problem on my Mac Big Sur 11.6 with M1 chip. None of the suggested solutions helps me (I tried to reinstall Xcode, updating/reinstalling command line tools, deal with the installation of thin separately, etc.). One thing that really helps me it's changing the ruby version to 2.6.9 with rbenv (https://gorails.com/setup/osx/11-big-sur - check Installing Ruby . Follow this instruction, but choose another ruby version). After change ruby version, make sure the correct version of ruby is currently selected with ruby -v and then try execute gem install zendesk_apps_tools again. I tried several versions of ruby before it worked for me, but in the end everything was fine on 2.6.9 version

@boonier
Copy link

boonier commented Aug 18, 2022

Can confirm that v2.6.9 of Ruby and ZAT is now working fine on Monterey 12.3.1 with M1 Max. This is using Node v14.20.0.

Had proper headaches and went down numerous rabbit holes getting this up and running, before finding the answer in this issue; the documentation alludes to ZCLI (the node based tool) being a replacement for ZAT that works for M1 architectures. The problem is that functionality is half-baked and you can't preview themes locally with ZCLI.

Zendesk, please make this clear in the docs here https://developer.zendesk.com/documentation/apps/zendesk-app-tools-zat/installing-and-using-the-zendesk-apps-tools/#installing-zat and also https://developer.zendesk.com/documentation/apps/app-developer-guide/zcli/

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

8 participants