inscapist / ruby-nix

Generates reproducible ruby/bundler app environment with Nix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error trying to start shell "error: value is null while a set was expected"

pfgray opened this issue · comments

Hello!

Thank you for this project! I'm trying to build my app with it, but I'm running into an issue, and not sure how to fix it.

I've run:

nix flake init -t github:sagittaros/ruby-nix/main
nix develop
> bundix # which generated gemset.nix
> exit
git add gemset.nix
nix develop

And that's when I get:

error: value is null while a set was expected

Running it with trace shows:

error: value is null while a set was expected

       … while evaluating the attribute 'name'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/development/ruby-modules/gem/default.nix:103:3:

          102|   #name = builtins.trace (attrs.name or "no attr.name" ) "${namePrefix}${gemName}-${version}";
          103|   name = attrs.name or "${namePrefix}${gemName}-${version}";
             |   ^
          104|

       … while evaluating anonymous lambda

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/lib/strings.nix:1094:3:

         1093|   in
         1094|   string:
             |   ^
         1095|   # First detect the common case of already valid strings, to speed those up

       … from call site

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:321:9:

          320|         in
          321|         lib.strings.sanitizeDerivationName (
             |         ^
          322|           if attrs ? name

       … while evaluating the derivation attribute 'name'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'gemPath' of the derivation 'ruby3.2.2-activesupport-7.0.4'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'gemPath' of the derivation 'ruby3.2.2-actionview-7.0.4'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'passAsFile'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating the attribute 'passAsFile' of the derivation 'my-rails-app-ruby-env'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'passAsFile'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/build-support/buildenv/default.nix:77:5:

           76|     # XXX: The size is somewhat arbitrary
           77|     passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
             |     ^
           78|   }

       … while evaluating the attribute 'passAsFile' of the derivation 'my-rails-app'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

       … while evaluating the attribute 'buildInputs' of the derivation 'nix-shell'

       at /nix/store/bkvc2q8pdbn09jb9x7ihs1vvbl6nf6rw-source/pkgs/stdenv/generic/make-derivation.nix:303:7:

          302|     // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          303|       name =
             |       ^
          304|         let

Following the trace, it seems to be some kind of issue generating the derivation for activesupport? But I'm not sure 🤔 .

Here's my gemset.nix, and nothing looks out of the ordinary:

