Commit graph

11330 commits

Author SHA1 Message Date
David Rodríguez
a47c54131d [rubygems/rubygems] Remove ensure part in require
I've seen this error sometimes but never found it helpful, since the
culprit has never been thread/monitor related, so it just adds noise.

Right now I'm seeing an issue in CI where we seem to be crashing during
ensure and showing a weird backtrace:

```
#<Thread:0x000055821d7a73b8 /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:167 run> terminated with exception (report_on_exception is true):
/home/runner/work/rubygems/rubygems/lib/rubygems/platform.rb:141:in `==': undefined local variable or method `to_a' for false:FalseClass (NameError)
Did you mean?  to_s
	from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `!='
	from /home/runner/work/rubygems/rubygems/lib/rubygems/core_ext/kernel_require.rb:168:in `require'
	from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:441:in `block in ensure_subdirectories'
	from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `each'
	from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:437:in `ensure_subdirectories'
	from /home/runner/work/rubygems/rubygems/lib/rubygems.rb:413:in `ensure_gem_subdirectories'
	from /home/runner/work/rubygems/rubygems/lib/rubygems/resolver/specification.rb:110:in `download'
	from /home/runner/work/rubygems/rubygems/lib/rubygems/request_set.rb:173:in `block (2 levels) in install'
```

Let's get this out of the picture in case that helps clarify the
culprit.

87ce40b70e
2023-03-17 18:50:55 +09:00
David Rodríguez
dd0f0a5e6e [rubygems/rubygems] Fix gem uninstall with --install-dir
ac23687353
2023-03-17 18:50:55 +09:00
David Rodríguez
8371c0eac4 [rubygems/rubygems] Fix incorrect error message when multiple platforms are locked
24d2bf9cb2
2023-03-17 18:50:55 +09:00
Mau Magnaguagno
364364c3bd [rubygems/rubygems] Improve TarHeader#calculate_checksum
String#unpack("C*") is equivalent to String#bytes and Array#inject {|a,b| a + b } is equivalent to Array#sum.
This is a minor enhancement in terms of speed and readability.
2023-03-16 12:55:01 +00:00
Hiroshi SHIBATA
f3b129241c [rubygems/rubygems] Applied Layout/SpaceAroundOperators cop
3139587be9
2023-03-16 01:59:12 +00:00
Hiroshi SHIBATA
760b8b7d24 [rubygems/rubygems] Change enforce style with Layout/CaseIndentation on rubygems
d4938259c4
2023-03-16 01:59:11 +00:00
Hiroshi SHIBATA
b528ecc164 [rubygems/rubygems] OpenSSL::Digest is always provided after Ruby 2.4
4f2f2ad412
2023-03-15 11:21:21 +00:00
Hiroshi SHIBATA
04a2550928 [rubygems/rubygems] Don't use full_required_path and extension_dir under the bundler
72169288ff
2023-03-15 03:35:55 +00:00
Hiroshi SHIBATA
31137dc67f [rubygems/rubygems] Removed test for
https://github.com/rubygems/rubygems/pull/6444, I have no idea to
migrate this test to bundler example
yet

0d869019bf
2023-03-15 03:35:54 +00:00
Hiroshi SHIBATA
55a0fbfaf8 [rubygems/rubygems] Move build artifact detection logic for root gemspec to bundler from Gem::Specification.
Gem::Specification#missing_extension? is heavily called from RubyGems.
  We should reduce extra method call from this place.

e24e59d44d
2023-03-15 03:35:54 +00:00
Takashi Kokubun
d8344559b2 RJIT: Simplify how Capstone is used in tests 2023-03-13 20:42:19 -07:00
Yusuke Endoh
56dbf83a85 Prevent a warning: assigned but unused variable
... which made a test fail

20230313T213003Z.fail.html.gz

```
  1) Failure:
TestRubyOptions#test_enable [/home/chkbuild/chkbuild/tmp/build/20230313T213003Z/ruby/test/ruby/test_rubyoptions.rb:176]:
pid 1208 exit 0
| /home/chkbuild/chkbuild/tmp/build/20230313T213003Z/ruby/lib/ruby_vm/rjit/insn_compiler.rb:1257: warning: assigned but unused variable - argc
| /home/chkbuild/chkbuild/tmp/build/20230313T213003Z/ruby/lib/ruby_vm/rjit/insn_compiler.rb:1258: warning: assigned but unused variable - flags
.

1. [2/2] Assertion for "stderr"
   | <[]> expected but was
   | <["/home/chkbuild/chkbuild/tmp/build/20230313T213003Z/ruby/lib/ruby_vm/rjit/insn_compiler.rb:1257: warning: assigned but unused variable - argc",
   |  "/home/chkbuild/chkbuild/tmp/build/20230313T213003Z/ruby/lib/ruby_vm/rjit/insn_compiler.rb:1258: warning: assigned but unused variable - flags"]>.
