nix-community / bundix

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

Fix fetching under Ruby 3.0 #80

Closed thefloweringash closed 1 year ago

thefloweringash commented 3 years ago

Ruby 2.7 deprecated using open for URIs, and recommends using URI.open instead.

warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

As of Ruby 3.0 the options argument is gone and bundix skips over http fetches.

Additional context: https://bugs.ruby-lang.org/issues/15893#note-2

Example error:

Downloading /Users/lorne/.cache/bundix/https_rubygems_org_gems_debase-ruby_core_source-0_10_12_gem from https://rubygems.org/gems/debase-ruby_core_source-0.10.12.gem
wrong number of arguments (given 4, expected 1..3)
Skipping debase-ruby_core_source: couldn't fetch hash for debase-ruby_core_source-0.10.12
jaen commented 3 years ago

FYI this is breaking for me with wrong number of arguments (given 4, expected 1..3), trying to figure out why – probably because my uri is actually a file and IO.open doesn't like the additional open_options. Not quite sure what the right fix is yet though.

jaen commented 3 years ago

Okay, it seems this fixes the issue for me, not sure how kosher that solution is though – https://github.com/jaen/bundix/commit/cd5a7931484292a69d0b7984f5d8b514a61c22da

jdelStrother commented 2 years ago

Ugh, I also fixed this before discovering this PR. https://github.com/jdelStrother/bundix/commit/093329b4d07c41418a453a9415658bc48eed5bb7

Any chance of at least one of these solutions getting merged?

marsam commented 1 year ago

Addressed by https://github.com/nix-community/bundix/commit/3d7820efdd77281234182a9b813c2895ef49ae1f

thefloweringash commented 1 year ago

Addressed by 3d7820e

Now that the changes from this pull request are effectively in master, I'm going to close it. If there are still issues with fetching files I recommend opening a separate issue or PR.