Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solargraph: Document the original bundle, not the bundlerApp's: #83804

Closed
wants to merge 1 commit into from

Conversation

burke
Copy link
Contributor

@burke burke commented Mar 30, 2020

bundlerApp creates a bundle, but when running solargraph as a
bundlerApp, you would ~always want to interact with the original bundle,
not the one containing solargraph and its dependencies.

Motivation for this change

My users want to run solargraph on ruby projects without adding it to their Gemfiles.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

bundlerApp creates a bundle, but when running solargraph as a
bundlerApp, you would ~always want to interact with the original bundle,
not the one containing solargraph and its dependencies.
@zimbatm
Copy link
Member

zimbatm commented Mar 31, 2020

Do you know if solargraph requires bundler explicitly, ie: require "bundler"?

One option that hasn't really been explored yet is that since we have all the gems, those could be composed together solely using GEM_PATH and skip bundler entirely at runtime. And if no gem is requiring gem directly, LOAD_PATH could also be used to compose the ruby libraries together.

@Mic92 Mic92 requested a review from manveru March 31, 2020 15:50
@burke
Copy link
Contributor Author

burke commented Mar 31, 2020

So, yes, it does explicitly require bundler, but only to use bits of it as a library; it doesn't explicitly run Bundle.setup or require bundler/setup.

I've considered this too for my own bundlerDevEnv tooling: having the two paths by which ruby code can be read (symlinked and canonical) can often confuse ruby into double-loading files, and on top of that, creating the big bag of symlinks is a little expensive for large gemsets. It seems like a slam-dunk for bundlerApp—if not categorically, at least as an option.

@burke
Copy link
Contributor Author

burke commented Mar 31, 2020

I've wondered, too, whether we could get away with providing a completely-fake shim implementation of bundler/setup that would just pass, because we previously put everything on the GEM_PATH.

If there's ever going to be an app that some strategy like this wouldn't work on, it's going to be Shopify's core platform. Maybe I'll give this a shot there when I get a chance.

@burke burke closed this Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants