Git Product home page Git Product logo

Comments (4)

samueldr avatar samueldr commented on August 17, 2024

AFAICT It should already be including only the "default" group:

Though I'm unsure about whether that is working like I expect it or not:

  • rails-nix/gemset.nix

    Lines 165 to 175 in 4cf7917

    capybara = {
    dependencies = ["addressable" "matrix" "mini_mime" "nokogiri" "rack" "rack-test" "regexp_parser" "xpath"];
    groups = ["test"];
    platforms = [];
    source = {
    remotes = ["https://rubygems.org"];
    sha256 = "1dv75hs45456mi76h720gxk959gpg4f6091hmk42y0ln6kp2x7i0";
    type = "gem";
    };
    version = "3.36.0";
    };
[nix-shell:~/.../rails-nix]$ find $(nix-build -A app.gems) -iname '*capybara*'
/nix/store/0hnxrd1i0vkha5ccnbhxxnkqqcclvfph-rails-nix-gems/lib/ruby/gems/2.7.0/specifications/capybara-3.36.0.gemspec
/nix/store/0hnxrd1i0vkha5ccnbhxxnkqqcclvfph-rails-nix-gems/lib/ruby/gems/2.7.0/gems/capybara-3.36.0

from rails-nix.

samueldr avatar samueldr commented on August 17, 2024

Given that forcing groups = ["default"] to the bundlerEnv call removes capybara from the gems output, I figure it's not working as I understand it.

from rails-nix.

samueldr avatar samueldr commented on August 17, 2024

This is because the default groups isn't used here:

from rails-nix.

samueldr avatar samueldr commented on August 17, 2024

No PRs opened, as this might not be fixable on our end, and might require work on the Nixpkgs end to fix problems.

See how there's a reverted commit to "fix" the image build, it's not sufficient as when running the same underlying issue surfaces. (And anyway felt like a bad fix.)

The issue, AFAIUI is that if we only install some gem groups, bundle for bundle exec is not aware of it, and will get annoyed.

Could not find debug-1.4.0, web-console-4.2.0, capybara-3.36.0, selenium-webdriver-4.1.0, webdrivers-5.0.0 in any of the sources
Run `bundle install` to install missing gems.

This might be fixed if the store path holding the Gemfile{,.lock} files had a .bundle/config with the config equivalent to running bundle config set --local without test development. Though this doesn't "scale" as a solution, we can't know what groups to add to BUNDLE_WITHOUT.

Note that we could handle it locally, but it would require somehow wrapping anything running in that environment to be wrapped with the BUNDLE_WITHOUT environment variable, which would need to list the remainder of allGroups - [ "default" ]. The latter part is doable with gemset.nix, but wrapping all with BUNDLE_WITHOUT is not a reliable solution.

The only reliable solution would be to get bundler to see its .bundle/config for the given gemset, which requires some work within Nixpkgs.

from rails-nix.

Related Issues (20)

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.