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

Vendor uri in RubyGems #7386

Merged
merged 6 commits into from Jan 25, 2024
Merged

Vendor uri in RubyGems #7386

merged 6 commits into from Jan 25, 2024

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Jan 15, 2024

What was the end-user or developer problem that led to this PR?

RubyGems loads URI internally. This can cause gem activation conflicts in Bundler when an app is locked to old URI, but RubyGems internally loads a different default version.

What is your fix for the problem, implemented in this PR?

Vendor URI in RubyGems.

Fixes #7178 (comment).

Make sure the following tasks are checked

@deivid-rodriguez
Copy link
Member Author

deivid-rodriguez commented Jan 25, 2024

Added one test, should be ready now!

@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review January 25, 2024 15:56
@deivid-rodriguez
Copy link
Member Author

Technically this has changes in both RubyGems and Bundler. However, the more meaningful change is to start vendoring URI in RubyGems. So I'll put this in the changelog of RubyGems and silently sneak in Bundler changes with the corresponding Bundler release.

Copy link
Member

@simi simi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@deivid-rodriguez deivid-rodriguez merged commit 391e680 into master Jan 25, 2024
82 checks passed
@deivid-rodriguez deivid-rodriguez deleted the vendor-uri branch January 25, 2024 17:54
yahonda added a commit to yahonda/rails that referenced this pull request Jan 30, 2024
…t ToQueryTest::URI`

This commit addresses CI failure
at https://buildkite.com/rails/rails-nightly/builds/108#018d57ac-4f2a-45f1-86b9-9015a7b0a463/1165-2002

* Error addressed by this commit
```
$ ruby -v
ruby 3.4.0dev (2024-01-30T10:19:23Z master 86547fd69d) [x86_64-linux]
$ rm Gemfile.lock
$ bundle install
$ cd activesupport
$ bin/test test/core_ext/object/to_query_test.rb -n test_hash_not_sorted_lexicographically_for_nested_structure
... snip ...

E

Error:
ToQueryTest#test_hash_not_sorted_lexicographically_for_nested_structure:
NameError: uninitialized constant ToQueryTest::URI
    test/core_ext/object/to_query_test.rb:90:in `test_hash_not_sorted_lexicographically_for_nested_structure'

bin/test test/core_ext/object/to_query_test.rb:79

Finished in 0.000385s, 2597.3082 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
$
```

This behavior has been introduced since Ruby 3.4.0dev vendors URI from top level to `Gem::URI`
via ruby/ruby@d64d0b5 .
Here is the RubyGems one.
rubygems/rubygems#7386
deivid-rodriguez added a commit that referenced this pull request Feb 5, 2024
Vendor uri in RubyGems

(cherry picked from commit 391e680)
viralpraxis pushed a commit to viralpraxis/rails that referenced this pull request Mar 24, 2024
…t ToQueryTest::URI`

This commit addresses CI failure
at https://buildkite.com/rails/rails-nightly/builds/108#018d57ac-4f2a-45f1-86b9-9015a7b0a463/1165-2002

* Error addressed by this commit
```
$ ruby -v
ruby 3.4.0dev (2024-01-30T10:19:23Z master 86547fd69d) [x86_64-linux]
$ rm Gemfile.lock
$ bundle install
$ cd activesupport
$ bin/test test/core_ext/object/to_query_test.rb -n test_hash_not_sorted_lexicographically_for_nested_structure
... snip ...

E

Error:
ToQueryTest#test_hash_not_sorted_lexicographically_for_nested_structure:
NameError: uninitialized constant ToQueryTest::URI
    test/core_ext/object/to_query_test.rb:90:in `test_hash_not_sorted_lexicographically_for_nested_structure'

bin/test test/core_ext/object/to_query_test.rb:79

Finished in 0.000385s, 2597.3082 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
$
```

This behavior has been introduced since Ruby 3.4.0dev vendors URI from top level to `Gem::URI`
via ruby/ruby@d64d0b5 .
Here is the RubyGems one.
rubygems/rubygems#7386
mackuba added a commit to mackuba/minisky that referenced this pull request Mar 31, 2024
Apparently uri specifically is problematic because rubygems loads it before we get to bundler? (older version at least)

rubygems/rubygems#7386
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.

Bundler should give a better error when the Gemfile itself activates a conflicting gem
2 participants