nix-community / bundix

Generates a Nix expression for your Bundler-managed application. [maintainer=@manveru]
160 stars 54 forks source link

nix-shell fails while trying to install shopify-cli and nokogiri installation due to issues with gzdopen #86

Open rbmdotdev opened 3 years ago

rbmdotdev commented 3 years ago

Hi I have bundix installed using

nix-env -iA bundix

I have the following default.nix

with (import <nixpkgs> {});
let 

  gems = bundlerEnv { 
    name = "botega"; 
    gemdir = ./.;
  };

in stdenv.mkDerivation {
  name = "botega";
  buildInputs = [
    gems
    gems.wrappedRuby
  ];

}

and the following Gemfile

source 'https://rubygems.org' do
  gem 't'
  gem 'shopify-cli'
end

running `nix-shell -p bundler bundix --run 'bundle && bundix' generates a gemfile.lock and a gemset.nix for me no problem

when I run nix-shell I get a build error

If I remove shopify-cli from the gemfile nix-shell works fine and I can use t from within it no problem

I think the relevant error from mkmf.log is conftest.c:16:13: error: conflicting types for 'gzdopen' but I have included the full log below just in case

The mkm.log file for the failure is as follows:

block in append_cflags: checking for whether -g is accepted as CFLAGS... -------------------- yes

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I.    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6  -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I.    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC  -g -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

block in append_cflags: checking for whether -Winline is accepted as CFLAGS... -------------------- yes

"gcc -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I.    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g  -Winline -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

block in append_cflags: checking for whether -Wmissing-noreturn is accepted as CFLAGS... -------------------- yes

"gcc -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I.    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline  -Wmissing-noreturn -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

--------------------

have_library: checking for gzdopen() in -lz... -------------------- no

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -lz  -lm   -lc"
/nix/store/zp4vhfn31ky68xy0s6mssxh4c90z9v9a-binutils-2.31.1/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -lz  -lm   -lc"
conftest.c:16:13: error: conflicting types for 'gzdopen'
   16 | extern void gzdopen();
      |             ^~~~~~~
In file included from conftest.c:3:
/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include/zlib.h:1340:24: note: previous declaration of 'gzdopen' was here
 1340 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
      |                        ^~~~~~~
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

--------------------

have_library: checking for gzdopen() in -llibz... -------------------- no

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -llibz  -lm   -lc"
/nix/store/zp4vhfn31ky68xy0s6mssxh4c90z9v9a-binutils-2.31.1/bin/ld: cannot find -llibz
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -llibz  -lm   -lc"
conftest.c:16:13: error: conflicting types for 'gzdopen'
   16 | extern void gzdopen();
      |             ^~~~~~~
In file included from conftest.c:3:
/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include/zlib.h:1340:24: note: previous declaration of 'gzdopen' was here
 1340 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
      |                        ^~~~~~~
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

--------------------

try_package_configuration: checking for zlib using `pkg_config`... -------------------- no

package configuration for zlib is not found
--------------------

have_library: checking for gzdopen() in -lz... -------------------- no

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -lz  -lm   -lc"
/nix/store/zp4vhfn31ky68xy0s6mssxh4c90z9v9a-binutils-2.31.1/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -lz  -lm   -lc"
conftest.c:16:13: error: conflicting types for 'gzdopen'
   16 | extern void gzdopen();
      |             ^~~~~~~
In file included from conftest.c:3:
/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include/zlib.h:1340:24: note: previous declaration of 'gzdopen' was here
 1340 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
      |                        ^~~~~~~
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

--------------------

have_library: checking for gzdopen() in -llibz... -------------------- no

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -llibz  -lm   -lc"
/nix/store/zp4vhfn31ky68xy0s6mssxh4c90z9v9a-binutils-2.31.1/bin/ld: cannot find -llibz
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */

"gcc -o conftest -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/x86_64-linux -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0/ruby/backward -I/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/include/ruby-2.6.0 -I. -I/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include    -O3 -ggdb3 -Wall -Wextra -Wdeclaration-after-statement -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wrestrict -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable  -fPIC -g -Winline -Wmissing-noreturn conftest.c  -L. -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -Wl,-rpath,/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/lib -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -Wl,-rpath,/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -L/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib -lruby-2.6.6 -llibz  -lm   -lc"
conftest.c:16:13: error: conflicting types for 'gzdopen'
   16 | extern void gzdopen();
      |             ^~~~~~~
In file included from conftest.c:3:
/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev/include/zlib.h:1340:24: note: previous declaration of 'gzdopen' was here
 1340 | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
      |                        ^~~~~~~
cc1: warning: unrecognized command line option '-Wno-self-assign'
cc1: warning: unrecognized command line option '-Wno-parentheses-equality'
cc1: warning: unrecognized command line option '-Wno-constant-logical-operand'
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <zlib.h>
 4: 
 5: /*top*/
 6: extern int t(void);
 7: int main(int argc, char **argv)
 8: {
 9:   if (argc > 1000000) {
10:     int (* volatile tp)(void)=(int (*)(void))&t;
11:     printf("%d", (*tp)());
12:   }
13: 
14:   return 0;
15: }
16: extern void gzdopen();
17: int t(void) { gzdopen(); return 0; }
/* end */

--------------------

any ideas on how to get this working and get shopify-cli gem accessible from within a nix-shell?

edit:

I am wondering I this snippet from the nix-shell output is a clue to something being wrong because I thought pkg-config should be provided by bundix by default (as is nokogiri I guess :shrug:

Building nokogiri using system libraries.
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no
checking for zlib using `pkg_config`... no
Please install either the `pkg-config` utility or the `pkg-config` rubygem.
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no

full nix-shell build output:

buildFlags: --use-system-libraries --with-zlib-dir=/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev --with-xml2-lib=/nix/store/fhsjz6advdlwa9lki291ra7s5aays9f9-libxml2-2.9.10/lib --with-xml2-include=/nix/store/g23nqnip7zxh7n2346gpz0n3amwzi66i-libxml2-2.9.10-dev/include/libxml2 --with-xslt-lib=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-xslt-include=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include --with-exslt-lib=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-exslt-include=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include
WARNING:  You build with buildroot.
  Build root: /
  Bin dir: /nix/store/l4b6qx4iyjjzyy5q752q7mpjdclx44xd-ruby2.6.6-ffi-1.15.3/lib/ruby/gems/2.6.0/bin
  Gem home: /nix/store/l4b6qx4iyjjzyy5q752q7mpjdclx44xd-ruby2.6.6-ffi-1.15.3/lib/ruby/gems/2.6.0
WARNING:  You build with buildroot.
  Build root: /
  Bin dir: /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0/bin
  Gem home: /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0
Building native extensions. This could take a while...
Building native extensions with: '--use-system-libraries --with-zlib-dir=/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev --with-xml2-lib=/nix/store/fhsjz6advdlwa9lki291ra7s5aays9f9-libxml2-2.9.10/lib --with-xml2-include=/nix/store/g23nqnip7zxh7n2346gpz0n3amwzi66i-libxml2-2.9.10-dev/include/libxml2 --with-xslt-lib=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-xslt-include=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include --with-exslt-lib=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-exslt-include=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include'
This could take a while...
ERROR:  Error installing /nix/store/a35hgacdgwh9a52mx6ssf0ijb60axkcn-nokogiri-1.11.7.gem:
        ERROR: Failed to build gem native extension.

    current directory: /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.7/ext/nokogiri
/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/bin/ruby -I /nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/lib/ruby/2.6.0 -r ./siteconf20210705-8-j67hgj.rb extconf.rb --use-system-libraries --with-zlib-dir\=/nix/store/ki8k1a2pkpf862pxa0pms0j9mwjcb2xd-zlib-1.2.11-dev --with-xml2-lib\=/nix/store/fhsjz6advdlwa9lki291ra7s5aays9f9-libxml2-2.9.10/lib --with-xml2-include\=/nix/store/g23nqnip7zxh7n2346gpz0n3amwzi66i-libxml2-2.9.10-dev/include/libxml2 --with-xslt-lib\=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-xslt-include\=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include --with-exslt-lib\=/nix/store/xgivc0ij5h7hm1i34v4kfy3xjppkwr8x-libxslt-1.1.34/lib --with-exslt-include\=/nix/store/swlgg14vzq6ky07irry08n7pls2ybflg-libxslt-1.1.34-dev/include
checking for whether -g is accepted as CFLAGS... yes
checking for whether -Winline is accepted as CFLAGS... yes
checking for whether -Wmissing-noreturn is accepted as CFLAGS... yes
Building nokogiri using system libraries.
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no
checking for zlib using `pkg_config`... no
Please install either the `pkg-config` utility or the `pkg-config` rubygem.
checking for gzdopen() in -lz... no
checking for gzdopen() in -llibz... no
-----
extconf.rb:266:in `ensure_package_configuration'
z is missing. Please locate mkmf.log to investigate how it is failing.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/nix/store/hn60d8ywhc5g1mm7wik03y528zcgi7ph-ruby-2.6.6/bin/$(RUBY_BASE_NAME)
        --help
        --clean
        --prevent-strip
        --enable-system-libraries
        --disable-system-libraries
        --use-system-libraries
        --enable-system-libraries
        --disable-system-libraries
        --use-system-libraries
        --with-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-zlib
        --without-zlib
        --with-libzlib
        --without-libzlib
        --with-zlib-config
        --without-zlib-config
        --with-pkg-config
        --without-pkg-config
        --with-zlib
        --without-zlib
        --with-libzlib
        --without-libzlib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/nokogiri-1.11.7/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0/gems/nokogiri-1.11.7 for inspection.