{
  actionview = {
    dependencies = ["activesupport" "builder" "erubi" "rails-dom-testing" "rails-html-sanitizer"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "06zxdzxgrb0a9p61p41nz5jlrq01cspd6kq621i9hk1h96sj5rj5";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "7.0.4";
  };
  activesupport = {
    dependencies = ["concurrent-ruby" "i18n" "minitest" "tzinfo"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "183az13i4fsm28d0l5xhbjpmcj3l1lxzcxlx8pi8zrbd933jwqd0";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "7.0.4";
  };
  ast = {
    source = null;
    targets = [];
  };
  builder = {
    source = null;
    targets = [];
  };
  byebug = {
    source = null;
    targets = [];
  };
  cli-ui = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1aghiy4qrh6y6q421lcpal81c98zypj8jki4wymqnc8vjvqsyiv4";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.5.1";
  };
  coderay = {
    source = null;
    targets = [];
  };
  concurrent-ruby = {
    source = null;
    targets = [];
  };
  crass = {
    source = null;
    targets = [];
  };
  diff-lcs = {
    source = null;
    targets = [];
  };
  erubi = {
    source = null;
    targets = [];
  };
  ffi = {
    source = null;
    targets = [];
  };
  gem-release = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "108rrfaiayi14zrqbb6z0cbwcxh8n15am5ry2a86v7c8c3niysq9";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.2.2";
  };
  i18n = {
    dependencies = ["concurrent-ruby"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1vdcchz7jli1p0gnc669a7bj3q1fv09y9ppf0y3k0vb1jwdwrqwi";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.12.0";
  };
  inst = {
    dependencies = ["actionview" "activesupport" "cli-ui" "thor" "zeitwerk"];
    groups = ["default"];
    platforms = [];
    source = {
      path = ".";
      type = "path";
    };
    targets = [];
    version = "0.4.0";
  };
  json = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0nalhin1gda4v8ybk6lq8f407cgfrj6qzn234yra4ipkmlbfmal6";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.6.3";
  };
  listen = {
    dependencies = ["rb-fsevent" "rb-inotify"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "13rgkfar8pp31z1aamxf5y7cfq88wv6rxxcwy7cmm177qq508ycn";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.8.0";
  };
  loofah = {
    dependencies = ["crass" "nokogiri"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1fpyk1965py77al7iadkn5dibwgvybknkr7r8bii2dj73wvr29rh";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.19.0";
  };
  method_source = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1pviwzvdqd90gn6y7illcdd9adapw8fczml933p5vl739dkvl3lq";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.9.2";
  };
  minitest = {
    source = null;
    targets = [];
  };
  minitest-documentation = {
    dependencies = ["minitest"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "11zb2di8mw22zvdnq9p6lj9icig3dxz89dkfkcyb7yhijxr56p8n";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.0.0";
  };
  nokogiri = {
    dependencies = ["racc"];
    groups = ["default"];
    platforms = [];
    source = null;
    targets = [{
      remotes = ["https://rubygems.org"];
      sha256 = "0mj9fs2z93lvv2cz2z46hiczny86ifgjhh8m5lmwf0ifgd5vnvp7";
      target = "arm64-darwin";
      targetCPU = "arm64";
      targetOS = "darwin";
      type = "gem";
    } {
      remotes = ["https://rubygems.org"];
      sha256 = "15fpz7azgcq1zpd679fgx1njq220zxlcfjz91wfgjgw08qb0x0q1";
      target = "x86_64-darwin";
      targetCPU = "x86_64";
      targetOS = "darwin";
      type = "gem";
    }];
    version = "1.13.9";
  };
  parallel = {
    source = null;
    targets = [];
  };
  parser = {
    dependencies = ["ast"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "17qfhjvnr9q2gp1gfdl6kndy2mb6qdwsls3vnjhb1h8ddimdm4s5";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.1.3.0";
  };
  pry = {
    dependencies = ["coderay" "method_source"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1mh312k3y94sj0pi160wpia0ps8f4kmzvm505i6bvwynfdh7v30g";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.11.3";
  };
  pry-byebug = {
    dependencies = ["byebug" "pry"];
    source = null;
    targets = [];
  };
  pry-doc = {
    dependencies = ["pry" "yard"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1pp43n69p6bjvc640wgcz295w1q2v9awcqgbwcqn082dbvq5xvnx";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.4.0";
  };
  pry-reload = {
    dependencies = ["listen"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1gld1454sd5xp2v4vihrhcjh4sgkx7m1kc29qx1nr96r4z2gm471";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.3";
  };
  pry-state = {
    dependencies = ["pry"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "12n5zk3bvwwqvmzc20l9n1pdxhkw9l3ayaqrhqlmnwhycv032nsi";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.1.10";
  };
  racc = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0p685i23lr8pl7l09g9l2mcj615fr7g33w3mkcr472lcg34nq8n8";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.6.1";
  };
  rails-dom-testing = {
    dependencies = ["activesupport" "nokogiri"];
    source = null;
    targets = [];
  };
  rails-html-sanitizer = {
    dependencies = ["loofah"];
    source = null;
    targets = [];
  };
  rainbow = {
    source = null;
    targets = [];
  };
  rake = {
    source = null;
    targets = [];
  };
  rb-fsevent = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1zmf31rnpm8553lqwibvv3kkx0v7majm1f341xbxc0bk5sbhp423";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.11.2";
  };
  rb-inotify = {
    dependencies = ["ffi"];
    source = null;
    targets = [];
  };
  regexp_parser = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0rj7xcg7bkfw6y0h4wg8y3s4nmks9qrzdxag4zaw41xjqfanlysf";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.6.1";
  };
  rexml = {
    source = null;
    targets = [];
  };
  rspec = {
    dependencies = ["rspec-core" "rspec-expectations" "rspec-mocks"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "171rc90vcgjl8p1bdrqa92ymrj8a87qf6w20x05xq29mljcigi6c";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.12.0";
  };
  rspec-core = {
    dependencies = ["rspec-support"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1ibb81slc35q5yp276sixp3yrvj9q92wlmi1glbnwlk6g49z8rn4";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.12.0";
  };
  rspec-expectations = {
    dependencies = ["diff-lcs" "rspec-support"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0qldsmjhqr4344zdlamzggr3y98wdk2c4hihkhwx8imk800gkl8v";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.12.0";
  };
  rspec-mocks = {
    dependencies = ["diff-lcs" "rspec-support"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "1yvwnb0x5d6d4ff3wlgahk0wcw72ic51gd2snr1xxc5ify41kabv";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.12.0";
  };
  rspec-support = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "12y52zwwb3xr7h91dy9k3ndmyyhr3mjcayk0nnarnrzz8yr48kfx";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "3.12.0";
  };
  rubocop = {
    dependencies = ["json" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0ggxkq68ddxmynr2lyrvzr8qbrdvc2irxlx9ihxmvdpkg1vimr3w";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.39.0";
  };
  rubocop-ast = {
    dependencies = ["parser"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0sqkg84npyq9z4d3z46w59zyr1r1rbd1mrrlglws9ksw04wdq5x9";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "1.24.0";
  };
  ruby-progressbar = {
    source = null;
    targets = [];
  };
  thor = {
    source = null;
    targets = [];
  };
  tzinfo = {
    dependencies = ["concurrent-ruby"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0rx114mpqnw2k4h98vc0rs0x0bmf0img84yh8mkkjkal07cjydf5";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.0.5";
  };
  unicode-display_width = {
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0ra70s8prfacpqwj5v2mqn1rbfz6xds3n9nsr9cwzs3z2c0wm5j7";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "2.3.0";
  };
  webrick = {
    source = null;
    targets = [];
  };
  yard = {
    dependencies = ["webrick"];
    groups = ["default"];
    platforms = [];
    source = {
      remotes = ["https://rubygems.org"];
      sha256 = "0p1if8g9ww6hlpfkphqv3y1z0rbqnnrvb38c5qhnala0f8qpw6yk";
      target = "ruby";
      type = "gem";
    };
    targets = [];
    version = "0.9.28";
  };
  zeitwerk = {
    source = null;
    targets = [];
  };
}

Sorry for the wall of text, and thanks in advance!

commented

Thanks for reporting this issue. It seems that there is an issue with bundix, which is why you are getting source = null; and targets = [];. Let me investigate and report back.

commented

@pfgray could you delete your gemset.nix and regenerate it with nix run github:sagittaros/bundix/ee07328?

Let me know if it works for you!

Yes, that worked! Thanks a bunch!