Skip to content

Vendor uri in RubyGems - #7386

Merged
deivid-rodriguez merged 6 commits into
masterfrom
vendor-uri
Jan 25, 2024
Merged

Vendor uri in RubyGems#7386
deivid-rodriguez merged 6 commits into
masterfrom
vendor-uri

Conversation

@deivid-rodriguez

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

Copy link
Copy Markdown
Contributor

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
deivid-rodriguez force-pushed the vendor-uri branch 5 times, most recently from fe77307 to 6d29805 Compare January 15, 2024 20:09
@deivid-rodriguez

deivid-rodriguez commented Jan 25, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor 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.

@simi simi left a comment

Copy link
Copy Markdown

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
@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.
ruby/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.
ruby/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)

ruby/rubygems#7386
fractaledmind pushed a commit to fractaledmind/rails that referenced this pull request May 13, 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.
ruby/rubygems#7386
yoones pushed a commit to yoones/rails that referenced this pull request Mar 6, 2025
…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.
ruby/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