Git Product home page Git Product logo

bundix's People

Contributors

aflatter avatar alyssais avatar bobvanderlinden avatar burke avatar cstrahan avatar ivanbrennan avatar jonringer avatar manveru avatar marsam avatar mic92 avatar nathantalewis avatar nonsequitur avatar nyarly avatar pmahoney avatar pnelson avatar robx avatar zimbatm avatar zoonfafer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bundix's Issues

Dropping --leave-dotGit breaks nix-bundle-install

#51 has broken things when pointing at git repository in the Gemfile.

# Gemfile
gem 'sensu-plugins-ipmi', git: 'https://github.com/sensu-plugins/sensu-plugins-ipmi', branch: 'master'

The problem is that nix-bundle-install expects the .git directory to exist when building from a git checkout and therefore fails when it is missing.

The problem is that since we are specifying a revision (either a branch, tag or actual commit id), nix-bundle-install needs a proper repo in order to do a proper checkout of the correct revision.

Reverting #51, deleting gemset.nix for the gem in question and running bundix makes everything work again.

Bundix parses stderr output of `nix-instantiate` causing parse errors when `nix` emits a warning

When bundix parses out output of nix-instantiate it reads both stderr and stdout. If nix logs an error message,
then bundix crashes.

Originally found due to some bug in Nix NixOS/nix#3784
but bundix shouldn't fail parsing when Nix logs something to stderr.

How to reproduce

  1. Make a Gemfile with a gem
  2. run bundix -m
  3. run bundix -m again
  4. Add a config option that isn't supported in nix to your nix conf
  5. now you'll see many warning: unknown setting 'foo'
  6. Bundix crashes when parsing the gemset.nix
warning: unknown setting 'sandbox-fallback'
Fetching gem metadata from https://rubygems.org/.........
Writing lockfile to /home/arian/Projects/minvws/nl-covid19-notification-app-community-website/Gemfile.lock
warning: unknown setting 'sandbox-fallback'
Fetching gem metadata from https://rubygems.org/.........
Fetching concurrent-ruby 1.1.6
Fetching i18n 0.9.5
Fetching minitest 5.14.1
Fetching thread_safe 0.3.6
Fetching tzinfo 1.2.7
Fetching zeitwerk 2.3.1
Fetching activesupport 6.0.3.2
Fetching public_suffix 3.1.1
Fetching addressable 2.7.0
Using bundler 1.17.3
Fetching coffee-script-source 1.11.1
Fetching execjs 2.7.0
Fetching coffee-script 2.4.1
Fetching colorator 1.1.0
Fetching ruby-enum 0.8.0
Fetching commonmarker 0.17.13
Fetching dnsruby 1.61.3
Fetching eventmachine 1.2.7
Fetching http_parser.rb 0.6.0
Fetching em-websocket 0.5.1
Fetching ffi 1.13.1
Fetching ethon 0.12.0
Fetching multipart-post 2.1.1
Fetching faraday 1.0.1
Fetching forwardable-extended 2.6.0
Fetching gemoji 3.0.1
Fetching sawyer 0.8.2
Fetching octokit 4.18.0
Fetching typhoeus 1.4.0
Fetching github-pages-health-check 1.16.1
Fetching rb-fsevent 0.10.4
Fetching rb-inotify 0.10.1
Fetching sass-listen 4.0.0
Fetching sass 3.7.4
Fetching jekyll-sass-converter 1.5.2
Fetching listen 3.2.1
Fetching jekyll-watch 2.2.1
Fetching kramdown 1.17.0
Fetching liquid 4.0.3
Fetching mercenary 0.3.6
Fetching pathutil 0.16.2
Fetching rouge 3.19.0
Fetching safe_yaml 1.0.5
Fetching jekyll 3.8.7
Fetching jekyll-avatar 0.7.0
Fetching jekyll-coffeescript 1.1.1
Fetching jekyll-commonmark 1.3.1
Fetching jekyll-commonmark-ghpages 0.1.6
Fetching jekyll-default-layout 0.1.4
Fetching jekyll-feed 0.13.0
Fetching jekyll-gist 1.5.0
Fetching jekyll-github-metadata 2.13.0
Fetching mini_portile2 2.4.0
Fetching nokogiri 1.10.9
Fetching html-pipeline 2.13.0
Fetching jekyll-mentions 1.5.1
Fetching jekyll-optional-front-matter 0.3.2
Fetching jekyll-paginate 1.1.0
Fetching jekyll-readme-index 0.3.0
Fetching jekyll-redirect-from 0.15.0
Fetching jekyll-relative-links 0.6.1
Fetching rubyzip 2.3.0
Fetching jekyll-remote-theme 0.4.1
Fetching jekyll-seo-tag 2.6.1
Fetching jekyll-sitemap 1.4.0
Fetching jekyll-swiss 1.0.0
Fetching jekyll-theme-architect 0.1.1
Fetching jekyll-theme-cayman 0.1.1
Fetching jekyll-theme-dinky 0.1.1
Fetching jekyll-theme-hacker 0.1.1
Fetching jekyll-theme-leap-day 0.1.1
Fetching jekyll-theme-merlot 0.1.1
Fetching jekyll-theme-midnight 0.1.1
Fetching jekyll-theme-minimal 0.1.1
Fetching jekyll-theme-modernist 0.1.1
Fetching jekyll-theme-primer 0.5.4
Fetching jekyll-theme-slate 0.1.1
Fetching jekyll-theme-tactile 0.1.1
Fetching jekyll-theme-time-machine 0.1.1
Fetching jekyll-titles-from-headings 0.5.3
Fetching jemoji 0.11.1
Fetching minima 2.5.1
Fetching unicode-display_width 1.7.0
Fetching terminal-table 1.8.0
Fetching github-pages 206
Fetching jekyll-multiple-languages-plugin 1.7.0
Bundle complete! 2 Gemfile dependencies, 86 gems now installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from dnsruby:
Installing dnsruby...
  For issues and source code: https://github.com/alexdalitz/dnsruby
  For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------
Updating files in vendor/cache
  * concurrent-ruby-1.1.6.gem
  * i18n-0.9.5.gem
  * minitest-5.14.1.gem
  * thread_safe-0.3.6.gem
  * tzinfo-1.2.7.gem
  * zeitwerk-2.3.1.gem
  * activesupport-6.0.3.2.gem
  * public_suffix-3.1.1.gem
  * addressable-2.7.0.gem
  * coffee-script-source-1.11.1.gem
  * execjs-2.7.0.gem
  * coffee-script-2.4.1.gem
  * colorator-1.1.0.gem
  * ruby-enum-0.8.0.gem
  * commonmarker-0.17.13.gem
  * dnsruby-1.61.3.gem
  * eventmachine-1.2.7.gem
  * http_parser.rb-0.6.0.gem
  * em-websocket-0.5.1.gem
  * ffi-1.13.1.gem
  * ethon-0.12.0.gem
  * multipart-post-2.1.1.gem
  * faraday-1.0.1.gem
  * forwardable-extended-2.6.0.gem
  * gemoji-3.0.1.gem
  * sawyer-0.8.2.gem
  * octokit-4.18.0.gem
  * typhoeus-1.4.0.gem
  * github-pages-health-check-1.16.1.gem
  * rb-fsevent-0.10.4.gem
  * rb-inotify-0.10.1.gem
  * sass-listen-4.0.0.gem
  * sass-3.7.4.gem
  * jekyll-sass-converter-1.5.2.gem
  * listen-3.2.1.gem
  * jekyll-watch-2.2.1.gem
  * kramdown-1.17.0.gem
  * liquid-4.0.3.gem
  * mercenary-0.3.6.gem
  * pathutil-0.16.2.gem
  * rouge-3.19.0.gem
  * safe_yaml-1.0.5.gem
  * jekyll-3.8.7.gem
  * jekyll-avatar-0.7.0.gem
  * jekyll-coffeescript-1.1.1.gem
  * jekyll-commonmark-1.3.1.gem
  * jekyll-commonmark-ghpages-0.1.6.gem
  * jekyll-default-layout-0.1.4.gem
  * jekyll-feed-0.13.0.gem
  * jekyll-gist-1.5.0.gem
  * jekyll-github-metadata-2.13.0.gem
  * mini_portile2-2.4.0.gem
  * nokogiri-1.10.9.gem
  * html-pipeline-2.13.0.gem
  * jekyll-mentions-1.5.1.gem
  * jekyll-optional-front-matter-0.3.2.gem
  * jekyll-paginate-1.1.0.gem
  * jekyll-readme-index-0.3.0.gem
  * jekyll-redirect-from-0.15.0.gem
  * jekyll-relative-links-0.6.1.gem
  * rubyzip-2.3.0.gem
  * jekyll-remote-theme-0.4.1.gem
  * jekyll-seo-tag-2.6.1.gem
  * jekyll-sitemap-1.4.0.gem
  * jekyll-swiss-1.0.0.gem
  * jekyll-theme-architect-0.1.1.gem
  * jekyll-theme-cayman-0.1.1.gem
  * jekyll-theme-dinky-0.1.1.gem
  * jekyll-theme-hacker-0.1.1.gem
  * jekyll-theme-leap-day-0.1.1.gem
  * jekyll-theme-merlot-0.1.1.gem
  * jekyll-theme-midnight-0.1.1.gem
  * jekyll-theme-minimal-0.1.1.gem
  * jekyll-theme-modernist-0.1.1.gem
  * jekyll-theme-primer-0.5.4.gem
  * jekyll-theme-slate-0.1.1.gem
  * jekyll-theme-tactile-0.1.1.gem
  * jekyll-theme-time-machine-0.1.1.gem
  * jekyll-titles-from-headings-0.5.3.gem
  * jemoji-0.11.1.gem
  * minima-2.5.1.gem
  * unicode-display_width-1.7.0.gem
  * terminal-table-1.8.0.gem
  * github-pages-206.gem
  * jekyll-multiple-languages-plugin-1.7.0.gem
Traceback (most recent call last):
        9: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'
        8: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/bin/.bundix-wrapped:18:in `load'
        7: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/bin/bundix:5:in `<top (required)>'
        6: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:22:in `run'
        5: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:35:in `run'
        4: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:148:in `build_gemset'
        3: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:46:in `convert'
        2: from /nix/store/qqxgiziqpri256809rzn8rfyh01njsb8-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:173:in `parse_gemset'
        1: from /nix/store/abd2zgz6vvmf9gxw5ra49ibqp1gs15c3-ruby-2.5.5/lib/ruby/2.5.0/json/common.rb:156:in `parse'
/nix/store/abd2zgz6vvmf9gxw5ra49ibqp1gs15c3-ruby-2.5.5/lib/ruby/2.5.0/json/common.rb:156:in `parse': 765: unexpected token at 'arning: unknown setting 'sandbox-fallback' (JSON::ParserError)
"{"activesupport":{"dependencies":["concurrent-ruby","i18n","minitest","tzinfo","zeitwerk"],"groups":["default","jekyll_plugins"],"platforms":[],"source":{"remotes":["https://rubygems.org"],"s

Ruby versions

I'm trying to work through a few issues with gems and attempting to use Ruby 2.7.5 and/or 3.0.3 via nixpkgs, and there seem to be some weird issues around installing gems correctly and ascertaining the ruby version, and this seems relevant.

Version mapping in Bundix only includes Ruby versions from 1.8 to 2.6:

bundix/lib/bundix.rb

Lines 67 to 77 in 692e9b7

"mingw" => [{engine: "mingw"}],
"truffleruby" => [{engine: "ruby"}],
"x64_mingw" => [{engine: "mingw"}],
}.each do |name, list|
PLATFORM_MAPPING[name] = list
%w(1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6).each do |version|
PLATFORM_MAPPING["#{name}_#{version.sub(/[.]/,'')}"] = list.map do |platform|
platform.merge(:version => version)
end
end
end

This seems to be a hard-coded duplication of the list available versions from bundler 1.x.x (which is now very outdated):

https://github.com/rubygems/rubygems/blob/d7089abb6a3c922bfe74199c103e745bb11bd46f/lib/bundler/current_ruby.rb#L12-L22

On the other hand, the latest version of bundler in nixpkgs is now based on bundler 2.3.6 (which lists Ruby versions up to 3.0) here but in the mean time Ruby 3.1.0 and 3.1.1 have now been released.

gemspec and rake does not work together

If a gem is created with gemspec within the Gemfile and with rake, then rake doesn't work as it is trying to find the gemspec in /nix/store as opposed to the current directory in nix-shell. This problem has been discussed in IRC in the past, but I don't see an issue for it?

19:35 <emptyfl4sk> I'm having an issue with nix/ruby/bundix/rake: https://gist.github.com/emptyflask/7cab84936deeba15a89090cc16ab0bf2
19:35 <emptyfl4sk> rake is trying to find the gemspec in it's /nix/store directory instead of the current one
19:36 <emptyfl4sk> output is in the above gist 
20:01 <manveru> emptyfl4sk: does your Gemfile happen to have a `gemspec` line in it?
20:02 <manveru> emptyfl4sk: because that's not supported

To reproduce

  1. Create a Gemfile:
source "https://rubygems.org"

gemspec
gem "rake"
  1. Create a gemspec file:
Gem::Specification.new do |spec|
  spec.name          = "abc"
  spec.version       = "1.0"
  spec.authors       = ["1234"]
  spec.email         = ["[email protected]"]

  spec.summary       = %q{Write a short summary, because RubyGems requires one.}
  spec.description   = %q{Write a longer description or delete this line.}
  spec.homepage      = "https://github.com"
end
  1. Run bundix -l and bundix -i to generate the Gemfile.lock, gemset.nix, and shell.nix
  2. Run nix-shell --run "rake" and see the following error:
Traceback (most recent call last):
        8: from /nix/store/svs5z5yvmg3nqgnfnp3zk9gkr7rk3zqn-hi-bundler-env/bin/rake:18:in `<main>'
        7: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:143:in `setup'
        6: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:195:in `definition'
        5: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:34:in `build'
        4: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:12:in `evaluate'
        3: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:47:in `eval_gemfile'
        2: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:47:in `instance_eval'
        1: from /nix/store/ylbnnp1qzwxckvdkamyv7q5pazlhfbwm-gemfile-and-lockfile/Gemfile:3:in `eval_gemfile'
/nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:87:in `gemspec': There are no gemspecs at /nix/store/ylbnnp1qzwxckvdkamyv7q5pazlhfbwm-gemfile-and-lockfile (Bundler::InvalidOption)
        8: from /nix/store/svs5z5yvmg3nqgnfnp3zk9gkr7rk3zqn-hi-bundler-env/bin/rake:18:in `<main>'
        7: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:143:in `setup'
        6: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler.rb:195:in `definition'
        5: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/definition.rb:34:in `build'
        4: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:12:in `evaluate'
        3: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:47:in `eval_gemfile'
        2: from /nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:47:in `instance_eval'
        1: from /nix/store/ylbnnp1qzwxckvdkamyv7q5pazlhfbwm-gemfile-and-lockfile/Gemfile:3:in `eval_gemfile'
