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

Skip rbs gem validation #2084

Merged
merged 2 commits into from
Nov 15, 2024
Merged

Skip rbs gem validation #2084

merged 2 commits into from
Nov 15, 2024

Conversation

soutaro
Copy link
Member

@soutaro soutaro commented Nov 15, 2024

I'm not sure the reason exactly, but rbs validate with rbs fails because Gem::Specification.find_by_name('rbs') doesn't work with gemspec source with extensions.

/Users/soutaro/Developer/rbs/lib/rbs/environment_loader.rb:133:in `block in each_dir': Cannot find type definitions for library: rbs ([nil]) (RBS::EnvironmentLoader::UnknownLibraryError)

We can reproduce the problem with irb.

$ bundle exec irb
Ignoring rbs-3.7.0.dev.0 because its extensions are not built. Try: gem pristine rbs --version 3.7.0.dev.0
irb(main):001> Gem::Specification.find_by_name("rbs")
/Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/3.3.0/rubygems/dependency.rb:303:in `to_specs': Could not find 'rbs' (>= 0) - did find: [rbs-3.7.0.dev.0] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=/Users/soutaro/.local/share/gem/ruby/3.3.0:/Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0' , execute `gem env` for more information
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/3.3.0/rubygems/dependency.rb:313:in `to_spec'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/3.3.0/rubygems/specification.rb:962:in `find_by_name'
	from (irb):1:in `<main>'
	from <internal:kernel>:187:in `loop'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/irb-1.13.1/exe/irb:9:in `<top (required)>'
	from /Users/soutaro/.rbenv/versions/3.3.6/bin/irb:25:in `load'
	from /Users/soutaro/.rbenv/versions/3.3.6/bin/irb:25:in `<top (required)>'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `load'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/cli/exec.rb:23:in `run'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:455:in `exec'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/cli.rb:35:in `dispatch'
	from /Users/soutaro/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/bundler-2.5.16/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	... 6 levels...

I think it's a bug of rubygems (or bundler)...

@soutaro soutaro added this to the RBS 3.7 milestone Nov 15, 2024
@soutaro soutaro force-pushed the skip-rbs-validation branch from 42f0a09 to f6213c2 Compare November 15, 2024 05:43
@soutaro soutaro added this pull request to the merge queue Nov 15, 2024
Merged via the queue into master with commit 4885cf4 Nov 15, 2024
18 checks passed
@soutaro soutaro deleted the skip-rbs-validation branch November 15, 2024 05:57
@soutaro soutaro added the Released PRs already included in the released version label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

1 participant