```
2023-03-13 22:07:25 +09:00
Stan Lo
309ff928f5 [ruby/irb] Replace METHOD_IS_A with ===
(https://github.com/ruby/irb/pull/542)

edd6c30e16
2023-03-13 18:11:58 +00:00
Stan Lo
1095baed34 [ruby/irb] Support inspecting BasicObject
(https://github.com/ruby/irb/pull/541)

1dc2a406a3
2023-03-13 14:31:37 +00:00
Hiroshi SHIBATA
8c6b349805 [rubygems/rubygems] Removed Gem.datadir.
https://github.com/rubygems/rubygems/pull/2216 is imcomplete to remove this method.

34ef915d12
2023-03-13 09:54:04 +00:00
Takashi Kokubun
ed269c81aa RJIT: Count invokeblock exit types 2023-03-12 23:38:11 -07:00
Takashi Kokubun
da9c84f859 RJIT: Rename a side exit counter 2023-03-12 22:15:58 -07:00
Takashi Kokubun
d27b594841 RJIT: Fix a typo
and import a missing function
2023-03-12 22:09:05 -07:00
Takashi Kokubun
330086d3f6 RJIT: Implement definedivar 2023-03-12 22:07:02 -07:00
Takashi Kokubun
3938efa70f RJIT: Fix block param proxy on send
peek_at_stack was doubly accounting for C::VM_CALL_ARGS_BLOCKARG, which
made that case always side-exit and hide this bug.

When a block handler is block param proxy, you have to set LEP's specval
as next specval instead of block param proxy itself.
2023-03-12 22:01:38 -07:00
Takashi Kokubun
a23f64221e RJIT: Fix block finding logic
like YJIT does
2023-03-12 21:14:43 -07:00
Takashi Kokubun
9cd5441d28 RJIT: Implement --rjit-trace-exits 2023-03-12 15:15:08 -07:00
Takashi Kokubun
bbd9221e46 RJIT: Give up freezing InsnCompiler
for memoization
2023-03-12 13:31:15 -07:00
Takashi Kokubun
3efe4639ec RJIT: Handle Mod 10 for CMP r/m64, r64 2023-03-11 23:47:11 -08:00
Takashi Kokubun
9c220bf5e1 RJIT: Use lambda constants to match operands 2023-03-11 23:35:58 -08:00
Takashi Kokubun
8835f9d3bf RJIT: Define QwordPtr for in-clause readability 2023-03-11 22:30:54 -08:00
Takashi Kokubun
9501283dea RJIT: Leave it to NoMatchingPatternError
instead of manually implementing NotImplementedError
2023-03-11 22:25:00 -08:00
Takashi Kokubun
846fc356cb RJIT: Use case-in for exhaustive matches 2023-03-11 22:17:06 -08:00
Takashi Kokubun
fe34db5a1b RJIT: Migrate SIZET values to RJIT::C constants 2023-03-11 22:04:30 -08:00
Takashi Kokubun
50c5f94ed7 RJIT: Introduce constants under RubyVM::RJIT::C 2023-03-11 21:48:28 -08:00
Takashi Kokubun
58f7e8b7f8 RJIT: Automate function pointer imports 2023-03-11 21:26:40 -08:00
Takashi Kokubun
93e34fe42e RJIT: Write initial tests for Assembler 2023-03-10 14:57:37 -08:00
Takashi Kokubun
76808b1ee4 RJIT: Start testing Assembler 2023-03-10 13:57:52 -08:00
Takashi Kokubun
cdece5cf36 RJIT: Remove unused code from headers 2023-03-10 13:11:01 -08:00
Takashi Kokubun
c364e0745d RJIT: Introduce --rjit-exec-mem-size 2023-03-10 13:04:45 -08:00
Ian Ker-Seymer
dd47ce10db [rubygems/rubygems] Use RbSys::ExtensionTask when creating new rust gems
125f9fece9
2023-03-10 11:50:06 +00:00
Takashi Kokubun
4afe9c09a0 RJIT: Use imemo_type_p instead
which seems safer. It seems like imemo_type can cause SEGV.
2023-03-09 22:15:16 -08:00
Takashi Kokubun
35fd79ac37 RJIT: Lazily compile global ocb 2023-03-09 21:55:14 -08:00
Hiroshi SHIBATA
fade612d18 [rubygems/rubygems] Removed needless option
4489361a21
2023-03-10 03:51:17 +00:00
Hiroshi SHIBATA
15739c66b7 [rubygems/rubygems] Added only missing extensions option into pristine command
cfd0e615d7
2023-03-10 03:51:16 +00:00
Hiroshi SHIBATA
3926ad578c [rubygems/rubygems] Drop to support Psych 3.0 bundled at Ruby 2.5
a6650c2c96
2023-03-09 13:37:06 +00:00
Hiroshi SHIBATA
ea8b5e7359 [rubygems/rubygems] rubocop -a lib/rubygems/specification.rb
85d60e9886
2023-03-08 23:23:45 +00:00
Hiroshi SHIBATA
cb3f1f6de8 [rubygems/rubygems] Detect extension files under full_required_paths
When we use this methods with local gemspec, we don't handle
  build status of extension correctly. So We need to find extension
  files in require_paths.

  Example with ruby/erb repository:

  ```
  $ bundle exec irb
  Ignoring erb-4.0.2 because its extensions are not built. Try: gem pristine erb --version 4.0.2
  >>
  ```

f90e43cf3f
2023-03-08 23:23:45 +00:00
Burdette Lamar
2f19c5b7e0 [ruby/net-http] Enhanced RDoc for Net::HTTP
(https://github.com/ruby/net-http/pull/130)

698e18cfc1
2023-03-08 19:47:49 +00:00
Julie Haehn
c5296d9396 [rubygems/rubygems] Respect --no-install option for git: sources
Currently, the --no-install option to `bundle package` is totally
ignored for git sources. This can have very strange effects if you have:

- a git-sourced gem,
- with native extensions,
- whose extconf.rb script depends on another gem,
- which is installed from Rubygems in the gemfile.

In that circumstance, `bundle package --no-install --all` will download
the Rubygems dependencies to `vendor/cache` but NOT install them. It
will also check out the git gems to `vendor/cache` (good), and attempt
to build their native extensions (bad!).

The native extension build will fail because the extconf.rb script crashes,
since the dependency it needs is missing.

I implemented a fix for this in `source/git.rb`, since this is analogous
to what's happening in `source/rubygems.rb`. I do admit though the whole
thing is a little strange though - an "install" method that.... proceeds
to look at a global flag to not install anything.

Add test to confirm cache respects the --no-install flag

5a77d1c397

Co-authored-by: KJ Tsanaktsidis <kj@kjtsanaktsidis.id.au>
2023-03-07 22:36:36 +00:00
Martin Emde
85a1738ab3 [rubygems/rubygems] Add TarReader::Entry#seek to seek within the tar file entry
TarReader#each previously implemented a partial version of seek.
This code moved to Entry#seek for use from TarReader#each.

Entry#close now returns nil instead of true, like IO#close.

Closing an Entry now seeks to the end of the Entry, seeking past
any remaining zero byte tar file padding and moving the io to the
correcty position to read the next file in the archive.

Uses seek for Entry#rewind and #pos=, fixing the tar->gzip->tar nested
rewind that would break previous to this change.

Add Entry.open that behaves more like File.open.

f5149565d5
2023-03-07 20:21:43 +00:00
Samuel Giddins
638f68b2fe [rubygems/rubygems] Avoid calling String#dup in Gem::Version#marshal_dump
Might potentially save a second every time RubyGems.org creates a specs index

d6e4d50f8d
2023-03-07 11:48:41 +00:00
Josef Šimánek
dc33d32f12
Use proper memoized var name for Gem.state_home. 2023-03-07 16:52:28 +09:00
David Rodríguez
93f0749a64 [rubygems/rubygems] Fix gemspec file filter
Explicitly match directory separator to not match files in repo root
accidentally.

b936805ea9

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-03-07 16:51:36 +09:00
David Rodríguez
72591eb73f [rubygems/rubygems] Better suggestion when bundler/setup fails due to missing gems
If the original `BUNDLE_GEMFILE` is different from the default, then the
suggestion wouldn't work as is.

Before:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install` to install missing gems.

$  rubygems git:(better-cmd-suggestion) ✗ bundle install
Could not locate Gemfile
```

After:

```
$ util/rubocop
Could not find rubocop-1.30.1 in locally installed gems
Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems.

$ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb
Fetching gem metadata from https://rubygems.org/.........
Using ast 2.4.2
Using bundler 2.4.7
Using parser 3.1.2.0
Using rainbow 3.1.1
Using parallel 1.22.1
Using regexp_parser 2.5.0
Using rubocop-ast 1.18.0
Using rexml 3.2.5
Using ruby-progressbar 1.11.0
Using unicode-display_width 2.1.0
Fetching rubocop 1.30.1
Installing rubocop 1.30.1
Using rubocop-performance 1.14.2
Bundle complete! 2 Gemfile dependencies, 12 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ util/rubocop
Inspecting 345 files
.........................................................................................................................................................................................................................................................................................................................................................

345 files inspected, no offenses detected
```

bf1320d805
2023-03-07 16:51:36 +09:00