zendesk / zendesk_apps_tools

Apache License 2.0
74 stars 38 forks source link

Issue with thin-1.7.2 dependency #356

Open PaulAndCode opened 3 years ago

PaulAndCode commented 3 years ago

Hi

I am trying to install https://github.com/zendesk/zendesk_apps_tools on my system, however, I keep getting the following issue:

CK@CK` ~ % sudo 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/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thin-1.7.2/ext/thin_parser
/Users/CK/.rbenv/versions/3.0.0/bin/ruby -I /Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210302-23847-yf3mrd.rb extconf.rb
checking for main() in -lc... yes
creating Makefile

current directory: /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thin-1.7.2/ext/thin_parser
make "DESTDIR=" clean

current directory: /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/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/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/thin-1.7.2 for inspection.
Results logged to /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-20/3.0.0/thin-1.7.2/gem_make.out

I am on macOS Big Sur v11.2.1. Gem Env is as follows:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.3
  - RUBY VERSION: 3.0.0 (2020-12-25 patchlevel 0) [x86_64-darwin20]
  - INSTALLATION DIRECTORY: /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /Users/CK/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: /Users/CK/.rbenv/versions/3.0.0/bin/ruby
  - GIT EXECUTABLE: /usr/local/bin/git
  - EXECUTABLE DIRECTORY: /Users/CK/.rbenv/versions/3.0.0/bin
  - SPEC CACHE DIRECTORY: /Users/CK/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /Users/CK/.rbenv/versions/3.0.0/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-darwin-20
  - GEM PATHS:
     - /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0
     - /Users/CK/.gem/ruby/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/CK/.rbenv/versions/3.0.0/bin
     - /usr/local/Cellar/rbenv/1.1.2/libexec
     - /Users/CK/.rbenv/shims
     - /usr/local/opt/ruby/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/bin/activator/bin
     - /Library/Apple/usr/bin
     - /usr/local/git/bin
     - /usr/local/mysql/bin
     - /opt/local/bin
     - /opt/local/sbin
     - /Users/CK/bin
     - /Users/CK/bin/activator/bin
     - /Users/CK/bin/ant/bin
     - /Users/CK/Library/Android/sdk/tools
     - /Users/CK/Library/Android/sdk/platform-tools
     - /Users/CK/git/flutter/bin

The issue appears to be something to do with package thin-1.7.2

I managed to install the zendesk_apps_tools package by running sudo gem install zendesk_apps_tools -- --with-cflags="-Wno-error=implicit-function-declaration"

However, when I run zat server I get the following message:

CK@CK cf-zendesk % zat server --path dist -c settings.json
/Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday/options.rb:153:in `new': tried to create Proc object without a block (ArgumentError)
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday/options.rb:153:in `memoized'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday/options.rb:234:in `<class:ProxyOptions>'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday/options.rb:216:in `<module:Faraday>'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday/options.rb:1:in `<top (required)>'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday.rb:80:in `block in require_libs'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday.rb:79:in `each'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday.rb:79:in `require_libs'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday.rb:240:in `<module:Faraday>'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/faraday-0.9.2/lib/faraday.rb:16:in `<top (required)>'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zendesk_apps_tools-3.8.1/lib/zendesk_apps_tools/deploy.rb:1:in `<top (required)>'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zendesk_apps_tools-3.8.1/lib/zendesk_apps_tools/command_helpers.rb:4:in `<top (required)>'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zendesk_apps_tools-3.8.1/lib/zendesk_apps_tools/command.rb:6:in `<top (required)>'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:/Users/CK/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from /Users/CK/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/zendesk_apps_tools-3.8.1/bin/zat:13:in `<top (required)>'
        from /Users/CK/.rbenv/versions/3.0.0/bin/zat:23:in `load'
        from /Users/CK/.rbenv/versions/3.0.0/bin/zat:23:in `<main>'

Any help would be much appreciated

pezholio commented 3 years ago

I get the impression this repo isn't too well looked after these days. Last activity was August last year.

pezholio commented 3 years ago

Setting the build config seems to fix this, in the absence of this getting fixed upstream:

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