Results logged to /nix/store/2mw0n2ibkvxmhnm131wlzn85ncz0qid2-ruby2.6.6-nokogiri-1.11.7/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/nokogiri-1.11.7/gem_make.out
builder for '/nix/store/bcjyf99cy12qd0fas06hdc2asl00m4n5-ruby2.6.6-nokogiri-1.11.7.drv' failed with exit code 1
cannot build derivation '/nix/store/2fyvcwkcl5xl6a2rn5qmjddby6wapzrn-botega.drv': 1 dependencies couldn't be built
error: build of '/nix/store/2fyvcwkcl5xl6a2rn5qmjddby6wapzrn-botega.drv', '/nix/store/fvzk6dplw8gbnls45643s10wpc03hab8-wrapped-ruby-botega.drv' failed
rbmdotdev commented 3 years ago

could really use some help on this, almost three days wasted now trying to get a usable ruby environment up and running. I think it boils down to ruby inside the nix-shell not being able to see zlib but I have added it in multiple different documented ways and just cant seem to figure this out

milch commented 2 years ago

I just ran into the same issue. No clue what caused it but I just removed the following directories (via SO):

rm -r ~/.nix-channels ~/.nix-defexpr ~/.nix-profile

sudo rm -r /nix

Then reinstalled nix with the multiuser installer, and that fixed it 🤷🏼

Thought I'd drop a comment here in case it helps anyone in the future.