87158 Commits

Author SHA1 Message Date
David Rodríguez
140d8318db [rubygems/rubygems] Fix generic platform gems getting incorrectly removed when locked for a specific platform
If they are already in the lockfile as the most specific variant for a
platform, we shouldn't change that unless explicitly unlocking.

https://github.com/rubygems/rubygems/commit/a901660498
2024-07-09 16:34:09 +00:00
David Rodríguez
e6c7a309d0 [rubygems/rubygems] Refactor selecting specs from a SpecSet
https://github.com/rubygems/rubygems/commit/bcbbff5149
2024-07-09 16:34:09 +00:00
David Rodríguez
dd05191bc3 [rubygems/rubygems] Resolve all platforms directly
Instead of having to do a complete pass after resolve.

To do this, we add to the ruby group all the platform specs with the
same dependencies as the ruby specs.

https://github.com/rubygems/rubygems/commit/e50415f2a6
2024-07-09 16:34:08 +00:00
David Rodríguez
00acc70348 [rubygems/rubygems] Don't memoize sorted_spec_names
It's just for debugging and a simple method, so no need.

https://github.com/rubygems/rubygems/commit/3230425a9a
2024-07-09 16:34:08 +00:00
David Rodríguez
086cde1651 [rubygems/rubygems] Instantiate Resolver::SpecGroup with explicit priority
https://github.com/rubygems/rubygems/commit/e2c1bc1b6c
2024-07-09 16:34:07 +00:00
David Rodríguez
5fdfdc30f1 [rubygems/rubygems] Let resolver consider unique specs from the beginning
It results in more consistent error messages.

https://github.com/rubygems/rubygems/commit/a4b34361cc
2024-07-09 16:34:07 +00:00
David Rodríguez
a333e867aa [rubygems/rubygems] Fix spec to also pass outside of Linux
https://github.com/rubygems/rubygems/commit/fc8c853345
2024-07-09 16:34:06 +00:00
David Rodríguez
1d97c46b35 [rubygems/rubygems] Minor Bundler spec improvements
While working on something else I noticed:

* Usage of uppercased "RUBY" and "JAVA" as platforms, when those don't
  really exist.
* Usage of some test gems with "1.0" as gemspec version and "1.0.0" as
  actual version.

This commit fixes both inconsistencies to make things more expectable.