/nix/store/vi5dq1dhdy60jbz4mjqh86dq777wmbl7-bundler-2.1.4/lib/ruby/gems/2.6.0/gems/bundler-2.1.4/lib/bundler/dsl.rb:87:in `gemspec':  (Bundler::Dsl::DSLError)
[!] There was an error parsing `Gemfile`: There are no gemspecs at /nix/store/ylbnnp1qzwxckvdkamyv7q5pazlhfbwm-gemfile-and-lockfile. Bundler cannot continue.

 #  from /nix/store/ylbnnp1qzwxckvdkamyv7q5pazlhfbwm-gemfile-and-lockfile/Gemfile:3
 #  -------------------------------------------
 #  
 >  gemspec
 #  gem "rake"
 #  -------------------------------------------

To work around

Do not use gemspec and hard code the dependencies in Gemfile

bundix fails when installing iruby because of missing system library

I am trying to use bundix to generate a gemfile.nix for iruby but it fails on rbczmq because of some missing dependency (see below). Am I doing something wrong? Is the workaround to start bundix from the nix-shell with all dependencies installed? How does the gemset.nix know about them in that case?

cat Gemfile

source 'https://rubygems.org'
gem 'sensu'
gem 'iruby'
gem 'cztop'
gem 'rbczmq'

$(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic

Fetching rbczmq 1.7.9
Installing rbczmq 1.7.9 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/matto/projects/jupyter/jupyterWith/kernels/iruby/vendor/bundle/ruby/2.5.0/gems/rbczmq-1.7.9/ext/rbczmq
/nix/store/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/ruby -r ./siteconf20190126-31647-obb2gz.rb extconf.rb
"./autogen.sh"
autogen.sh: error: could not find libtool.  libtool is required to run autogen.sh.
ZeroMQ autogen failed!
*** 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/imzyjwl9yv28h02zwsjpdsb2va7s8rqk-ruby-2.5.3/bin/$(RUBY_BASE_NAME)
	--with-system-libs
	--without-system-libs

extconf failed, exit code 1

Gem files will remain installed in
/home/matto/projects/jupyter/jupyterWith/kernels/iruby/vendor/bundle/ruby/2.5.0/gems/rbczmq-1.7.9 for inspection.
Results logged to
/home/matto/projects/jupyter/jupyterWith/kernels/iruby/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/rbczmq-1.7.9/gem_make.out

An error occurred while installing rbczmq (1.7.9), and Bundler cannot continue.
Make sure that `gem install rbczmq -v '1.7.9' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rbczmq
Traceback (most recent call last):
	2: from /nix/store/5jxqw6bb1h0r3iq0my8f5g8ijp5njcpb-bundix-2.3.1/bin/.bundix-wrapped:18:in `<main>'
	1: from /nix/store/5jxqw6bb1h0r3iq0my8f5g8ijp5njcpb-bundix-2.3.1/bin/.bundix-wrapped:18:in `load'
/nix/store/5jxqw6bb1h0r3iq0my8f5g8ijp5njcpb-bundix-2.3.1/lib/ruby/gems/2.5.0/gems/bundix-2.3.1/bin/bundix:79:in `<top (required)>': unhandled exception
matto@matto-dell:~/projects/jupyter/jupyterWith/kernels/iruby$ gem 
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help gem_dependencies    gem dependencies file guide
    gem help platforms           gem platforms guide
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 http://localhost:8808/
                                 with info about installed gems
  Further information:
    http://guides.rubygems.org
matto@matto-dell:~/projects/jupyter/jupyterWith/kernels/iruby$ gem install rbczmq -v '1.7.9' --source 'https://rubygems.org/'
Fetching: rbczmq-1.7.9.gem (100%)
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.
matto@matto-dell:~/projects/jupyter/jupyterWith/kernels/iruby$ ls
Gemfile  Gemfile.lock  gemset.nix  shell.nix  vendor

Bundix doesn't work with the `ruby` option in the Gemfile if bundix is built with a different ruby version

So I've been having a weird issue were I couldn't use bundix inside of nix shell using a bundlerEnv.

I'd get an error like couldn't find gem ruby 2.7.2 found 2.6.6 (going from memory, sorry).

Anyway, while debugging a different issue with bundix (why I had both ruby 2.6 and 2.7 in my closure) I found out the bundix derivation has a ruby option. Passing ruby = pkgs.ruby_2_7 into bundix makes this issue go away, which makes me assume bundix is using it's own version of ruby when bundling thus why it can't find the version of ruby the app is using.

I'm not sure if there is a better fix other than passing bundix the same version of ruby as your bundlerEnv, but I figured I'd open an issue to hopefully spark discussion or at least help people running into the same issue

bundix -l not working

I have recently updated from bundix 2.3.1 to 2.4.1. Prior to this update I would normally run bundix -l in a directory containing a Gemfile and this would create a Gemfile.lock and gemset.nix file, but since the upgrade I get the following error:

[nix-shell:~/nixpkgs/pkgs/applications/version-management/redmine]$ bundix --lockfile=Gemfile.lock -l
Traceback (most recent call last):
        8: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'
        7: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/bin/.bundix-wrapped:18:in `load'
        6: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/bin/bundix:5:in `<top (required)>'
        5: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:22:in `run'
        4: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:35:in `run'
        3: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:148:in `build_gemset'
        2: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:47:in `convert'
        1: from /nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:177:in `parse_lockfile'
/nix/store/5s5847yw3zmnfyqq6k9f9jd9jylq998s-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:177:in `read': No such file or directory @ rb_sysopen - /home/aaron/nixpkgs/pkgs/applications/version-management/redmine/Gemfile.lock (Errno::ENOENT)

Trying to get a rails app set up, not sure if my problem is with how I'm going about it or something else

I'm trying to use bundix via the template given here https://github.com/areina/nix-new-rails-app

I've run into an issue where every time I've gotten to the third step in this I just get logged out of NixOS, as per the issue I opened with the template areina/nix-new-rails-app#1 I don't have a ton of experience with nix, and less with ruby. But I really need a working rails so that I can get moving on a project I have, so any help you can offer here on helping me figure out how to get a rails project set up and running on my NixOS I'd appreciate it.

Improve downloading

Depending on the nix-prefetch-* scripts is a little fragile, since the flags change on occassion, as does the output format.

With the recent landing of NixOS/nix@d367b8e, the next release of Nix should allow us to do something like this instead:

nix-build --hash -E 'with import <nixpkgs> {}; fetchgit { url = "https://github.com/NixOS/nix.git"; sha256 = "ffffffffffffffffffffffffffffffffffffffffffffffffffff"; }'

"Could not find nokogiri..." when starting a new Rails project on macOS 11.4

On an empty directory, I generated a new rails project and ran bundix.

nix-shell \
  -p "ruby_3_0.withPackages (ps: with ps; [ rails ])" \
  -p bundix \
  --run "rails new . && bundle lock && bundix --ruby=ruby_3_0"

Then I wrote a shell.nix.

with (import <nixpkgs> {});
let
  ruby = ruby_3_0;
  gems = bundlerEnv {
    name = "project-bundler-env";
    inherit ruby;
    gemdir = ./.;
  };
in mkShell { packages = [ gems gems.wrappedRuby ]; }

After running nix-shell, I got a wrong hash error for the nokogiri gem.

trying https://rubygems.org/gems/nokogiri-1.11.7.gem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9134k  100 9134k    0     0  9330k      0 --:--:-- --:--:-- --:--:-- 9320k
hash mismatch in fixed-output derivation '/nix/store/a35hgacdgwh9a52mx6ssf0ijb60axkcn-nokogiri-1.11.7.gem':
  wanted: sha256:09gvjipcs9yq3hdxk1cvyjmkrsykg2y6vmcyhr36bcmcpb3xjqc7
  got:    sha256:1vrn31385ix5k9b0yalnlzv360isv6dincbcvi8psllnwz4sjxj9
cannot build derivation '/nix/store/rn68g11q177bvb95s5bps2vxki8p5lsx-ruby3.0.2-nokogiri-1.11.7.drv': 1 dependencies couldn't be built

I changed the hash in gemset.nix to the correct one, re-ran nix-shell and I got a shell. But, all commands complain that nokogiri is missing and I'm stuck:

$ rails --help
Warning: the running version of Bundler (2.2.20) is older than the version that created the lockfile (2.2.22). We suggest you to upgrade to the version that created the lockfile by running `gem install bundler:2.2.22`.
/nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find nokogiri-1.11.7-x86_64-darwin in any of the sources (Bundler::GemNotFound)
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/spec_set.rb:90:in `map!'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/spec_set.rb:90:in `materialize'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/definition.rb:189:in `specs'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/definition.rb:258:in `specs_for'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/definition.rb:240:in `requested_specs'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/runtime.rb:91:in `block in definition_method'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler/runtime.rb:20:in `setup'
	from /nix/store/9jd5clm6bgqiyxpnlchr4iqm9n490kk4-bundler-2.2.20/lib/ruby/gems/3.0.0/gems/bundler-2.2.20/lib/bundler.rb:149:in `setup'
	from /nix/store/p8wa7vvcjq5rxl56rr8wmbgmrfq8r6z2-oioi/bin/rails:18:in `<main>'

Any idea of what I'm doing wrong?

bundix tries to parse nix warnings as json

Traceback (most recent call last):
        9: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'
        8: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/bin/.bundix-wrapped:18:in `load'
        7: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/bin/bundix:5:in `<top (required)>'
        6: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:22:in `run'
        5: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:35:in `run'
        4: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:148:in `build_gemset'
        3: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:46:in `convert'
        2: from /nix/store/l4m610068rc36p5laaarfm54w0y8i6ih-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:173:in `parse_gemset'
        1: from /nix/store/700m2jpk8q8n084fllivi6pzkc2rvi11-ruby-2.5.3/lib/ruby/2.5.0/json/common.rb:156:in `parse'
/nix/store/700m2jpk8q8n084fllivi6pzkc2rvi11-ruby-2.5.3/lib/ruby/2.5.0/json/common.rb:156:in `parse': 765: unexpected token at 'arning: unknown setting 'system-features' (JSON::ParserError)

Installing nokogiri fails to install on NixOS 16.03

When installing rails using bundix on NixOS 16.03 with the following Nix expression, nokogiri fails to install because it Could not find 'pkg-config' (~> 1.1.7) among 5 total gem(s). The workaround is to first gem install pkg-config inside nix-shell and then update the Nix expression with bundlerEnv. It either looks like dependencies are not installed in the correct order or the gem path is getting mangled somewhere? Any help on where to look would be greatly appreciated!

Gemfile

source 'https://rubygems.org'

gem 'rails'

default.nix

with (import <nixpkgs> {});

let
  rubyenv = bundlerEnv {
    name = "rb";
    inherit ruby;
    gemfile = ./Gemfile;
    lockfile = ./Gemfile.lock;
    gemset = ./gemset.nix;
  };
in stdenv.mkDerivation {
  name = "myProject";
  version = "0.0.1";

  buildInputs = [
    stdenv
    git

    # Ruby deps
    ruby
    bundler
    bundix

    # Rails deps
    clang
    libxml2
    libxslt
    readline
    sqlite
    openssl

    rubyenv
  ];

  shellHook = ''
    export PS1="[myProject] > "
    export LIBXML2_DIR=${pkgs.libxml2}
    export LIBXSLT_DIR=${pkgs.libxslt}
  '';
}

Bundix can't find Bundler 2.0.1

I've got a local overlay that looks something like this:

super: self:
let
  inherit (super) callPackage;
in rec
{
  ruby_ = self.ruby_2_6;

  bundler_ = callPackage ./bundler {
    ruby = ruby_;
  };

  bundix_ = self.bundix.override {
    bundler = bundler_;
  };
}

bundler/default.nix looks like this

{ buildRubyGem, ruby }:

buildRubyGem rec {
  inherit ruby;
  name = "${gemName}-${version}";
  gemName = "bundler";
  version = "2.0.1";
  source.sha256 = "1sjnfsyw80g56kj96gdfgxfb793h6d5fyyir4zf2x71wk4wq1qy7";
  dontPatchShebangs = true;

  postFixup = ''
    sed -i -e "s/activate_bin_path/bin_path/g" $out/bin/bundle
  '';
}

And I do have ruby 2.6, bundler 2.0.1 and bundix 2.4.1 on PATH correctly. Running bundle works as expected. However, running bundix afterwards does not:

ฮป โฏ bundix
Traceback (most recent call last):
        8: from /nix/store/i9ijrf8mf57b5rc8dggwn898z2476glb-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'
        7: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
        6: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems.rb:303:in `synchronize'
        5: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems.rb:304:in `block in activate_bin_path'
        4: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems/specification.rb:1420:in `activate'
        3: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `activate_dependencies'
        2: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems/specification.rb:1438:in `each'
        1: from /nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems/specification.rb:1449:in `block in activate_dependencies'
/nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/2.6.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (2.0.1) required by your /home/chris/dev/haven/nexus/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.1`
Checked in 'GEM_PATH=/nix/store/65fs409354vgm39n9xvkv1jwrk2ypz8y-bundler-2.0.1/lib/ruby/gems/2.6.0:/nix/store/i9ijrf8mf57b5rc8dggwn898z2476glb-bundix-2.4.1/lib/ruby/gems/2.6.0:/nix/store/vvrsz1mmlnfa25hmp8qmxf89angcn46v-ruby-2.6.2/lib/ruby/gems/2.6.0', execute `gem env` for more information

It says it searches for Bundler in /nix/store/65fs409354vgm39n9xvkv1jwrk2ypz8y-bundler-2.0.1/lib/ruby/gems/2.6.0, which does indeed contain the Bundler 2.0.1 gem.

So, I'm not entirely sure what bundix (or rather rubygems) wants from me here. Any idea what is wrong?

Bundix can't parse the Ruby version in a Gemfile