https://github.com/rubygems/rubygems/commit/e3ec32e247
2024-07-09 14:43:18 +00:00
dependabot[bot]
ac0e0f0c76 [rubygems/rubygems] Bump rb-sys
Bumps [rb-sys](https://github.com/oxidize-rb/rb-sys) from 0.9.97 to 0.9.98.
- [Release notes](https://github.com/oxidize-rb/rb-sys/releases)
- [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.97...v0.9.98)

---
updated-dependencies:
- dependency-name: rb-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

https://github.com/rubygems/rubygems/commit/d2846130bc
2024-07-09 14:42:40 +00:00
Burdette Lamar
30b9912bb7
[DOC] Doc for Float#ceil (#11125) 2024-07-09 09:43:07 -04:00
Peter Zhu
ab3fa8dece [DOC] Use backticks instead of HTML tags 2024-07-09 08:55:58 -04:00
Peter Zhu
5de6d0b35f [DOC] Fix granularity calculation
The granularity is calculated as `10 ** ndigits.abs` rather than
`ndigits.abs * 10`. For example, if `ndigits` is `-2`, it should be
`10 ** 2 == 100` rather than `2 * 10 == 20`.
2024-07-09 08:55:58 -04:00
David Rodríguez
ad6b2e8985 [rubygems/rubygems] Test using latest rubies
https://github.com/rubygems/rubygems/commit/6d6646b8bc
2024-07-09 11:26:10 +00:00
Hiroshi SHIBATA
f9004fc8aa [rubygems/rubygems] Suppress SSLError warning because it's only for debugging.
http://ci.rvm.jp/logfiles/brlog.trunk.20240709-010435#L1554

https://github.com/rubygems/rubygems/commit/a1a46f413b
2024-07-09 09:09:14 +00:00
Hiroshi SHIBATA
e09df57427 [ruby/open-uri] Try Windows tests again
https://github.com/ruby/open-uri/commit/50f265ba29
2024-07-09 07:27:48 +00:00
Hiroshi SHIBATA
5d82abdfc8 Removed duplicate server thread 2024-07-09 16:21:55 +09:00
Hiroshi SHIBATA
e62ac3aac7 Reapply "Reverts related commits with https://github.com/ruby/open-uri/pull/37"
This reverts commit 02c4f0c89db3689c5272f00c548ca3008120459b.
2024-07-09 16:21:55 +09:00
Nobuyoshi Nakada
690b56440b
Use File.write instead of Kernel#open 2024-07-09 13:01:44 +09:00
Koichi Sasada
e500222de1 fix last commit
`th` is gone.
2024-07-09 06:43:28 +09:00
Koichi Sasada
ffc69eec0a struct rb_thread_sched_waiting
Introduce `struct rb_thread_sched_waiting` and `timer_th.waiting`
can contain other than `rb_thread_t`.
2024-07-09 05:57:03 +09:00
Peter Zhu
a9f6bd028a Add make target shared-gc
Allows building shared GC using `make shared-gc SHARED_GC=gc_impl`
2024-07-08 16:47:25 -04:00
Alan Wu
3be9ce3cf6
YJIT: dump-disasm: Print comments and bytes in release builds
This change implements a fallback mode for the `--yjit-dump-disasm`
development command-line option to make it usable in release builds.
Previously, using the option with release builds of YJIT yielded only
a warning asking the user to build with `--enable-yjit=dev`.

While builds that use the `disasm` feature still give the best output,
just having the comments is useful enough for many kinds of debugging.
Having it usable in release builds is nice for new hackers, too, since
this allows for tinkering without having to learn how to build YJIT in
development mode.

Sample output on A64:

```
  # regenerate_branch
  # Insn: 0001 opt_send_without_block (stack_size: 1)
  # guard known object with singleton class
  0x11f7e0034: 4b 00 00 58 03 00 00 14 08 ce 9c 04 01 00 00
  0x11f7e0043: 00 3f 00 0b eb 81 06 01 54 1f 20 03 d5
  # RUBY_VM_CHECK_INTS(ec)
  0x11f7e0050: 8b 02 42 b8 cb 07 01 35
  # stack overflow check
  0x11f7e0058: ab 62 02 91 7f 02 0b eb 69 07 01 54
  # save PC to CFP
  0x11f7e0064: 0b 3b 9a d2 2b 2f a0 f2 0b 00 cc f2 6b 02 00
  0x11f7e0073: f8 ab 82 00 91
```

To ensure this feature doesn't incur too much cost when running without
the `--yjit-dump-disasm` option, I checked that there is no significant
impact to compile time and memory usage with the `compile_time_ns` and
`yjit_alloc_size` entry in `RubyVM::YJIT.runtime_stats`. For each
sample, I ran 3 iterations of the `lobsters` YJIT benchmark. The
statistics summary and done with the `summary` function in R.

Compile time, sample size of 60, lower is better:

```
       Before              After
 Min.   :2.054e+09   Min.   :2.028e+09
 1st Qu.:2.069e+09   1st Qu.:2.044e+09
 Median :2.081e+09   Median :2.060e+09
 Mean   :2.089e+09   Mean   :2.066e+09
 3rd Qu.:2.109e+09   3rd Qu.:2.085e+09
 Max.   :2.146e+09   Max.   :2.144e+09
```

Allocation size, sample size of 20, lower is better:

```
       Before             After
 Min.   :21804742   Min.   :21794082
 1st Qu.:21826682   1st Qu.:21816282
 Median :21844042   Median :21826814
 Mean   :21960664   Mean   :22026291
 3rd Qu.:21861228   3rd Qu.:22040439
 Max.   :22587426   Max.   :22930614
```

The `yjit_alloc_size` samples are noisy, but since the average increased
by only 0.3%, and the median is lower, I feel safe saying that there is
no significant change.
2024-07-08 20:02:30 +00:00
BurdetteLamar
a57b4340d0 Doc fixes 2024-07-08 14:35:29 -04:00
David Rodríguez
ae6a2d0641 [rubygems/rubygems] Fix wrong version is comment
This RubyGems feature is being released as 3.5.15, so we can stop
monkeypatching RubyGems once support for the previous version is
dropped.

https://github.com/rubygems/rubygems/commit/36f146840d
2024-07-08 17:06:26 +00:00
David Rodríguez
39826f384a [rubygems/rubygems] Backport binstub race condition fix to Bundler
https://github.com/rubygems/rubygems/commit/b07e46820d
2024-07-08 17:06:25 +00:00
Peter Zhu
0c61e21277 Rename rb_gc_impl_verify_internal_consistency to gc_verify_internal_consistency
It's an internal function so we can drop the rb_gc_impl
2024-07-08 09:08:22 -04:00
Peter Zhu
e148db70ea Make rb_gc_impl_verify_internal_consistency static
The function is not used outside of this file.
2024-07-08 09:06:45 -04:00
Hiroshi SHIBATA
02c4f0c89d
Reverts related commits with https://github.com/ruby/open-uri/pull/37
It caused Timeout failure with RJIT and chkbuild

http://rubyci.s3.amazonaws.com/debian11/ruby-master/log/20240708T063006Z.fail.html.gz
https://github.com/ruby/ruby/actions/runs/9836594303/job/27152644853
2024-07-08 20:00:01 +09:00
Jean Boussier
9594db0cf2 Implement Hash.new(capacity:)
[Feature #19236]

When building a large hash, pre-allocating it with enough
capacity can save many re-hashes and significantly improve
performance.

```
/opt/rubies/3.3.0/bin/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \
	            --executables="compare-ruby::../miniruby-master -I.ext/common --disable-gem" \
	            --executables="built-ruby::./miniruby --disable-gem" \
	            --output=markdown --output-compare -v $(find ./benchmark -maxdepth 1 -name 'hash_new' -o -name '*hash_new*.yml' -o -name '*hash_new*.rb' | sort)
compare-ruby: ruby 3.4.0dev (2024-03-25T11:48:11Z master f53209f023) +YJIT dev [arm64-darwin23]
last_commit=[ruby/irb] Cache RDoc::RI::Driver.new (https://github.com/ruby/irb/pull/911)
built-ruby: ruby 3.4.0dev (2024-03-25T15:29:40Z hash-new-rb 77652b08a2) +YJIT dev [arm64-darwin23]
warming up...

|                    |compare-ruby|built-ruby|
|:-------------------|-----------:|---------:|
|new                 |      7.614M|    5.976M|
|                    |       1.27x|         -|
|new_with_capa_1k    |     13.931k|   15.698k|
|                    |           -|     1.13x|
|new_with_capa_100k  |     124.746|   148.283|
|                    |           -|     1.19x|
```
2024-07-08 12:24:33 +02:00
Hiroshi SHIBATA
bfb8cad771
Expand RJIT timeout to 60min 2024-07-08 17:58:46 +09:00
Hiroshi SHIBATA
a5f4014738
Load net-http explicitly for SimpleHTTPProxyServer 2024-07-08 17:05:12 +09:00
Hiroshi SHIBATA
b903d9f09f [ruby/tempfile] typofix
https://github.com/ruby/tempfile/commit/82a74b017e
2024-07-08 06:18:57 +00:00
Hiroshi SHIBATA
4658d65242 Load socket explicitly for TCPServer 2024-07-08 15:15:46 +09:00
Hiroshi SHIBATA
95bf9049a7 Load OpenSSL on TestOpenURIUtils for with_https 2024-07-08 15:15:46 +09:00
David Rodríguez
e4825a5194 [rubygems/rubygems] Fix another race condition
We also need to protect prior removal of the binstub, otherwise it can
happen that:

* Process A removes prior binstub FOO.
* Process B removes prior binstub FOO (does nothing actually because Process A already removed it).
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

Similarly as before, if binstub FOO for gem BAR is bigger that binstub
FOO for gem BAZ, garbage bytes will be left around at the end of the
file, corrupting the binstub.

The solution is to also protect removal of the previous binstub. To do
this, we use a file lock on an explicit `.lock` file.

https://github.com/rubygems/rubygems/commit/d99a80e62d
2024-07-08 14:38:31 +09:00
David Rodríguez
d90a930ede [rubygems/rubygems] Properly protect writing binstubs with a file lock
There's an issue when multiple processes try to write the same binstub.
The problem is that our file locking mechanism is incorrect because
files are truncated _before_ they are locked. So it can happen that:

* Process A truncates binstub FOO.
* Process B truncates binstub FOO.
* Process A writes binstub FOO for gem BAR from the beginning of file.
* Process B writes binstub FOO for gem BAZ from the beginning of file.

If binstub FOO for gem BAR is bigger than binstub FOO for gem BAZ, then
some bytes will be left around at the end of the binstub, making it
corrupt.

This was not a problem in our specs until the spec testing binstubs with
the same name coming from different gems changed from using gems named
"fake" and "rack" to using gems named "fake" and "myrack". Because of
the difference in gem name length, the generated binstub for gem
"myrack" is now longer, causing the above problem if binstub for gem
myrack is written first.

The solution is to make sure when using flock to always use modes that
DON'T truncate the file when opening it. So, we use `r+` if the file
exists previously (it requires the file to exist previously), otherwise
we use `a+`.

https://github.com/rubygems/rubygems/commit/ce8bcba90f
2024-07-08 14:38:30 +09:00
David Rodríguez
da12d63431 [rubygems/rubygems] Scope rescuing Errno::ENOLCK to just File.open
https://github.com/rubygems/rubygems/commit/2a9d347d29
2024-07-08 14:38:29 +09:00
David Rodríguez
7cf7e7e2c0 [rubygems/rubygems] Add missing blank line after method documentation
https://github.com/rubygems/rubygems/commit/2df7560ade
2024-07-08 14:38:29 +09:00
David Rodríguez
6db1c53fce [rubygems/rubygems] Remove unnecessary FileUtils usage
All other `chmod` usages in the file use `File.chmod`, so keep it
consistent.

https://github.com/rubygems/rubygems/commit/3dc0cf8703
2024-07-08 14:38:28 +09:00
Hiroshi SHIBATA
dcc8e54234 [ruby/open-uri] Don't use Base64 library
https://github.com/ruby/open-uri/commit/c8c0452d53
2024-07-08 04:53:14 +00:00
Hiroshi SHIBATA
bf898057b4 [ruby/open-uri] Test with Windows
https://github.com/ruby/open-uri/commit/2606892a43
2024-07-08 04:53:13 +00:00
Hiroshi SHIBATA
71490d2314 [ruby/open-uri] Move certificates under the TestOpenURIUtils
https://github.com/ruby/open-uri/commit/a28c2da5d2
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA
3d78e63312 [ruby/open-uri] Load stringio with the correct files
https://github.com/ruby/open-uri/commit/cb17a907a2
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA
09c52b91b9 [ruby/open-uri] Removed needless class definition and variables
https://github.com/ruby/open-uri/commit/ab0e916997
2024-07-08 04:53:12 +00:00
Hiroshi SHIBATA
61e00856c9 [ruby/open-uri] Don't use URI library
https://github.com/ruby/open-uri/commit/15989970b6
2024-07-08 04:53:11 +00:00
Hiroshi SHIBATA
e6b6c2ba9d [ruby/open-uri] support CONNECT method for SimpleHTTPProxy
https://github.com/ruby/open-uri/commit/2e36793bd5
2024-07-08 04:53:11 +00:00
Hiroshi SHIBATA
b782906400 [ruby/open-uri] Added SimpleHTTPSServer by TCPServer and OpenSSL
https://github.com/ruby/open-uri/commit/57c80e1576
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA
debcf108fa [ruby/open-uri] Added SimpleHTTPProxyServer by TCPServer
https://github.com/ruby/open-uri/commit/ad47529306
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA
a574e290c5 [ruby/open-uri] Extract SimpleHTTPServer and with_http to TestOpenURIUtils module for other tests
https://github.com/ruby/open-uri/commit/489a1e9006
2024-07-08 04:53:10 +00:00
Hiroshi SHIBATA
7a74dcedd3 [ruby/open-uri] Added SimpleHTTPSServer by TCPServer
https://github.com/ruby/open-uri/commit/a2b1ebe465
2024-07-08 04:53:09 +00:00