Setting the Ruby version in a Gemfile causes Bundix to try to download a gem named ruby. Removing the ruby "x.x.x" line from the Gemfile works.

Here's the top of my Gemfile:

source "https://rubygems.org"
ruby "2.4.3"

gem "rake"
# Other `gem` calls...

Here's the output of bundix -l:

Warning: the running version of Bundler (1.14.6) is older than the version that created the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Could not find gem 'ruby (~> 2.4.3.0)' in any of the gem sources listed in your Gemfile.
/nix/store/ffw0hnyf0dv5i6x7g5j49jy9q9d70gqg-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/bin/bundix:75:in `<top (required)>': unhandled exception
        from /nix/store/ffw0hnyf0dv5i6x7g5j49jy9q9d70gqg-bundix-2.3.1/bin/.bundix-wrapped:18:in `load'
        from /nix/store/ffw0hnyf0dv5i6x7g5j49jy9q9d70gqg-bundix-2.3.1/bin/.bundix-wrapped:18:in `<main>'

Cannot download from private gemserver

I authenticate to a private gemserver with basic auth, but bundix seems to lack a way to provide credentials.

Bundler reads credentials from the environment variable BUNDLE_GEMS__EXAMPLE__COM given a source of gems.example.com. Curl reads .netrc with the appropriate options. Is there any way to get nix-prefetch-url to use basic auth credentials?

Use the rubygems.org API to get the sha256 hashes

The version endpoint includes the corresponding sha256 hash (base16 encoded). We ought to use that, instead of using nix-prefetch-url.

If you'll asign this to me, I'll try to get to it when I have time.

"default" isn't included in groups on transitive dependencies listed explicitly in other groups

Suppose I have a Gemfile like this:

source "https://rubygems.org"
gem "actioncable"
gem "websocket-driver", group: :test

The gemset.nix generated by Bundix 2.4.1 will set ActionCable's groups to [ "default" ], and websocket-driver's to [ "test" ]. This means that the generated bundlerEnv wouldn't include websocket-driver unless the test group was included, even though it's required by the default group.

Skipping mygem: unkown bundler source

Source code - https://bitbucket.org/melgaardbjorn/umsf

$ nix-shell ./bundix.nix
[nix-shell:~/projects/umsf]$ bundix -m
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Writing lockfile to /home/bjorn/projects/umsf/Gemfile.lock
Using rake 10.5.0
Using CFPropertyList 2.3.6
Using coderay 1.1.2
Using colored 1.2
Using diff-lcs 1.3
Using method_source 0.9.0
Using rspec-support 3.7.1
Using bundler 1.14.6
Using doc_ripper 0.0.8
Using pry 0.11.3
Using rspec-core 3.7.1
Using rspec-expectations 3.7.0
Using rspec-mocks 3.7.0
Using umsf 0.1.0 from source at `.`
Using rspec 3.7.0
Bundle complete! 5 Gemfile dependencies, 15 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Updating files in vendor/cache
  * rake-10.5.0.gem
  * CFPropertyList-2.3.6.gem
  * coderay-1.1.2.gem
  * colored-1.2.gem
  * diff-lcs-1.3.gem
  * doc_ripper-0.0.8.gem
  * method_source-0.9.0.gem
  * pry-0.11.3.gem
  * rspec-support-3.7.1.gem
  * rspec-core-3.7.1.gem
  * rspec-expectations-3.7.0.gem
  * rspec-mocks-3.7.0.gem
  * rspec-3.7.0.gem
#<Bundler::LazySpecification:0x000000000143de28
 @__identifier=
  #<struct Bundler::LazySpecification::Identifier
   name="umsf",
   version=Gem::Version.new("0.1.0"),
   source=#<Bundler::Source::Path:0x6895340 source at `.`>,
   platform="ruby",
   dependencies=
    [Gem::Dependency.new("doc_ripper",
      Gem::Requirement.new([">= 0"]),
      :runtime)]>,
 @dependencies=
  [Gem::Dependency.new("doc_ripper",
    Gem::Requirement.new([">= 0"]),
    :runtime)],
 @name="umsf",
 @platform="ruby",
 @source=#<Bundler::Source::Path:0x6895340 source at `.`>,
 @specification=nil,
 @version=Gem::Version.new("0.1.0")>
Skipping umsf: unkown bundler source
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix/source.rb:11:in `convert'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix.rb:48:in `convert_spec'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix.rb:38:in `block in convert'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix.rb:37:in `reverse_each'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix.rb:37:in `with_object'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/lib/bundix.rb:37:in `convert'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/lib/ruby/gems/2.3.0/gems/bundix-2.3.1/bin/bundix:112:in `<top (required)>'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/bin/.bundix-wrapped:18:in `load'
/nix/store/4rip5j1l2bp4y4cjxpicqkjh7slfzh9b-bundix-2.3.1/bin/.bundix-wrapped:18:in `<main>'

is it because I have Gemfile with gemspec?

Why it creates gemset.nix with I have my gem (umsf) there (at the end)?

Empty set for "gemset" gem

Trying to pick up development of https://github.com/ruby-rdf/shex, I found that bundix produced a set in the gemset.nix like shex = {}; which led to tears when I tried to nix-shell. Should it be prevented in that case? There was a warning from bundix like "couldn't find a source for 'shex', skipping."

remove "BUNDLED WITH" from Gemfile.lock

When using bundix to package new applications, we should probably remove the "BUNDLED WITH" information from the generated Gemfile.lock.

For example, when packaging gitlab, on gitaly startup (done via bundle exec), it complains about the running version of bundler being older than the version that created the lockfile.

As we assemble the ruby environment via nix and not via bundler anyways, we can probably just remove the two lines from the Gemfile.lock

Gem binaries installed with :git => "repo" are placed in wrong path and can't be launched

source 'https://rubygems.org'

ruby '>= 2.3.0'

gem "xcode-install", :git => "https://github.com/adc-amatosov/xcode-install.git"

Build output:

unpacking source archive /nix/store/9s6kz1m35d7iq4x1rg9hw7mmjx6zsn74-xcode-install-7aa85c5
building path(s) โ€˜/nix/store/lnqkqy7r3890ks2hi3842xic32xpskl7-ruby2.3.4-activesupport-4.2.10โ€™
source root is xcode-install-7aa85c5
patching sources
building
installing
buildFlags: 
unpacking sources
patching sources
installing
buildFlags: 
Using xcode-install 2.3.1 from https://github.com/adc-amatosov/xcode-install.git (at 7aa85c5@7aa85c5)
post-installation fixup
patching script interpreter paths in /nix/store/wbghb1c9n9vyk0x5h49k9sxn3siryfx5-ruby2.3.4-xcode-install-2.3.1
/nix/store/wbghb1c9n9vyk0x5h49k9sxn3siryfx5-ruby2.3.4-xcode-install-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/xcode-install-7aa85c51a247/bin/xcversion: interpreter directive changed from "/usr/bin/env ruby" to "/nix/store/6mqq22y8isr1d3b585ajc5gj2rl66gmc-ruby-2.3.4/bin/ruby"

Binary is not discoverable in PATH. It fails with following error if launched with full path:

/nix/store/6mqq22y8isr1d3b585ajc5gj2rl66gmc-ruby-2.3.4/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
	from /nix/store/6mqq22y8isr1d3b585ajc5gj2rl66gmc-ruby-2.3.4/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /nix/store/wbghb1c9n9vyk0x5h49k9sxn3siryfx5-ruby2.3.4-xcode-install-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/xcode-install-7aa85c51a247/bin/xcversion:6:in `<main>'

git submodules are not cloned

This is at the top of my Gemfile.lock:

GIT
  remote: https://github.com/tmm1/http_parser.rb
  revision: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
  ref: 54b17ba8c7d8d20a16dfc65d1775241833219cf2
  specs:
    http_parser.rb (0.6.1)

http_parser fails to build, because the git submodule in ext/ruby_http_parser/vendor/http-parser is not cloned.

    current directory: /nix/store/0gx1ydxnqab5crprz48bwz0vjprnmq39-ruby2.6.1-http_parser.rb-0.6.1/lib/ruby/gems/2.6.0/bundler/gems/http_parser.rb-54b17ba8c7d8/ext/ruby_http_parser
/nix/store/9h785sf1zqw26zn8rhrcqq3xcz1gw4v7-ruby-2.6.1/bin/ruby -I /nix/store/9h785sf1zqw26zn8rhrcqq3xcz1gw4v7-ruby-2.6.1/lib/ruby/2.6.0 -r ./siteconf20190322-697-aqdpkf.rb extconf.rb ''
*** 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/9h785sf1zqw26zn8rhrcqq3xcz1gw4v7-ruby-2.6.1/bin/$(RUBY_BASE_NAME)
extconf.rb:17:in `read': No such file or directory @ rb_sysopen - /nix/store/0gx1ydxnqab5crprz48bwz0vjprnmq39-ruby2.6.1-http_parser.rb-0.6.1/lib/ruby/gems/2.6.0/bundler/gems/http_parser.rb-54b17ba8c7d8/ext/ruby_http_parser/vendor/http-parser/http_parser.c (Errno::ENOENT)
        from extconf.rb:17:in `block (2 levels) in <main>'
        from extconf.rb:16:in `open'
        from extconf.rb:16:in `block in <main>'
        from extconf.rb:15:in `each'
        from extconf.rb:15:in `<main>'

extconf failed, exit code 1

Local gems (specified with a path)

In my gemfile I have some gems that are local to my projects, ie:

gem 'simple_operation', path: './simple_operaton'

Bundix will generate a gemset.nix for this (without a "source" attribute). However, nix-shell borks complaining there is no "source". How should I deal with this?

Inject system dependency while still using common overrrides

I have a flake.nix along the lines of

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
        myGems = pkgs.bundlerEnv {
          name = "somegems";
          ruby = pkgs.ruby;
          gemdir = ./.;
          # Uncommenting this breaks things by removing all default overrides. How can I avoid that?
          /*
          gemConfig.some-gem-without-default-override = attrs: {
            buildInputs = with pkgs; [ ... ]
          }
          */
        };
      in {
        devShell = pkgs.mkShell {
          nativeBuildInputs = [ pkgs.myGems ];
        };
      });
}

Where gemset.nix contains gems that require injecting native dependencies. Some of these have defined overrides in https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/ruby-modules/gem-config/default.nix, some do not. I want to define some overrides for packages that do not. My problem is that doing so disables all the universal overrides, and I have no interest in duplicating the entirety of that file in mine.

Unable to fetch from dependencies rubygems.org

I'm not sure whether this is an issue with bundix, or bundler (or NixOS or rubygems), but I'm hoping someone can point me in the right direction.

I was previously able to package gems on NixOS. I used BundlerApp to package coderay and rouge.

I recently updated NixOS from 17.09 to 18.03, which may or may not be related. I can no longer fetch dependencies from rubygems. So far it appears possibly related to 416 (Range Not Satisfiable) responses Bundler is receiving from rubygems.

To illustrate with coderay, a gem I was previously able to package, I create a Gemfile:

mkdir coderay &&
  cd coderay &&
  cat <<EOF > Gemfile
source 'https://rubygems.org'
gem 'coderay'
EOF

I run bundix, and after some initial progress, it hangs for exactly 1 minute:

$(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/
Resolving dependencies...
Writing lockfile to /home/ivan/Development/code/bundix-sandbox/coderay/Gemfile.lock
Fetching gem metadata from https://rubygems.org/..
Fetching version metadata from https://rubygems.org/.

Finally, it prints Using bundler 1.14.6, followed by an error:

Gem::RemoteFetcher::UnknownHostError: timed out
(https://rubygems.org/gems/coderay-1.1.2.gem)
An error occurred while installing coderay (1.1.2), and Bundler cannot
continue.
Make sure that `gem install coderay -v '1.1.2'` succeeds before bundling.

To debug, I dropped into a nix-shell -p bundler and ran:

bundler package --no-install --verbose --path vendor

This immediately shows:

HTTP GET https://index.rubygems.org/versions
HTTP 416 Range Not Satisfiable https://index.rubygems.org/versions
Bundler::HTTPError: Net::HTTPRequestedRangeNotSatisfiable
  (stack trace omitted)

followed by:

HTTP GET https://index.rubygems.org/api/v1/dependencies
HTTP 200 OK https://index.rubygems.org/api/v1/dependencies
Fetching gem metadata from https://rubygems.org/
HTTP GET https://index.rubygems.org/api/v1/dependencies
HTTP 200 OK https://index.rubygems.org/api/v1/dependencies
Query List: ["coderay"]
Query Gemcutter Dependency Endpoint API: coderay
HTTP GET https://index.rubygems.org/api/v1/dependencies?gems=coderay
HTTP 200 OK https://index.rubygems.org/api/v1/dependencies?gems=coderay
Query List: []
Fetching version metadata from https://rubygems.org/
HTTP GET https://index.rubygems.org/api/v1/dependencies
HTTP 200 OK https://index.rubygems.org/api/v1/dependencies
Query List: []
Resolving dependencies...
Using bundler 1.14.6
0:  bundler (1.14.6) from /nix/store/7wf7a3bqivikakmkhk9v1y92f6090phz-bundler-1.14.6/lib/ruby/gems/2.4.0/specifications/bundler-1.14.6.gemspec
Gem::RemoteFetcher::UnknownHostError: timed out

It looks like a series of requests are hitting the same endpoint ( https://index.rubygems.org/api/v1/dependencies ), though I'm not sure what to make of that.

Using libcurl with a gem

I have a project that requires libcurl in one of the gems (curb). Unfortunately, this gem will not build with bundix, and I am unsure how to stitch things together in this case. What is the best practice for dealing with things like this in bundix? Here is a gist of what I have so far:

https://gist.github.com/ianks/959782e1425a92538624eeee534fc09b

Essentially, the curb gem needs the arguments --with-curl-dir, and I am not sure how to make that happen. Any ideas?

Cannot install webpacker

[nix-shell:~/human]$ cat ~/temp/default.nix 
with (import <nixpkgs> {});
let
  gems = bundlerEnv {
    name = "your-package";
    inherit ruby;
    gemdir = ./.;
  };
in stdenv.mkDerivation {
  name = "your-package";
  buildInputs = [gems ruby];
}

Packages used by the current nix-shell

[nix-shell:~/human]$ cat ./default.nix 
with (import <nixpkgs> {});
let
  gems = bundlerEnv {
    name = "your-package";
    inherit ruby;
    gemdir = ./.;
  };
in stdenv.mkDerivation {
  name = "your-package";
  buildInputs = [
gems
ruby
libffi
unison
purePackages.ffi
postgresql
nodejs
yarn
ruby
redis
sqlite
];
}

The current versions of everything and my attempt to install webpacker.

[nix-shell:~/human]$ bash doitall.sh 
+ bundle --version
Warning: the running version of Bundler (1.14.6) is older than the version that crea
ed the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by
running `gem install bundler`.
Bundler version 1.14.6
+ ruby --version
ruby 2.3.5p376 (2017-09-14) [x86_64-linux]
+ irb --version
irb 0.9.6(09/06/30)
+ bundix --version
2.3.1
+ rails --version
Rails 5.1.5
+ tail Gemfile.lock
  spring-watcher-listen (~> 2.0.0)
  sqlite3
  turbolinks (~> 5)
  tzinfo-data
  uglifier (>= 1.3.0)
  web-console (>= 3.3.0)
  webpacker

BUNDLED WITH
   1.16.0
+ bundle binstubs webpacker
Warning: the running version of Bundler (1.14.6) is older than the version that crea
ed the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by
running `gem install bundler`.
There was an error accessing
`/nix/store/bfvgqh7wy75ds3xzdmimb08pgnhfsc9m-gemfile-and-lockfile/bin`.
The underlying system error is Errno::EROFS: Read-only file system @ dir_s_mkdir -
/nix/store/bfvgqh7wy75ds3xzdmimb08pgnhfsc9m-gemfile-and-lockfile/bin

[nix-shell:~/human]$ 

Notice the Warning on the Bundler version.
Notice 1.14.6 as per the bundler command
and 1.16.0 as per the Gemfile.lock.

The Gemfile.lock was generated using bundix -l as I understand it.

[nix-shell:~/human]$ bundle exec rails webpacker:verify_install
Warning: the running version of Bundler (1.14.6) is older than the version that crea
ed the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by
running `gem install bundler`.
Webpack binstubs not found.
Have you run rails webpacker:install ?
Make sure the bin directory or binstubs are not included in .gitignore
Exiting!

[nix-shell:~/human]$ 

run bundle binstubs webpacker from "." happens when I run bundle exec rails webpacker:install

I'm not sure how it ends up using bundler version 1.16.0 when bundix does:

https://github.com/manveru/bundix/blob/e2195372df0ca2c630150b0321474d56ae26844e/lib/bundix/commandline.rb#L141

and the currently delivered version of bundler by the nixos packages repository is version 1.14.6,

and it seems that's what the bundix default.nix installs, as per:

https://github.com/manveru/bundix/blob/7b3c876a2d20c61ba895002fca1789b3dd11b582/default.nix#L4

I have not found how to install binstubs through bundix.

gemset.nix missing source values

Running the following commands inside a nix env that has bundix and bundler installed from nixpkgs results in a gemset.nix that is missing source values.

Repro

Command

bundler package
bundler lock
bundix -d

Gemfile

source 'https://rubygems.org'
gem 'oauth2', '~> 1.0.0'

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    faraday (0.9.2)
      multipart-post (>= 1.2, < 3)
    jwt (1.5.4)
    multi_json (1.12.1)
    multi_xml (0.5.5)
    multipart-post (2.0.0)
    oauth2 (1.0.0)
      faraday (>= 0.8, < 0.10)
      jwt (~> 1.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (~> 1.2)
    rack (1.6.4)

PLATFORMS
  ruby

DEPENDENCIES
  oauth2 (~> 1.0.0)

BUNDLED WITH
   1.11.2

gemset.nix

{
  faraday = {
    dependencies = ["multipart-post"];
  };
  jwt = {
  };
  multi_json = {
  };
  multi_xml = {
  };
  multipart-post = {
  };
  oauth2 = {
    dependencies = ["faraday" "jwt" "multi_json" "multi_xml" "rack"];
  };
  rack = {
  };
}

You have already activated bundler 1.16.1, but your Gemfile requires bundler 1.14.6.

Good afternoon! I'm hoping to use bundix to manage the installation of some ruby gems, but am running into issues.

Under bundix, I'm using the following Gemfile:

source 'https://rubygems.org'
gem 'cocoapods', '1.1.1'
gem 'earlgrey', '0.1.5'
gem 'xcpretty', '0.2.4'
gem 'fastlane', '2.55.0'
gem 'jazzy', '0.8.3'
gem 'fui', '~> 0.4.0'

But when I try to use any of the gems, I get the error message:

[nix-shell:~/Projects/ios2]$ fastlane
--
/nix/store/gzifhsc6nsakp1dhj8krp1zna4dkalzs-bundler-1.14.6/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:40:in `block in setup': You have already activated bundler 1.16.1, but your Gemfile requires bundler 1.14.6. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
from /nix/store/ypvvh2vg68ybgr988x0pjdxvj8ih0vb5-ruby-2.4.3/lib/ruby/2.4.0/forwardable.rb:229:in `each'
from /nix/store/ypvvh2vg68ybgr988x0pjdxvj8ih0vb5-ruby-2.4.3/lib/ruby/2.4.0/forwardable.rb:229:in `each'
from /nix/store/gzifhsc6nsakp1dhj8krp1zna4dkalzs-bundler-1.14.6/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `map'
from /nix/store/gzifhsc6nsakp1dhj8krp1zna4dkalzs-bundler-1.14.6/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:25:in `setup'
from /nix/store/gzifhsc6nsakp1dhj8krp1zna4dkalzs-bundler-1.14.6/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler.rb:102:in `setup'
from /nix/store/7hslg2r9ayvm1jzzx6znvkwhaimv5gib-pinterest/bin/fastlane:16:in `<main>'

Setup:

  • running the latest version of nix 2.0.2 but it reproduces on all versions of nix
  • bundler-1.16.1 installed locally on my system, which seems to cause problems with the nix installation.

It looks like there may be a conflict in the installation script that causes this. Do you know of how to fix this?

Bundix fails to install gem if binary has unicode character in its name (e.g. emoji)

xcode-install uses ๐Ÿš€ for bin name

Here is example gemfile:

source 'https://rubygems.org'

ruby '>= 2.3.0'

gem "xcode-install"

nix-build fails with the following error:

/nix/store/lb2fn9h6bj6k531izcd065dcdrvwvcr5-gen-bin-stubs.rb:21:in `split': invalid byte sequence in US-ASCII (ArgumentError)
	from /nix/store/lb2fn9h6bj6k531izcd065dcdrvwvcr5-gen-bin-stubs.rb:21:in `block in <main>'
	from /nix/store/lb2fn9h6bj6k531izcd065dcdrvwvcr5-gen-bin-stubs.rb:17:in `each'
	from /nix/store/lb2fn9h6bj6k531izcd065dcdrvwvcr5-gen-bin-stubs.rb:17:in `<main>'
builder for โ€˜/nix/store/lnka6dfxdj6yjlnxsxvwicirbiqj6458-gems.drvโ€™ failed with exit code 1

Output of locale:

locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

`bundix -l` doesn't seem to work

If I run bundix -l in a folder that has no Gemfile.lock I get an error that ends in

	1: from /nix/store/apxmjv7b5hs0jb33icjq20pzkcb9myz7-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:177:in `parse_lockfile'
/nix/store/apxmjv7b5hs0jb33icjq20pzkcb9myz7-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix.rb:177:in `read': No such file or directory @ rb_sysopen - Gemfile.lock (Errno::ENOENT)

failing to execute bundix due to bundler version read in Gemfile

Hello,

It would seem that bundix is unhappy with the bundler read in the Gemfile. My understanding is bundix should be an isolated binary with all its necessary dependencies with it.

Traceback (most recent call last):
        8: from /nix/store/fm8l4xxawiw08a9ylwgzkqc46whgh53d-bundix-2.5.1/bin/.bundix-wrapped:18:in `<main>'
        7: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:298:in `activate_bin_path'
        6: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:298:in `synchronize'
        5: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:299:in `block in activate_bin_path'
        4: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1372:in `activate'
        3: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1390:in `activate_dependencies'
        2: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1390:in `each'
        1: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1402:in `block in activate_dependencies'
/nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (1.17.3) required by your /home/luis/code/tapresearch/raynor/Gemfile.lock. (Gem::MissingSpecVersionError)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
Checked in 'GEM_PATH=/nix/store/85p5si2a5amra5f3vbq6qjhsl127ck5i-bundler-2.3.9/lib/ruby/gems/2.7.0:/nix/store/fm8l4xxawiw08a9ylwgzkqc46whgh53d-bundix-2.5.1/lib/ruby/gems/2.7.0:/nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/gems/2.7.0' , execute `gem env` for more information
        8: from /nix/store/fm8l4xxawiw08a9ylwgzkqc46whgh53d-bundix-2.5.1/bin/.bundix-wrapped:18:in `<main>'
        7: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:298:in `activate_bin_path'
        6: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:298:in `synchronize'
        5: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems.rb:299:in `block in activate_bin_path'
        4: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1372:in `activate'
        3: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1390:in `activate_dependencies'
        2: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1390:in `each'
        1: from /nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1401:in `block in activate_dependencies'
/nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/2.7.0/rubygems/specification.rb:1404:in `rescue in block in activate_dependencies': Could not find 'bundler' (>= 1.11) among 57 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/nix/store/85p5si2a5amra5f3vbq6qjhsl127ck5i-bundler-2.3.9/lib/ruby/gems/2.7.0:/nix/store/fm8l4xxawiw08a9ylwgzkqc46whgh53d-bundix-2.5.1/lib/ruby/gems/2.7.0:/nix/store/ki8kjxf7bnrykyv3jsr8g7cqm8sgc9b2-ruby-2.7.6/lib/ruby/gems/2.7.0' at: /nix/store/fm8l4xxawiw08a9ylwgzkqc46whgh53d-bundix-2.5.1/lib/ruby/gems/2.7.0/specifications/bundix-2.5.0.gemspec, execute `gem env` for more information
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€>
โ”‚<rio>
โ”‚raynor
โ”‚on ๎‚  nix_configuration
โ””โ”€>โœ–  bundle --version
Bundler version 1.17.3```

Is there something I'm doing particularly wrong here?

Using paths for options causes error

If I try to use paths for any of the options I'm supposed to be able to, I get the following error:

% ./bin/bundix -i --lockfile=./Gemfile.lock
won't override existing shell.nix but here is what it'd look like:
Traceback (most recent call last):
	10: from ./bin/bundix:5:in `<main>'
	 9: from ./bundix/lib/bundix/commandline.rb:22:in `run'
	 8: from ./bundix/lib/bundix/commandline.rb:35:in `run'
	 7: from ./bundix/lib/bundix/commandline.rb:127:in `handle_init'
	 6: from ./bundix/lib/bundix/commandline.rb:120:in `shell_nix_string'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `result'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `eval'
	 3: from (erb):7:in `bind'
	 2: from ./bundix/lib/bundix/shell_nix_context.rb:20:in `lockfile_path'
	 1: from ./bundix/lib/bundix/shell_nix_context.rb:12:in `path_for'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:522:in `relative_path_from': different prefix: "/" and "." (ArgumentError)


% ./bin/bundix -i --gemfile=./Gemfile
won't override existing shell.nix but here is what it'd look like:
Traceback (most recent call last):
	10: from ./bin/bundix:5:in `<main>'
	 9: from ./bundix/lib/bundix/commandline.rb:22:in `run'
	 8: from ./bundix/lib/bundix/commandline.rb:35:in `run'
	 7: from ./bundix/lib/bundix/commandline.rb:127:in `handle_init'
	 6: from ./bundix/lib/bundix/commandline.rb:120:in `shell_nix_string'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `result'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `eval'
	 3: from (erb):6:in `bind'
	 2: from ./bundix/lib/bundix/shell_nix_context.rb:16:in `gemfile_path'
	 1: from ./bundix/lib/bundix/shell_nix_context.rb:12:in `path_for'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:522:in `relative_path_from': different prefix: "/" and "." (ArgumentError)

% ./bin/bundix -i --gemset=blah.nix
won't override existing shell.nix but here is what it'd look like:
Traceback (most recent call last):
	10: from ./bin/bundix:5:in `<main>'
	 9: from ./bundix/lib/bundix/commandline.rb:22:in `run'
	 8: from ./bundix/lib/bundix/commandline.rb:35:in `run'
	 7: from ./bundix/lib/bundix/commandline.rb:127:in `handle_init'
	 6: from ./bundix/lib/bundix/commandline.rb:120:in `shell_nix_string'
	 5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `result'
	 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `eval'
	 3: from (erb):8:in `bind'
	 2: from ./bundix/lib/bundix/shell_nix_context.rb:24:in `gemset_path'
	 1: from ./bundix/lib/bundix/shell_nix_context.rb:12:in `path_for'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:522:in `relative_path_from': different prefix: "/" and "." (ArgumentError)

I can emulate it if I change the command line test:

% git diff test/commandline.rb
diff --git a/test/commandline.rb b/test/commandline.rb
index 1c411e9..5f9a582 100644
--- a/test/commandline.rb
+++ b/test/commandline.rb
@@ -7,9 +7,9 @@ class CommandLineTest < Minitest::Test
     @cli.options = {
       project: "test-project",
       ruby: "test-ruby",
-      gemfile: "test-gemfile",
-      lockfile: "test-lockfile",
-      gemset: "test-gemset",
+      gemfile: Dir.pwd + File::PATH_SEPARATOR + "test-gemfile",
+      lockfile: Dir.pwd + File::PATH_SEPARATOR + "test-lockfile",
+      gemset: Dir.pwd + File::PATH_SEPARATOR + "test-gemset",
     }
   end


% rake
Run options: --seed 11948

# Running:

....E.....

Finished in 0.181851s, 54.9901 runs/s, 153.9722 assertions/s.

  1) Error:
CommandLineTest#test_shell_nix:
ArgumentError: different prefix: "/" and "."
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/pathname.rb:522:in `relative_path_from'
    ./bundix/lib/bundix/shell_nix_context.rb:12:in `path_for'
    ./bundix/lib/bundix/shell_nix_context.rb:16:in `gemfile_path'
    (erb):6:in `bind'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `eval'
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/erb.rb:901:in `result'
    ./bundix/lib/bundix/commandline.rb:120:in `shell_nix_string'
    ./bundix/test/commandline.rb:17:in `test_shell_nix'

10 runs, 28 assertions, 0 failures, 1 errors, 0 skips
rake aborted!
Command failed with status (1)
/Library/Ruby/Gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Tasks: TOP => default => test
(See full trace by running task with --trace)

I'm happy to write up a patch, I'm not sure how you want it though.

Should lib/bundix/commandline.rb turn the full paths (File.expand_path(value)) back in to relative paths ?

bundix -l fails when path has spaces

bundix -l is trying to import gemset.nix, but failing because there are spaces in the path.

[nix-shell:~/main/Personal/Ruby Programs/youtube best]# bundix -l
$ nix-instantiate --eval -E builtins.toJSON(import /root/main/Personal/Ruby Programs/youtube best/gemset.nix)
error: getting status of '/root/main/Personal/Ruby': No such file or directory
Traceback (most recent call last):
	5: from /nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/bin/.bundix-wrapped:18:in `<main>'
	4: from /nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/bin/.bundix-wrapped:18:in `load'
	3: from /nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/lib/ruby/gems/2.5.0/gems/bundix-2.3.1/bin/bundix:112:in `<top (required)>'
	2: from /nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/lib/ruby/gems/2.5.0/gems/bundix-2.3.1/lib/bundix.rb:33:in `convert'
	1: from /nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/lib/ruby/gems/2.5.0/gems/bundix-2.3.1/lib/bundix.rb:79:in `parse_gemset'
/nix/store/4rq534znwzp27a3y9c81agl30hab9cr6-bundix-2.3.1/lib/ruby/gems/2.5.0/gems/bundix-2.3.1/lib/bundix.rb:122:in `sh': command execution failed: pid 4368 exit 1 (RuntimeError)

Serialization of Nil object crashes the CLI

Reproduce the bug

While trying to generate a gemset.nix with Bundix I got the following error and stacktrace:

Traceback (most recent call last):                                                                                       
        30: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'                                                                                                      
        29: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/bin/.bundix-wrapped:18:in `load'                 
        28: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/bin/bundix:5:in `<top (required)>'
        27: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:22:in `run' 
        26: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:36:in `run'
        25: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:158:in `save_gemset'                                                    
        24: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:152:in `object2nix'                                                     
        23: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:20:in `serialize'                                                             
        22: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:83:in `serialize'                                                             
        21: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'                                                                                                     
        20: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'                                                                                                       
        19: from (erb):2:in `serialize'                                                                                                                                                                           
        18: from (erb):2:in `each'                                                                                                                                                                                
        17: from (erb):2:in `block in serialize'                                                                                                                                                                  
        16: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub'        
        15: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:83:in `serialize'
        14: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'                                                                                                     
        13: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'                           
        12: from (erb):2:in `serialize'                                                                                                                                                                           
        11: from (erb):2:in `each'                                                                                                                                                                                
        10: from (erb):2:in `block in serialize'                                                                                        
         9: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub'
         8: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:85:in `serialize'
         7: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'             
         6: from /nix/store/ircjrhgliaq9r64jzk7gi2xi881521km-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'             
         5: from (erb):1:in `serialize'                                                                                                                    
         4: from (erb):1:in `each_with_index'                                                                                                     
         3: from (erb):1:in `each'                                                                                                                  
         2: from (erb):1:in `block in serialize'                                                                                                
         1: from /nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub' 
/nix/store/dfrk2vp3g8xj8jm9gdb8hs83vqqfzmvx-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:100:in `serialize': Cannot convert to nix: nil (RuntimeError)

This happened to me with a generic 'gem' Gemfile:

source "https://rubygems.org"

gemspec

With the gem specification in the *.gemspec file:

Gem::Specification.new do |s|
  [...]

  s.add_dependency "pg", "~> 1.1.4"

  s.add_development_dependency "pry"
  s.add_development_dependency "standard"
  s.add_development_dependency "rake"
  s.add_development_dependency "minitest"
  s.add_development_dependency "vcr"
  s.add_development_dependency "webmock"
end

Quick fix

After applying a manual patch to handle nil object in the serializer case in bundix, the result works (with some extra junk in the platforms list of some gems)

Solution

I would rather have someone from the maintainer of bundix to check if it is safe to simply handle the nil cases in the serializer or if the problem comes from somewhere else before submitting a PR.

`bundix -m` fails on bundler >= 2.0

Running bundix -m with a modern bundler fails thus:

Fetching gem metadata from https://rubygems.org/.
Writing lockfile to /home/endgame/code/nix-overlay/sorbet/Gemfile.lock
Unknown switches "--all"
Traceback (most recent call last):
	5: from /nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/bin/.bundix-wrapped:18:in `<main>'
	4: from /nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/bin/.bundix-wrapped:18:in `load'
	3: from /nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/lib/ruby/gems/2.6.0/gems/bundix-2.5.0/bin/bundix:5:in `<top (required)>'
	2: from /nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/lib/ruby/gems/2.6.0/gems/bundix-2.5.0/lib/bundix/commandline.rb:22:in `run'
	1: from /nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/lib/ruby/gems/2.6.0/gems/bundix-2.5.0/lib/bundix/commandline.rb:33:in `run'
/nix/store/67mivbf50ixz8nqsvrby4dhp0z16qwkr-bundix-2.5.0/lib/ruby/gems/2.6.0/gems/bundix-2.5.0/lib/bundix/commandline.rb:107:in `handle_magic': unhandled exception

Bundix version: 2.5.0 from nixos-20.03
Bundler version 2.1.4 from nixos-20.03

Fetching private gems using bundler's credentials

So a few months back, I added support for bundix to look up bundler credentials to fetch gems requiring authentication. Today I took a run at teaching nix to do this without the runtime assistance of bundix, and this is what I came up with. It's pretty rough but Technically Worksโ„ข.

Anyone know how I could do this better? Is there a form I could shape this into that would make sense to merge into bundix?

I'm happy to pour a bunch of work into this if someone can point me in the right direction.

I'm going to want to come up with similar solutions for gems fetched from private git remotes.

# gemset.nix
let

  hostnameFromURL = url:
    builtins.elemAt (
      builtins.match "https?://([^/]+)/.*" url # [ "packages.shopify.io" ]
    ) 0; # "packages.shopify.io"

  bundlerVarFromHostname = hostname:
    with import <nixpkgs> { }; "BUNDLE_" + lib.toUpper (
      builtins.replaceStrings ["."] ["__"] hostname # "packages__shopify__io"
    ); # "BUNDLE_PACKAGES__SHOPIFY__IO"

  tokenFromHomeBundlerConfig = var:
    if   builtins.getEnv var != ""
    then builtins.getEnv var
    else builtins.elemAt (
      builtins.match ".*\n${var}: ([^\n]+)\n.*" (
        builtins.readFile ((builtins.getEnv "HOME") + "/.bundle/config")
      )
    ) 0;

  netrcEntryForGemURL = url:
    let
      hostname = hostnameFromURL url;
      var = bundlerVarFromHostname hostname;
      token = tokenFromHomeBundlerConfig var;
    in
      "machine ${hostname}\n\tlogin ${token}\n";

  fetchurlWithBundlerAuthentication = { url, sha256 }:
    let
      entry = netrcEntryForGemURL url;
    in
      with import <nixpkgs> {}; fetchurl {
        url = url;
        sha256 = sha256;

        netrcPhase = ''
          cat > netrc <<EOF
          ${entry}
          EOF
        '';
      };

in

{
  abc = {
    dependencies = ["def"];
    groups = ["development" "test"];
    platforms = [];
    source = {
      remotes = ["https://packages.shopify.io/shopify/gems"];
      sha256 = "0000000000000000000000000000000000000000000000000001";
      type = "gem";
    };
    src = fetchurlWithBundlerAuthentication {
      url = "https://packages.shopify.io/shopify/gems/gems/abc-0.0.1.gem";
      sha256 = "0000000000000000000000000000000000000000000000000001";
    };
    version = "0.0.1";
  };
}

Bundix doesn't work with a newly created gem

To reproduce the issue, consider this minimal gem specification.

bundix-issue.gemspec:

lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
  spec.name          = "bundix-issue"
  spec.version       = '0.1.0'
  spec.authors       = ["Sergei Maximov"]
  spec.email         = ["[email protected]"]

  spec.summary       = 'Bundix issue'

  spec.files         = []
  spec.bindir        = "exe"
  spec.executables   = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
  spec.require_paths = ["lib"]

  spec.add_development_dependency "bundler", "~> 1.16"
  spec.add_development_dependency "rake", "~> 10.0"
end

shell.nix:

{ pkgs ? import <nixpkgs> {}
}:
let
  ruby = pkgs.ruby_2_5;
in pkgs.mkShell {
  buildInputs = with pkgs; [ruby bundix];
}

When trying to build a gemset.nix file, I get the following error:

$ bundix --ruby=ruby_2_5
0jcabbgnjc788chx31sihc5pgbqnlc1c75wakmqlbjdm8jns2m9b => rake-10.5.0.gem
Traceback (most recent call last):
	30: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/bin/.bundix-wrapped:18:in `<main>'
	29: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/bin/.bundix-wrapped:18:in `load'
	28: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/bin/bundix:5:in `<top (required)>'
	27: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:22:in `run'
	26: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:36:in `run'
	25: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:158:in `save_gemset'
	24: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/commandline.rb:152:in `object2nix'
	23: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:20:in `serialize'
	22: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:83:in `serialize'
	21: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'
	20: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'
	19: from (erb):2:in `serialize'
	18: from (erb):2:in `each'
	17: from (erb):2:in `block in serialize'
	16: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub'
	15: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:83:in `serialize'
	14: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'
	13: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'
	12: from (erb):2:in `serialize'
	11: from (erb):2:in `each'
	10: from (erb):2:in `block in serialize'
	 9: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub'
	 8: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:85:in `serialize'
	 7: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `result'
	 6: from /nix/store/r7dapysmfxkw3lw7cjz7zzxzv7c9hy06-ruby-2.5.3/lib/ruby/2.5.0/erb.rb:876:in `eval'
	 5: from (erb):1:in `serialize'
	 4: from (erb):1:in `each_with_index'
	 3: from (erb):1:in `each'
	 2: from (erb):1:in `block in serialize'
	 1: from /nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:69:in `sub'
/nix/store/8z2ykap62kdcf19m2qsi5zapw01rf0gi-bundix-2.4.1/lib/ruby/gems/2.5.0/gems/bundix-2.4.1/lib/bundix/nixer.rb:100:in `serialize': Cannot convert to nix: nil (RuntimeError)

Environment

I'm on macOS Mojave v10.14.2, ruby 2.5.3p105, bundix 2.4.1.

irb doesn't work when using gemspec in the Gemfile.

With the following files in a directory

# Gemfile
source 'https://rubygems.org'

gemspec
# foo.gemspec
Gem::Specification.new do |spec|
    spec.name = 'foo'
    spec.version = '0.0.0'
    spec.authors = ["me"]
    spec.summary = "A gem."
end
# shell.nix
let
  pkgs = import <nixpkgs> { };
  environment = pkgs.bundlerEnv {
    name = "foo";

    inherit (pkgs) ruby;
    gemdir = ./.;
  };
in environment.env

running

$(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic

succeeds and produces

# .bundle/config 
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_CACHE_ALL: "true"
# Gemfile.lock 
PATH
  remote: .
  specs:
    foo (0.0.0)

GEM
  remote: https://rubygems.org/
  specs:

PLATFORMS
  ruby

DEPENDENCIES
  foo!

BUNDLED WITH
   2.1.4
# gemset.nix 
{
  foo = {
    groups = ["default"];
    platforms = [{
      engine = "maglev";
    } {
      engine = "maglev";
    } {
      engine = "maglev";
      version = "1.8";
    } {
      engine = "maglev";
      version = "1.8";
    } {
      engine = "maglev";
      version = "1.9";
    } {
      engine = "maglev";
      version = "1.9";
    } {
      engine = "maglev";
      version = "2.0";
    } {
      engine = "maglev";
      version = "2.0";
    } {
      engine = "maglev";
      version = "2.1";
    } {
      engine = "maglev";
      version = "2.1";
    } {
      engine = "maglev";
      version = "2.2";
    } {
      engine = "maglev";
      version = "2.2";
    } {
      engine = "maglev";
      version = "2.3";
    } {
      engine = "maglev";
      version = "2.3";
    } {
      engine = "maglev";
      version = "2.4";
    } {
      engine = "maglev";
      version = "2.4";
    } {
      engine = "maglev";
      version = "2.5";
    } {
      engine = "maglev";
      version = "2.5";
    } {
      engine = "maglev";
      version = "2.6";
    } {
      engine = "maglev";
      version = "2.6";
    } {
      engine = "rbx";
    } {
      engine = "rbx";
    } {
      engine = "rbx";
      version = "1.8";
    } {
      engine = "rbx";
      version = "1.9";
    } {
      engine = "rbx";
      version = "2.0";
    } {
      engine = "rbx";
      version = "2.1";
    } {
      engine = "rbx";
      version = "2.2";
    } {
      engine = "rbx";
      version = "2.3";
    } {
      engine = "rbx";
      version = "2.4";
    } {
      engine = "rbx";
      version = "2.5";
    } {
      engine = "rbx";
      version = "2.6";
    } {
      engine = "ruby";
    } {
      engine = "ruby";
    } {
      engine = "ruby";
    } {
      engine = "ruby";
      version = "1.8";
    } {
      engine = "ruby";
      version = "1.8";
    } {
      engine = "ruby";
      version = "1.9";
    } {
      engine = "ruby";
      version = "1.9";
    } {
      engine = "ruby";
      version = "2.0";
    } {
      engine = "ruby";
      version = "2.0";
    } {
      engine = "ruby";
      version = "2.1";
    } {
      engine = "ruby";
      version = "2.1";
    } {
      engine = "ruby";
      version = "2.2";
    } {
      engine = "ruby";
      version = "2.2";
    } {
      engine = "ruby";
      version = "2.3";
    } {
      engine = "ruby";
      version = "2.3";
    } {
      engine = "ruby";
      version = "2.4";
    } {
      engine = "ruby";
      version = "2.4";
    } {
      engine = "ruby";
      version = "2.5";
    } {
      engine = "ruby";
      version = "2.5";
    } {
      engine = "ruby";
      version = "2.6";
    } {
      engine = "ruby";
      version = "2.6";
    }];
    source = {
      path = ./.;
      type = "path";
    };
    version = "0.0.0";
  };
}

Finally running nix-shell --run irb gives the following error:

[!] There was an error parsing `Gemfile`: There are no gemspecs at /nix/store/lf2ccppcgbprijr89vkyxkg1sjx8cr59-gemfile-and-lockfile. Bundler cannot continue.

 #  from /nix/store/lf2ccppcgbprijr89vkyxkg1sjx8cr59-gemfile-and-lockfile/Gemfile:3
 #  -------------------------------------------
 #  
 >  gemspec
 #  -------------------------------------------

If instead the files are

# Gemfile
source 'https://rubygems.org'
# shell.nix
let
  pkgs = import <nixpkgs> { };
  environment = pkgs.bundlerEnv {
    name = "foo";

    inherit (pkgs) ruby;
    gemdir = ./.;
  };
in environment.env

then

$(nix-build '<nixpkgs>' -A bundix --no-out-link)/bin/bundix --magic

produces

# .bundle/config 
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_CACHE_ALL: "true"
# Gemfile.lock 
GEM
  remote: https://rubygems.org/
  specs:

PLATFORMS
  ruby

DEPENDENCIES

BUNDLED WITH
   2.1.4
# gemset.nix    
{
}

and nix-shell --run irb works correctly.

Hopefully it goes without saying that the same behaviour occurs when I do use some actual dependencies!

Attribute 'source' missing

Running nix-shell fails with the following error:

error: attribute 'source' missing, at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/functions.nix:72:14

--show-trace results in:

error: while evaluating the attribute 'buildInputs' of the derivation 'your-package' at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating the attribute 'passAsFile' of the derivation 'your-package' at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating anonymous function at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/default.nix:48:56, called from undefined position:
while evaluating 'buildGem' at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/default.nix:86:20, called from /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/default.nix:48:63:
while evaluating the attribute 'type' at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/functions.nix:72:27:
attribute 'source' missing, at /nix/store/nih7n7rhyrzj7mmkmj8my4caik5adar9-nixos-18.09.2375.680f9d7ea90/nixos/pkgs/development/ruby-modules/bundled-common/functions.nix:72:14

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

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 ๐Ÿคท

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

Using local gems

Hello,

I'm trying to package openproject for nix, but am relatively new to both nix packaging and the ruby ecosystem. The Gemfile for op contains a couple of gems that are part of the git repository itself. Bundix generates a gemset.nix with e.g. the following gem:

  budgets = {
    groups = ["opf_plugins"];
    platforms = [];
    source = {
      path = modules/budgets;
      type = "path";
    };
    version = "1.0.0";
  };

This of course breaks when trying to get a bundlerEnv going, since the modules/budgets path is not available outside of the openproject repo.

My initial idea was to download the sources, apply the gemset via a patch, and then use the source derivation as the gemdir. However, this breaks dramatically with nix-build running into a segfault.

Any ideas? My current derivation attempt is below.

{ lib, stdenv, fetchurl, bundlerEnv, ruby, makeWrapper }:
let
  version = "11.3.1";
  source = stdenv.mkDerivation rec {
    pname = "openproject-source-${version}";

    src = fetchurl {
      url = "https://github.com/opf/openproject/archive/refs/tags/v${version}.tar.gz";
      sha256 = "sha256-f4A4uiHGywQbTOSivUNsiuwlwDV1E7X6GASWRfZtSb8=";
    };

    patches = [ ./gemset.patch ];

    buildPhase = "";
    installPhase = ''
      mkdir -p $out/share/openproject
      cp -r . $out/share/openproject
    '';
  };

  rubyEnv = bundlerEnv {
    name = "openproject-env-${version}";

    inherit ruby;
    gemdir = "${source}" + ./share/openproject; # just `source` also does not work
    groups = [ "development" "production" "sentry" "ldap" "postgres" "test" ];
  };
in
stdenv.mkDerivation rec {
  pname = "openproject";
  inherit version;

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ rubyEnv rubyEnv.wrappedRuby rubyEnv.bundler ];

  buildPhase = ''
    #stuff
  '';

  installPhase = ''
    # stuff
    makeWrapper ${rubyEnv.wrappedRuby}/bin/ruby $out/bin/openproject
  '';
}

Doesn't work within `nix-store --realize`

For some time, my .envrcs for Ruby projects have looked something like:

bundix
use nix
watch Gemfile.lock

so that the process of updating my gems reverts to something like the basic Ruby case with bundle lock [--update gem]. This has been great for a long time.

Enter lorri - the downside to my bundle lock solution has been (in part) that the updates are kind of slow, and I get distracted. If lorri could let me keep working while gems update in the background that would be excellent.

However, what I find is a couple of shortcomings - mostly that bundix updates gemset.nix when it's run, which means that lorri constantly reconsiders the directory.

One way to approach this would be to put the bundix step into my shell.nix. This would not be a solution for shipping code, but for developing it would be very natural: building my development environment has the gemset.nix file as a dependency, so it makes sense as an expression in the shell.nix.

However, bundix in the buildPhase of a mkDerivation fails all kinds of ways, because it relies on the kinds of things that the Nix build environment purposely foils - writing to the home directory, to /nix/var, etc.

Would it be possible to have bundix take an --in-nix flag, or flags for it's various paths, or just recognize that it's being run with e.g. NIX_ENFORCE_PURITY=1 and do the right thing?

bundix fails on my huginn gemfile

it seems to get caught on the few non rubygem gems.

$ bundix
04kcr127l34p7221z13blyl0dvh0bmxwx326j72idayri36a394w => xpath-2.0.0.gem
15ls2yqjvflxrc8chv5pcdh2p1p9fjsky74yc8y7wvw90wz0izrb => xmpp4r-0.5.6.gem
1fzcfj22k6cr401yfcp1iz99mpgw1g52x1pzgs2fj9yx7cwaplb6 => wunderground-1.2.0.gem
07qnsafl6203a2zclxl20hy4jq11c471cgvd0bj5r9fx1qqw06br => websocket-extensions-0.1.2.gem
1m37q24mxykvixcj8sv0jz7y2a88spysxg5rp4zf4p1q7mbblshy => websocket-driver-0.6.4.gem
0j31ma08bvxxgrz5812i4zvp0xm35h788xn73xh875cil8ys83wh => webmock-1.17.4.gem
04gpmnvkp312wxmsvvbq834iyab58vjmh6w4x4qpgh4p1lzkiq1l => warden-1.2.6.gem
0k2nx4czdycds93vf16vipg17qc9qb3n7gjikkqhlxn9z24c80h2 => vcr-3.0.2.gem
0gr2mxg27l380wpiy66mgv9wq02myj6m4gmp6c4g1vsbzkh0213v => uuid-2.3.8.gem
0wfnaynym2xvj9l60z30r3xndxhiw2qpnclijpadsm81fvxjwki2 => unidecoder-1.1.2.gem
02xgk7gajnp8zqd2wvk1hbbwz7czlbpk29ahs9ph0jprsssnzzrv => unicorn-4.9.0.gem
04d13bp6lyg695x94whjwsmzc2ms72d94vx861nx1y40k3817yp8 => unf_ext-0.0.7.2.gem
0bh2cf73i2ffh4fcpdn9ir4mhq8zi50ik0zqa1braahzadx536a9 => unf-0.1.4.gem
0mzs64z3m1b98rh6ssxpqfz9sc87f6ml6906b0m57vydzfgrh1cz => uglifier-2.7.2.gem
1svrg7mpxzzyjpl1kpfvimlbnl1mz7a11fw84frnf0rdgzf5gdq1 => uber-0.0.15.gem
1c01p3kg6xvy1cgjnzdfq45fggbwish8krd0h864jvbpybyx7cgx => tzinfo-1.2.2.gem
1j4l2zwx821hzsfqskcq47xpk6b7yzl30mhzmdrfrsrhsigmayar => typhoeus-0.6.9.gem
0vx7x3fmwgk3axqyw9hyf6yh99kx3ssdy14w2686hz7c4v3qwlc5 => twitter-5.14.0.gem
1rrrcnarix5xpgjjm8rq9fmn5z7dzqdiqllrlm2r3lx269lxx0am => twilio-ruby-3.11.6.gem
1lg7j8xf8yxmnz1v8zkwhs4l6j30kq2pxvvrvpah2frlaqz077dh => treetop-1.6.5.gem
1l5g0c58iirincrlv3f4g7mn1ncvvd8h26gl3a73v4hgsl8v9hhn => tins-1.10.1.gem
07yvzmhl1mlmss6ygd31xpbasavfvnai7jqd38ljjz8g911jxg27 => tilt-2.0.4.gem
1hq46wqsyylx5afkp6jmcihdpv4ynzzq9ygb6z2pb1cbz5js0gcr => thread_safe-0.3.5.gem
08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z => thor-0.19.1.gem
0x93jrl0ac5r0pfqnbv228mikgqxcvdy3rgkl322k1cssr1yvhid => therubyracer-0.12.2.gem
0ydbbyjmk5p7fsi55ffnkq79jnfqx65c3nj8d9rpgl6sw85ahyys => term-ansicolor-1.3.2.gem
0gmkbakhfci5wnmbfx5i54f25j9zsvbw858yg3jjhfs5n4ad1xq1 => systemu-2.6.5.gem
1ysaid1yziqg5f79277fkz2aci9iig0vcq6p3x3i17y5jp82fcvk => sprockets-rails-3.0.4.gem
16fnlp4fqzrdxlbalbx3r0bir7dwyr1asg7s9lsmmczngl0x7fw7 => sprockets-3.6.0.gem
1hqr7jbi3al26babdykrjqznjy6fxfga2875sgxla42k8mswm9fk => spectrum-rails-1.6.2.gem
00w8g3j7k7kl8ri2cf1m58ckxk8rn350gp4chfscmgv6pq1spk3n => slop-3.6.0.gem
0v4kd0l83shmk17qb35lighxjq9j7g3slnkrsyiy36kaqcfrjm97 => slack-notifier-1.0.0.gem
0jv9pmpaxihrcsgcf6mgl3qg7rhf9scl5l2k67d768w9cz63xgvc => simplecov-html-0.9.0.gem
1a3wy9zlmfwl3f47cibnxyxrgfz16y6fmy0dj1vyidzyys4mvy12 => simplecov-0.9.2.gem
0dw9ii6m7wckml100xhjc6vxpjcry174lbi9jz5v7ibjr3i94y8l => simple_oauth-0.3.1.gem
0lsvvgswxav8vl7fsx7wwq22w2hrmfqrfw90apw5nll956pwq62p => simple-rss-1.3.1.gem
1ad44dqrhk7a32775zfphpqywkylip08ldqshahvdrwlx4pxvq3g => signet-0.7.2.gem
1cf6d2d9br82vylr9p362yk9cfrd14jz8v77n0yb0lbcxdbk7xzq => shoulda-matchers-3.1.1.gem
1ryyzrj1kxmnpdzhlv4ys3dnl2r5r3d2rs2jwzbnd1v96a8pl4hf => shellany-0.0.1.gem
0lgja3nr97bapx8m79d95wphw25di3igqcqmrrcrx6cij6z6mmsl => select2-rails-3.5.10.gem
1f6357vw944w2ayayqmz8ai9myl6xbnry06sx5b5ms4r9lny8hj8 => sass-rails-5.0.4.gem
0dkj6v26fkg1g0majqswwmhxva7cd6p3psrhdlx93qal72dssywy => sass-3.4.22.gem
1hly915584hyi9q9vgd968x2nsi5yag9jyf5kq60lwzi5scr7094 => safe_yaml-1.0.4.gem
08vcqq736h7h7fa0h6sqmvy9ngs2ky0fwlb4i28d9kd1rrwln93w => rufus-scheduler-3.0.9.gem
09jw4yvigp4rx7qy6ni9njvlm4wnyz4f6z6ngzac5qi3sshspzd0 => ruby-growl-4.1.gem
0mbdic5y0y4knjbib9dngyff72p1rblnirl7wphcpz5f3c7amff2 => rturk-2.12.1.gem
0l6zzlf22hn3pcwnxswsjsiwhqjg7a8mhvm680k5vq98307bkikr => rspec-support-3.4.1.gem
1y3jpj44sia9n8drfp3qkmkmjq0kfsbrh5cp4jr1c43b7940wfv6 => rspec-rails-3.4.2.gem
0sk8ijq5d6bwhvjq94gfm02fssxkm99bgpasqazsmmll5m1cn7vr => rspec-mocks-3.4.1.gem
1aaisx7q482c5pzzvbv2zcz2b8a2g3yj7i1j1wyyqwhrnvsxpz72 => rspec-html-matchers-0.7.3.gem
07pz570glwg87zpyagxxal0daa1jrnjkiksnn410s6846884fk8h => rspec-expectations-3.4.0.gem
1z2zmy3xaq00v20ykamqvnynzv2qrrnbixc6dn0jw1c5q9mqq9fp => rspec-core-3.4.4.gem
1z74ch9lwqc52d23cfg42zs0h419786a3b45gxbdai47h78h80mp => rspec-collection_matchers-1.1.2.gem
12axhz2nj2m0dy350lxym76m36m1hq48hc59mf00z9dajbpnj78s => rspec-3.4.0.gem
1x9ga0dl86hyc91j7rd890i0rw6gp4sv34x0rm3w3x4b32v1p5qj => rr-1.1.2.gem
1123kqmy3yk7k3vidvcwa46lknmhilv8axpaiag1wifa576hkqy1 => retriable-2.1.0.gem
1m8z0c4yf6w47iqz6j2p7x1ip4qnnzvhdph9d5fgx081cvjly3p7 => rest-client-1.8.0.gem
09y64v0k728y49wfiing57bi8q2vydk8q4yrr0i3bh0z5g7whii0 => responders-2.2.0.gem
1749dlb46da8h1yhqkkvwx8frgd5i20f9ix4min8wc6qlks8pp4k => representable-2.3.0.gem
04p4pq4sikly7pvn30dc7v5x2m7fqbfwijci4z1y6a1ilwxzrjii => ref-2.0.0.gem
1yfcp3065n08balljmxn0qzwhdbwwxn2h9z89wmydyfj2gq1p71d => rb-inotify-0.9.7.gem
1xlkflgxngwkd4nyybccgd1japrba4v3kwnp00alikj404clqx4v => rb-fsevent-0.9.7.gem
0jfmy7kd543ldi3d4fg35a1w7q6jikpnzxqj4bzchfbn94cbabqz => rake-11.1.2.gem
1rmnfvyijgq7a617wv7mvdij90mz083jh2931nvmlmw5i8kaxpal => raindrops-0.16.0.gem
0ipiffz26qawy44lv2d9b61cva76fvjs4py30c8382g4q35n9zyg => railties-4.2.5.2.gem
138fd86kv073zqfx0xifm646w6bgw2lr8snk16lknrrfrss8xnm7 => rails-html-sanitizer-1.0.3.gem
1v8jl6803mbqpxh4hn0szj081q1a3ap0nb8ni0qswi7z4la844v8 => rails-dom-testing-1.0.7.gem
0qxymchzdxww8bjsxj05kbf86hsmrjx40r41ksj0xsixr2gmhbbj => rails-deprecated_sanitizer-1.0.3.gem
0bpsxqi533j5dq0vpsczd4bq5y1p0bih8198b3p5wlwbxfww34xa => rails-4.2.5.2.gem
0h6x5jq24makgv2fq5qqgjlrk74dxfy62jif9blk43llw8ib2q7z => rack-test-0.6.3.gem
053cv8via3prgkmqq9s0z8dlf9k4dr3pa76xvgknp7qarlk5h7ap => rack-livereload-0.3.16.gem
09bs295yq6csjnkzj7ncj50i6chfxrhmzg1pk6p0vd2lb9ac8pj5 => rack-1.6.4.gem
0qsd4msqv3dzaamdpi4a8p0ky81kgdxjdyg6wi5zw62xicsmikap => quiet_assets-1.1.0.gem
0a2iinvabis2xmv0z7z7jmh7bbkkngxj2qixfdg5m6qj9x8k1kx6 => pry-rails-0.3.4.gem
0pvc94kgxd33p6iz41ghyadq8zfbjhkk07nvz2mbh3yhrc8w7gmw => pry-byebug-3.4.0.gem
1x78rvp69ws37kwig18a8hr79qn36vh8g1fn75p485y3b3yiqszg => pry-0.10.3.gem
055xkb9ax98gz2b03lpkz6i7iim5vgmiqyz4wcxdhyx4cj31qnnk => protected_attributes-1.0.9.gem
1bqnxwyip623d8pr29rg6m8r0hdg08fpr2yb74f46rn1wgsnxmjr => polyglot-0.3.5.gem
1fnkly1ks31nf5cdks9jd5c5vynbanrr8pwp801qq2i8bg78rwc0 => poltergeist-1.9.0.gem
07dv4ma9xd75xpsnnwwg1yrpwpji7ydy0q1d9dl0yfqbzpidrw32 => pg-0.18.4.gem
1llv8w3g2jwggdxr5a5cjkrnbbfnvai3vxacxxc0fy84xmz3hymz => os-0.9.6.gem
1fg9jpjlzf5y49qs9mlpdrgs5rpcyihq1s4k79nv9js0spjhnpda => orm_adapter-0.5.0.gem
1hqjpb1zx0pp3s12c83pkpk4kkx41f001jc5n8qz0h3wll0ld833 => omniauth-twitter-1.2.1.gem
10ncmfym4l6k6aqp402g7mqxahbggcj5xkpsjxgngs746s82y97w => omniauth-tumblr-1.2.gem
09jjwzh4iwsjia0lx6pw9pxqz14kr5dz510q9mqrj637f7lkkywq => omniauth-oauth2-1.1.2.gem
1n5vk4by7hkyc09d9blrw2argry5awpw4gbw1l4n2s9b3j4qz037 => omniauth-oauth-1.1.0.gem
0ywpwc187dwlh7270b15y2kl4pn3f3n2m9ycvphp3kkw19q3vdwv => omniauth-evernote-1.2.1.gem
1mjmgavkc539h2ih06i84qjdkhsnk23i744c9qs13q8cddxd0h1h => omniauth-dropbox-0.2.0.gem
0qs1w8j4l3864bm40d4g5igvnash0i2ldi16qsl95hyjd26k8f2c => omniauth-37signals-1.0.5.gem
0vsqxgzkcfi10b7k6vpv3shmlphbs8grc29hznwl9s0i16n8962p => omniauth-1.3.1.gem
1bqjsyd4nqvgybg39bw0xyqy6qb46mawfcdgmgrsq3j0mki1jdn7 => oauth2-0.9.4.gem
1awhy8ddhixch44y68lail3h1d214rnl3y1yzk0msq5g4z2l62ky => oauth-0.5.1.gem
16m6hx9n18pxnb4q4bgzhpy2m3m2v438k4bnb2wfvmbcrxys47hq => notiffany-0.1.0.gem
11sbmpy60ynak6s3794q32lc99hs448msjy8rkp84ay7mq7zqspv => nokogiri-1.6.7.2.gem
0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y => netrc-0.11.0.gem
1ailibfcbfs32378msnlf945p0wzrqdj9nxy19s93xgh00v4qy07 => net-ftp-list-3.2.9.gem
0r97jzknll9bhd8yyg2bngnnkj8rjhal667n7d32h8h7ny7nvpnr => nenv-0.3.0.gem
1wwjx35zgbc0nplp8a866iafk4zsrbhwwz4pav5gydr2wm26nksg => naught-1.1.0.gem
09k0b3cybqilk1gwrwwain95rdypixb2q9w65gd44gfzsd84xi1x => multipart-post-2.0.0.gem
0i8r7dsz4z79z3j023l8swan7qpbgxbwwz11g38y2vjqjk16v4q8 => multi_xml-0.5.5.gem
1wpc23ls6v2xbk3l1qncsbz16npvmw8p0b38l8czdzri18mp51xk => multi_json-1.12.1.gem
0hf23hv1aq9164nx5kirhw99zm3dkwgkg48l4kl1sb2zaqlzv8p1 => mqtt-0.3.1.gem
1gfzf7112vffcwamfny06pz4wr16xdihz666m1s47v077560nrll => minitest-5.9.0.gem
056drbn5m4khdxly1asmiik14nyllswr6sh3wallvsywwdiryz8l => mini_portile2-2.0.0.gem
1a59k5l29vj060yscaqk370rg5vyr132kbw6x3zar7khzjqjqd8p => mini_magick-4.5.1.gem
0yd3s2vr8i3xjk349dl317xc56w2mrjjczzii0lc5k20j30q3fcg => mimemagic-0.3.1.gem
0lwxaah0kafigggdpp1hgswffsdsyy7y9cwhsfaw5irqx21823ip => mime-types-2.99.1.gem
1g5i4w0dmlhzd18dijlqw5gk27bv6dj2kziqzrzb7mpgxgsd1sf2 => method_source-0.8.2.gem
0v42bvghsvfpzybfazl14qhkrjvx0xlmxz0wwqc960ga1wld5x5c => memoizable-0.4.2.gem
03d3h6kp16bf0crqg1cxdgp1d2iyzn53d3phbmjh4pjybqls0gcm => memoist-0.14.0.gem
0c9vqfy0na9b5096i5i4qvrvhwamjnmajhgqi3kdsdfl8l6agmkp => mail-2.6.4.gem
1clii8mvhmh5lmnm95ljnjygyiyhdpja85c5vy487rhxn52scn0b => macaddr-1.7.1.gem
0ily8j83q959w19zb7qm6m7y53sdj9afxj4x6mn2adl4i7vpdsv4 => lumberjack-1.0.10.gem
109ps521p0sr3kgc460d58b4pr1z4mqggan2jbsf0aajy9s6xis8 => loofah-2.0.3.gem
1agk0dv5lxn0qpnxadi6dvg36pc0x5fsrmzhw4sc91x52mjc381l => logging-2.1.0.gem
1frilv82dyxnlg8k1jhrvyd73l6k17mxc5vwxx080r4x1p04gwym => little-plugger-1.1.4.gem
1l0y7hbyfiwpvk172r28hsdqsifq1ls39hsfmzi1vy4ll0smd14i => listen-3.0.8.gem
033png37ym4jrjz5bi7zb4ic4yxacwvnllm1xxmrnr4swgyyygc2 => liquid-3.0.6.gem
1j5x22v7rqdk1047k0sz4k1xhf6hkdw6h1nl7xsw694hfjdb0vyx => libv8-3.16.14.15.gem
050x5cwqbxj2cydd2pzy9vfhmpgn1w6lfbwjaax1m1vpkn3xg9bv => letter_opener_web-1.3.0.gem
1pcrdbxvp2x5six8fqn8gf09bn9rd3jga76ds205yph5m8fsda21 => letter_opener-1.4.1.gem
190lfbiy1vwxhbgn4nl4dcbzxvm049jwc158r2x7kq3g5khjrxa2 => launchy-2.4.3.gem
18lhsc922b6arzkf5vxqdzyp8xq18p08g8d63j4807305bc50njv => kramdown-1.3.3.gem
1y6wl3vpp82rdv5g340zjgkmy6fny61wib7xylyg0d09k5f26118 => kgio-2.10.0.gem
14vx3kgssl4lv2kn6grr5v2whsynx5rbl1j9aqiq8nc3d7j74l67 => kaminari-0.16.3.gem
0s5llb4mhpy0phzbrc4jd2jd2b91h1axy4bhci7g1bdz1w2m3a2i => jwt-1.5.4.gem
1gwhrd7xlysq537yy8ma69jc83lblwiccajl5zvyqpnwyjjc93df => jsonpath-0.5.8.gem
025aykr360x6dr1jmg8pmsrx7gr30pws4p1q686vnb48zyw1sc94 => json_pure-1.8.3.gem
1nsby6ry8l9xg3yw4adlhk2pnc7i0h0rznvcss4vk3v74qg0k8lc => json-1.8.3.gem
0cmmsss2g2ip24wxavwj4dg6kg2x4dbq5izcxs4bqgdnp5xzc27r => jquery-rails-3.1.4.gem
0sdzgwxcs7wd212wfi3k2a8089m8l7v5ingnqc2mv81p3mi72wf4 => jmespath-1.2.4.gem
1i5z1ykl8zhszsxcs8mzl8d0dxgs3ylz8qlzrw74jb0gplkx6758 => i18n-0.7.0.gem
1rlqkgn2yfqn217a6gv8p25m3rplgdhn0295zn4wy2h7iy6vr78j => hypdf-1.0.13.gem
14pfjabdnrf19g39sj8skk754pg42dk9qydwblyfyhbiyhqcsi3g => hurley-0.2.gem
0jfn8mpcwwwbmn00dkgdfqhn0v4hzfvbajiik8qcmdqn5hyinh6a => httpclient-2.8.0.gem
0c9gvg6dqw2h3qyaxhrq1pzm6r69zfcmfh038wyhisqsd39g9hr2 => httparty-0.13.7.gem
15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi => http_parser.rb-0.6.0.gem
0cz2fdkngs3jc5w32a6xcl511hy03a7zdiy988jk1sf3bf5v3hdw => http-cookie-1.0.2.gem
0mg2mzg63gajk67ydijdkvc963d4yrjp5p0kcj77nxcrckpvc1m6 => http-0.6.4.gem
0v5wj3n9d6gk7427jfd876mbkhkwfnxzh46cf5bnxwpr7x0ga2sv => httmultiparty-0.3.16.gem
1jn8x9ch79gqmnzgyz78kppavjh5lqx0y0r6frykga2b86rz9s6z => hpricot-0.8.6.gem
076jphfai4xzl5znbb256d8aqijx82an4zappjv3gxg5h9gc5cxk => hipchat-1.2.0.gem
0qz7qbd2kcccr6sy2plz78gfxlif1przda2qn35skdbfwj62ibsw => haversine-0.3.0.gem
0gy6a98ng8ndbz3xh6afx586v4mhbyw2973lbq8iyfyc2rvcmivp => hashie-2.0.5.gem
1hyz1k7x2rck0qj1yfm05gxigw9y8z5j6a8akyfwk1a73rygmw21 => guard-rspec-4.6.5.gem
0yd74gdbbv2yz2caqwpsavzw8d5fd5y446wp8rdjw8wan0yd6k8j => guard-livereload-2.5.2.gem
1zj6sr1k8w59mmi27rsii0v8xyy2rnsi09nqvwpgj1q10yq1mlis => guard-compat-1.2.1.gem
0p3ndfmi6sdw55c7j19pyb2ymlby1vyxlp0k47366im1vi70b7gf => guard-2.13.0.gem
1nzkg63s161c6jsia92c1jfwpayzbpwn588smd286idn07y0az2m => googleauth-0.5.1.gem
0qx3mdmk7vp0h0jpk14rvybahd8ks83jsgl8adqp1gf01pzk781z => google-api-client-0.9.6.gem
145xrpsfx1qqjy33r6qa588wb16dvdhxzj2aysh755vhg6hgm291 => globalid-0.3.6.gem
19z2fa633k26rvcr6i6xs7sssvad8irkv6qpflh7np00p4zlkg1v => geokit-rails-2.0.1.gem
0f14qm7ax2xix2l10qhfy5hvknsl3zy79g3bjsciaj0dxgnqn74j => geokit-1.8.5.gem
1gc26phrwlmlqrmz4bagq1wd5b7g64avpx0ghxr9xdxcvmlii0l0 => formatador-0.2.5.gem
0yqyjix9jm4iwyc4f3wc32vxr28rpjcw1c9ni5brs4s2a24inzlk => foreman-0.63.0.gem
17mm6qlihgwy2gd3ndz1gy5v7191fk62zxswzhddvx87r9x3ijhv => forecast_io-2.0.0.gem
16jp4ab7ymnj1mvy5w6hfd8c5vjhljz0v7qkx31nh21j97my5dz5 => font-awesome-sass-4.3.2.1.gem
1m5mprppw0xcrv2mkim5zsk70v089ajzqiq5hpyb0xg96fcyzyxj => ffi-1.9.10.gem
0xwdmdagyd5bv80q5rrma2rjavhw2mxmj4q20vh77ni3psvl0gnm => feed-normalizer-1.5.2.gem
1kplqkpn2s2yl3lxdf6h7sfldqvkbkpxwwxhyk7mdhjplb5faqh6 => faraday-0.9.2.gem
1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1 => execjs-2.7.0.gem
06i0lbx3s9rhc10nbbq52vggxm6jvmpq9f8y6nk4an7fq1z5673n => evernote_oauth-0.2.3.gem
1jckldzalyv8k9rsaa4a0bydacin8dnj6snssgwnkxkq392ps5h5 => evernote-thrift-1.25.2.gem
17jr1caa3ggg696dd02g2zqzdjqj9x9q2nl7va82l36f7c5v6k4z => eventmachine-1.0.9.1.gem
074blimr19987sgyy4qi3c995n3h4vyd5i678xbk7zf98xmx45wf => ethon-0.9.0.gem
1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3 => erubis-2.7.0.gem
0rv5l4wfx8737arxaknh4lhlf5pvmlbps7dbjc4vr35j36sfpz9i => erector-0.10.0.gem
1kjmx3fygx8njxfrwcmn7clfhjhb6bvv3scy2lyyi0wqyi3brra4 => equalizer-0.0.11.gem
1bsw8vjz0z267j40nhbmrvfz7dvacq4p0pagvyp17jif6mj6v7n3 => em-websocket-0.5.1.gem
1wbbg48vnv4kgpdpxfmh3bjn2wv0g7gbpw5f7vccfbrrzvyq9fgg => em-socksify-0.3.1.gem
1xda8ggx1m8ncrjiwn7g1wiy0wci3cr1qahnyx1w5s442vdyp30l => em-http-request-1.1.3.gem
0d488f276bqdijhdbj42x758ps71sris44wzsv4fx3iw29j7afjh => dropbox-api-0.4.2.gem
1p6zz0xzb15vq8jphpw2fh6m4dianw7s76ci8vj9x3zxayrn4lfm => dotenv-2.1.1.gem
0g1175zspkqhlvl9s11g7p2nbmqpvpxxv02q8csd0ryc81laapys => domain_name-0.5.20160310.gem
0m8j31whq7bm5ljgmsrlfkiqvacrw6iz9wq10r3gwrv5785y8gjx => docile-1.1.5.gem
1vf9civd41bnqi6brr5d9jifdw73j9khc6fkhfl1f8r9cpkdvlx1 => diff-lcs-1.2.5.gem
1gf0xsywsiphrw5y4y3c3ckavv9pzvkqsqs5y906gfzwxnykls33 => devise-3.5.10.gem
0k39ix0a9rf4fd05ncml4h9r29dzwgzdbhp01gp67baid6adxwf4 => delorean-2.1.0.gem
1ifp0c58ff9jf6pnmnh8imbdyd21bmb22153nrizvig16jnbnadj => delayed_job-4.1.2.gem
109761g00dbrw5q0dfnbqg8blfm699z4jj70l4zrgf9mzn7ii50m => debug_inspector-0.0.2.gem
0fx6zmqznklmkbjl6f713jyl11d4g9q220rcl86m2jp82r8kfwjj => database_cleaner-1.5.3.gem
1j1m64pirsldhic6x6sg4lcrmp1bs1ihpd49xm8m1b2rc1c3irzy => daemons-1.1.9.gem
1rmzvjm9187xmsb44hchdrxmnl5qs1n879vc729gcrw6kpdqrrly => curl-0.0.9.gem
0abb0fvgw00akyik1zxnq7yv391va148151qxdghnzngv66bl62k => crack-0.4.3.gem
09crmnrp307vlqk4598jn7ygfrr1l4hp4n8435zjrh98v0f8idgm => coveralls-0.7.12.gem
0gqc8v4yijsmfwypz2rbmy21pzgfh6bs9y1qrfqqv98xk3mvi0zp => cookiejar-0.3.0.gem
1kb4sav7yli12pjr8lscv8z49g52a5xzpfg3z9h8clzw6z74qjsw => concurrent-ruby-1.0.2.gem
1k4fg39rrkl3bpgchfj94fbl9s4ysaz16w8dkqncf2vyf79l3qz0 => coffee-script-source-1.10.0.gem
0rc7scyk7mnpfxqv5yy4y5q1hx3i7q3ahplcp4bq2g5r24g2izl2 => coffee-script-2.4.1.gem
1mv1kaw3z4ry6cm51w8pfrbby40gqwxanrqyqr0nvs8j1bscc1gw => coffee-rails-4.1.1.gem
1x6z923iwr1hi04k6kz5a6llrixflz8h5sskl9mhaaxy9jx2x93r => coderay-1.1.1.gem
096f4rj7virwvqxhkavy0v55rax10r4jqf8cymbvn4n631948xc7 => cliver-0.3.2.gem
1hrdkn4g8x7dlzxwb1rfgr8kw3bp4ywg5l4y4i9c2g5cwv62yvvn => chronic-0.10.2.gem
1cq8rqnpxxf4k6f3rnlb1dc0ipfkqhmi0nmsyiw4mifnql0swx1p => capybara-select2-1.0.1.gem
04ymps3y9ka2n8p52l2xdv81dcvks5z8fg12fv2inw3fngphq09c => capybara-2.7.1.gem
144lag3llcc63syv99lf9a5i9gs8ls3ihz49lbxsv26h1qpr4wsb => byebug-9.0.4.gem
14fii7ab8qszrvsvhz6z2z3i4dw0h41a62fjr2h1j8m41vbrmyv2 => builder-3.2.2.gem
1rzsy1vy50v55x9z0nivf23y0r9jkmq6i130xa75pq9i8qrn1mxs => buftok-0.2.0.gem
17j28cs1z1lv31hv04dnhsscj526wz4mwr0b5vkwl6dbv57ynsxf => bootstrap-kaminari-views-0.0.5.gem
15jg6dkaq2nzcd602d7ppqbdxw3aji961942w93crs6qw4n6h9yk => binding_of_caller-0.7.2.gem
149fk5wyicl1jah233hjs3a5if3wysllj15j1yj0ap5slxhi98v5 => better_errors-1.1.0.gem
1d254sdhdj6mzak3fb5x3jam8b94pvl1srladvs53j05a89j5z50 => bcrypt-3.1.11.gem
1r3qwcafxichll928jrxwj0m7gfbnjr6vx7818yp3y41yaawjngb => aws-sdk-core-2.2.37.gem
1vwgsgyyq87iwjxi8bwh56fj3bzx7x2vjv1m6yih1fbhnbcyi2qd => awesome_print-1.6.1.gem
1a270mlajhrmpqbhxcqjqypnvgrq4pgixpv3w9gwp1wrrapnwrzk => arel-6.0.3.gem
0mpn7sbjl477h56gmxsjqb89r5s3w7vx5af994ssgc3iamvgzgvs => addressable-2.4.0.gem
0c9h921nrkqbyvxlrcq2vvs39k7aj7gw0lq7v72p4avyvxd39bc0 => activesupport-4.2.5.2.gem
1ym3paxp5lqr2kr4hkqj6xxqvgl57fv8jqhvgjfxb9lk7k5jlfmp => activerecord-nulldb-adapter-0.3.2.gem
1wik9i3mhbhhayxcynixppy5x4f4rbjdqmxlchj2qm5qqsjbdcf2 => activerecord-4.2.5.2.gem
0qirv5kp4qklm9j9ps5ni8mzggdj2kkiknfbkyp38sq8wdxrdkh9 => activemodel-4.2.5.2.gem
09ih70i8rlaqw0n75imafci3xyjhdq69jyd49h3fwb99any9pjyf => activejob-4.2.5.2.gem
0dfns8bl3br35ir5pf9jnbmpiq70zah5da0m781fq8n8dk7h3kp8 => actionview-4.2.5.2.gem
1kqjv8ipnnk3b31argpdaxfinx99569nfs57r4rp8w3by0c1hbm2 => actionpack-4.2.5.2.gem
1dc4cj3ihhx0jzppwayzfnbbq31w8ivn6sfagjhsvj2q3qpmzvlc => actionmailer-4.2.5.2.gem
082n12rkd9j7d89030nhmi4fx1gqaf13knps6cknsyvwix7fryvv => ace-rails-ap-2.0.1.gem
Skipping omniauth-wunderlist: 784: unexpected token at '{
url = "git://github.com/wunderlist/omniauth-wunderlist.git";
rev = "d0910d0396107b9302aa1bc50e74bb140990ccb8";
sha256 = "14v64lzl2fxrfsvpz5amyisw7vqzhzr6bgpm4gxlm7g0y4qbdha0";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in load' ./rubygems/bin/bundix:23:in

'
Skipping tumblr_client: 784: unexpected token at '{
url = "git://github.com/tumblr/tumblr_client.git";
rev = "0c59b04e49f2a8c89860613b18cf4e8f978d8dc7";
sha256 = "0d6yiqi0vdqw228z3k6ag3yzk0j3znj56mr9gjjzd9lmlqw7dgz3";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in load' ./rubygems/bin/bundix:23:in'
Skipping faraday_middleware: 784: unexpected token at '{
url = "git://github.com/lostisland/faraday_middleware.git";
rev = "c5836ae55857272732b33eb0e0a98d60e995a376";
sha256 = "1fzfdz2hy90gd7kyxyz5dxyp4zmipr8gq4k43laqky561h3hir8m";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in load' ./rubygems/bin/bundix:23:in'
Skipping delayed_job_active_record: 784: unexpected token at '{
url = "git://github.com/collectiveidea/delayed_job_active_record.git";
rev = "36f434c4fd660e8f11ce932be117e9c71dde7212";
sha256 = "0k9ph3nkjvck6a602m8c3as6yiklzx52ziq3apfc8x2d5s8xlq6s";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in load' ./rubygems/bin/bundix:23:in'
Skipping weibo_2: 784: unexpected token at '{
url = "git://github.com/cantino/weibo_2.git";
rev = "00e57d29d8252126014b038cd738b02e05e4cfc5";
sha256 = "1v6b51r4499cfa7frivmhkbyh2pv19m8ylh95dgi9ygdiyccsp19";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in load' ./rubygems/bin/bundix:23:in'
Skipping twitter-stream: 784: unexpected token at '{
url = "git://github.com/cantino/twitter-stream.git";
rev = "f7e7edb0bae013bffabf3598e7147773d9fd370f";
sha256 = "0aclyja339kq2zm17rg82adl4frr751ax20ncxdrmw6pmrivvgda";
}
'
/nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:in parse' /nix/store/n5gqlhs1nmadxkbibv42wnxq3m7f404k-ruby-2.3.0-p0/lib/ruby/2.3.0/json/common.rb:156:inparse'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:78:in convert_git' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix/source.rb:8:inconvert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:46:in convert_spec' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:36:inblock in convert'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in reverse_each' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:inwith_object'
/home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/lib/bundix.rb:35:in convert' /home/mog/work_huginn/blob/huginn/rubygems/gems/bundix-2.0.9/bin/bundix:82:in<top (required)>'
./rubygems/bin/bundix:23:in `load'

bundix doesn't like architecture-specific gems

I am trying to bundix the sorbet typechecker.

Gemfile:

source 'https://rubygems.org'
gem 'sorbet'

default.nix (I use callPackage on this):

{ bundlerApp, lib }:

bundlerApp rec {
  pname = "sorbet";
  gemdir = ./.;
  exes = [ "sorbet" "sorbet-static" ];

  meta = with lib; {
    description = "Static type checker for ruby";
    homepage = "https://sorbet.org";
    license = licenses.asl20;
    maintainers = [ maintainers.endgame ];
    platforms = platforms.unix;
  };
}

Because of #70 , I am trying to generate gemset.nix using bundle update && bundix. Here is what happens:

First, bundler correctly downloads the gem that matches my arch (x86_64-linux):

$ bundle update
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using bundler 2.1.4
Fetching sorbet-static 0.5.5549 (x86_64-linux)
Installing sorbet-static 0.5.5549 (x86_64-linux)
Fetching sorbet 0.5.5549
Installing sorbet 0.5.5549
Bundle updated!
Post-install message from sorbet:

  Thanks for installing Sorbet! To use it in your project, first run:

    bundle exec srb init

  which will get your project ready to use with Sorbet.
  After that whenever you want to typecheck your code, run:

    bundle exec srb tc

  For more docs see: https://sorbet.org/docs/adopting

Then bundix downloads a Darwin gem when constructing gemset.nix?

$ bundix
[4.7 MiB DL]
path is '/nix/store/8ycbkwk3v17azzml1836r9lhjdi6l03b-sorbet-static-0.5.5549-universal-darwin-14.gem'
1vli775jl3zkb39mqj26nwk2y8lzc7hv8h8cs4yilnf6fndzab4p => sorbet-static-0.5.5549-universal-darwin-14.gem
[0.0 MiB DL]
path is '/nix/store/spyfvfppa7z08595vqwsm6p0ya8x1aza-sorbet-0.5.5549.gem'
02c09sh99nk4hhf1k768lz7vq3l759h083n6v1cjkmqha1p8b0a1 => sorbet-0.5.5549.gem

Attempting to build this fails:

$ nix-build -E '(import <nixpkgs> {}).callPackage ./. {}'
these derivations will be built:
  /nix/store/xqpqakw2cpg7hsvm6mm5xib9xrlafkr8-sorbet-static-0.5.5549.gem.drv
  /nix/store/53iklkb8qsf1imbffbvpnwsg2nxpn8qd-ruby2.6.6-sorbet-static-0.5.5549.drv
  /nix/store/qmdhdjnrdhr55xr9gvqgsmdg3hvwzxkp-ruby2.6.6-sorbet-0.5.5549.drv
  /nix/store/gzkav0w1d4axhqwmy843y2f1ci81ja2s-sorbet-0.5.5549.drv
  /nix/store/265y5dnrcaykcajwm0z3s5829agb2pyf-sorbet-0.5.5549.drv
building '/nix/store/xqpqakw2cpg7hsvm6mm5xib9xrlafkr8-sorbet-static-0.5.5549.gem.drv'...

trying https://rubygems.org/gems/sorbet-static-0.5.5549.gem
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 403 Forbidden
error: cannot download sorbet-static-0.5.5549.gem from any mirror
builder for '/nix/store/xqpqakw2cpg7hsvm6mm5xib9xrlafkr8-sorbet-static-0.5.5549.gem.drv' failed with exit code 1
cannot build derivation '/nix/store/53iklkb8qsf1imbffbvpnwsg2nxpn8qd-ruby2.6.6-sorbet-static-0.5.5549.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gzkav0w1d4axhqwmy843y2f1ci81ja2s-sorbet-0.5.5549.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/265y5dnrcaykcajwm0z3s5829agb2pyf-sorbet-0.5.5549.drv': 1 dependencies couldn't be built
error: build of '/nix/store/265y5dnrcaykcajwm0z3s5829agb2pyf-sorbet-0.5.5549.drv' failed

Note that it's trying to download a gem file with no architecture. If you visit the gem page for sorbet-static, you'll see a download link that includes the arch. This seems to be getting lost somewhere. Not sure if that is a bundlerApp bug in nix code, or a problem with the generated gemset.nix. But I'm pretty sure that bundix looking at the Darwin gem when constructing gemset.nix is wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.