Граф коммитов

87136 Коммитов

Автор SHA1 Сообщение Дата
Peter Zhu 9a9e74389c Add struct weakmap_entry for WeakMap entries 2024-08-22 10:01:55 -04:00
David Rodríguez 2569413b1c [rubygems/rubygems] Fix `--prefer-local` flag
The original implementation of this flag was too naive and all it did
was restricting gems to locally installed versions if there are any
local versions installed.

However, it should be much smarter. For example:

* It should fallback to remote versions if locally installed version
  don't satisfy the requirements.
* It should pick locally installed versions even for subdependencies not
  yet discovered.

This commit fixes both issues by using a smarter approach similar to how
we resolve prereleases:

* First resolve optimistically using only locally installed gems.
* If any conflicts are found, scan those conflicts, allow remote
  versions for the specific gems that run into conflicts, and
  re-resolve.

https://github.com/rubygems/rubygems/commit/607a3bf479

Co-authored-by: Gourav Khunger <gouravkhunger18@gmail.com>
2024-08-22 11:48:32 +00:00
David Rodríguez 203051d839 [rubygems/rubygems] Fix bad grammar in log message
https://github.com/rubygems/rubygems/commit/bea4c1ad79
2024-08-22 11:48:31 +00:00
Hiroshi SHIBATA d731adb755
Strictly checking pull-request author 2024-08-22 16:38:54 +09:00
KJ Tsanaktsidis 86c2724e75 Don't emit ELF notes on non-ELF platforms
These apparently break compilation on old MacOS toolchains, because the
MachO section name is capped to 16 chars (although, on my MacOS, at
least, the section name just gets truncated). Nevertheless, these serve
no purpose on non-ELF platforms (they're part of the LSB Linux ABI).

[Bug #20677]
2024-08-22 17:35:43 +10:00
KJ Tsanaktsidis 6a746e1bc9 Check for both aarch64 and arm64 arch's for pac-ret
Linux calls it aarch64, but MacOS calls it arm64; pac-ret works on both.
2024-08-22 17:35:43 +10:00
KJ Tsanaktsidis ff0a181852 Fix typo in ELF note generation
This wasn't looking at the right macro name for pac-ret support, so if
Ruby was compiled with pac-ret but NOT BTI, then the ELF note would not
be emitted.
2024-08-22 17:35:43 +10:00
Nobuyoshi Nakada 004c6a6ed1 Use ruby to suppress a warning message by cmd.exe
It is expected that reading from command with offset fails by ESPIPE
and the pipe will be closed immediately.  While this causes the child
process to terminate by SIGPIPE usually, cmd.exe yields the message
bellow.

```
The process tried to write to a nonexistent pipe.
```
2024-08-22 16:32:54 +09:00
git 29500e3034 Update bundled gems list as of 2024-08-22 2024-08-22 07:01:14 +00:00
Nobuyoshi Nakada e7ce8ca166
Fix commented version of codeql-action/upload-sarif [ci skip]
Dependabot will update matching version comments.
2024-08-22 12:35:57 +09:00
dependabot[bot] 0846bcbdf8 Bump github/codeql-action from 3.26.3 to 3.26.4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.3 to 3.26.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](883d8588e5...f0f3afee80)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-22 12:25:52 +09:00
Hiroshi SHIBATA 64a005df3b `make test-tool` with Windows is broken. We should use :KILL with that platform.
```
[ 14/191] TestParallel::TestParallel#test_hungup = 11.02 s
  1) Failure:
TestParallel::TestParallel#test_hungup [C:/Users/hsbt/DevDrive/github.com/ruby/ruby/tool/test/testunit/test_parallel.rb:211]:
Expected /^Retrying hung up testcases\.+$/ to match "Run options: \n" +
"  --seed=35582\n" +
"  --ruby\n" +
"  \".\\\\ruby.exe -I../../ruby/lib -I.ext/x64-mswin64_140 -I. ../../ruby/tool/runruby.rb --extout=.ext -- --disable-gems\"\n" +
"  -j\n" +
"  t1\n" +
"  --worker-timeout=1\n" +
"\n" +
"# Running tests:\n" +
"\n" +
"[1/1] 50340=test4test_hungup.\n" +
"C:/Users/hsbt/DevDrive/github.com/ruby/ruby/tool/lib/test/unit.rb:418:in 'Process.kill': Invalid argument (Errno::EINVAL)\n" +
```
2024-08-22 11:29:48 +09:00
Jeremy Evans a3f5a043fa Handle getlogin failure in PTY.spawn
getlogin is only called if USER environment variable is not set,
but if getlogin returns NULL in that case, then do not call
getpwnam, and assume /bin/sh as shell.

Mentioned in comment to bug 20586.
2024-08-22 11:20:47 +09:00
Jeremy Evans ae886e0c83 Check getlogin return value before passing to strcasecmp
getlogin can return NULL, and this can avoid a segfault
in that case.

Mentioned as an issue in comment to bug 20586.
2024-08-22 11:20:47 +09:00
Hiroshi SHIBATA 8999fd1ac8 automerge needs windows results 2024-08-22 11:06:20 +09:00
Hiroshi SHIBATA 8558bea27b Suppress warning for fd leak
```
Leaked file descriptor: TestResolvDNS#test_multiple_servers_with_timeout_and_truncated_tcp_fallback: 15 : #<TCPSocket:fd 15, AF_INET, 127.0.0.1, 61633>
```
2024-08-22 10:38:43 +09:00
Kevin Newton 773cf883ac [PRISM] Reset $. when done reading STDIN 2024-08-21 16:59:03 -04:00
Kevin Newton f60499826f [PRISM] Fix TestTRICK#test_ksk_1
If an array element is a static literal that does not result in a
intermediate array, it still needs to be compiled normally.
2024-08-21 16:32:19 -04:00
Kevin Newton 465cf8d80b [PRISM] Potentially enable coverage on the main script 2024-08-21 16:32:05 -04:00
BurdetteLamar 76ccd1df37 [DOC] Tweaks for Enum#tally 2024-08-21 15:56:59 -04:00
BurdetteLamar 53e3795379 [DOC] Tweaks to Array#bsearch_index 2024-08-21 12:07:28 -04:00
Burdette Lamar f5579c9278
[DOC] Include keywords.rdoc in doc/syntax/ (#11414) 2024-08-21 12:06:48 -04:00
BurdetteLamar 65b3bcede3 [DOC] Tweaks for Array#collect 2024-08-21 11:59:20 -04:00
BurdetteLamar ee6c7ab0cf [DOC] Tweaks for Array#clear 2024-08-21 11:56:35 -04:00
BurdetteLamar 124f1754df [DOC] Tweaks for Array#bsearch 2024-08-21 11:42:20 -04:00
eileencodes 7ad74d1686 [PRISM] Implement unused block warning
Related: ruby/prism#2935
2024-08-21 11:37:13 -04:00
Peter Zhu e15b454bc3 Simplify how finalizers are ran at shutdown
We don't need to build a linked list from the finalizer table and
instead we can just run the finalizers by iterating the ST table.

This also improves the performance at shutdown, for example:

    1_000_000.times.map do
      o = Object.new
      ObjectSpace.define_finalizer(o, proc { })
      o
    end

Before:

    Time (mean ± σ):      1.722 s ±  0.056 s    [User: 1.597 s, System: 0.113 s]
    Range (min … max):    1.676 s …  1.863 s    10 runs

After:

    Time (mean ± σ):      1.538 s ±  0.025 s    [User: 1.437 s, System: 0.093 s]
    Range (min … max):    1.510 s …  1.586 s    10 runs
2024-08-21 11:12:07 -04:00
David Rodríguez 669d1f79d8 [rubygems/rubygems] Restore support for passing relative paths to `:git`
The `file://` protocol does not really work with relative paths and it's
not necessary anyways. So restore support for that by not using
`file://`.

https://github.com/rubygems/rubygems/commit/16a68998ce
2024-08-21 14:47:57 +00:00
David Rodríguez 52c02794df [rubygems/rubygems] Add missing flag passed to `git fetch`
Doesn't really change the test outcome, but I noticed it was missing.

https://github.com/rubygems/rubygems/commit/ea4f9d5209
2024-08-21 14:47:57 +00:00
Kevin Newton 2bc141f2b6
[PRISM] Fix up test exception assertion for Prism 2024-08-21 10:34:12 -04:00
Peter Zhu d5dbaa5da3 Remove unused weakmap field in wmap_foreach 2024-08-21 08:43:59 -04:00
David Rodríguez 419d3221fb [rubygems/rubygems] Fix `gem uninstall <name>:<version>` failing on shadowed default gems
https://github.com/rubygems/rubygems/commit/29357a5dd6
2024-08-21 12:07:10 +00:00
David Rodríguez 3ebe249ce1 [rubygems/rubygems] Add better error when trying to develop RubyGems with an unsupported Ruby version
https://github.com/rubygems/rubygems/commit/9d41c4088a
2024-08-21 12:06:43 +00:00
David Rodríguez 54b6025887 [rubygems/rubygems] Regeneration previous git application caches that didn't include bare repos
https://github.com/rubygems/rubygems/commit/417319ecb1
2024-08-21 12:06:28 +00:00
Nobuyoshi Nakada 7845ab1bc9
[Bug #20687] Exclude just built ruby as baseruby
On Windows, an executable file in the current directory has the
priority to the PATH environment variable always.
2024-08-21 20:43:56 +09:00
Nobuyoshi Nakada 6ab591f80a
[Bug #20687] Check if base ruby provides necessary libraries 2024-08-21 16:56:44 +09:00
Hiroshi SHIBATA 71c14c8889 Don't show script name when bundle exec and call ruby script directly. 2024-08-21 16:48:35 +09:00
Hiroshi SHIBATA c97dc7739e Skip to show script name with using ruby -r option 2024-08-21 16:48:35 +09:00
Hiroshi SHIBATA 5fedf1c3ac Show correct script name with sub-feature case 2024-08-21 16:48:35 +09:00
Hiroshi SHIBATA b41d79962a Reapply "[ruby/uri] Warn compatibility methods in RFC3986_PARSER"
This reverts commit 3da7e440e9.
2024-08-21 14:52:29 +09:00
Soutaro Matsumoto ea828c0bf0 Skip failing tempfile library tests 2024-08-21 13:55:09 +09:00
Hiroshi SHIBATA 592b90328a
Generate parsers of RDoc with Racc 1.8.1 2024-08-21 13:30:01 +09:00
Michael Chui 014708ad5a [ruby/logger] Guarantee level_override exists
Some Ruby apps subclass Logger without running the superclass
constructor, which means that `@level_override` isn't initialized
properly. This can be fixed in some cases, but the gem should maintain
backwards compatibility.

https://github.com/ruby/logger/commit/3246f38328
2024-08-21 01:10:56 +00:00
Peter Zhu 1d68a735a2 [ruby/tempfile] Don't unlink in finalizer when already unlinked
https://github.com/ruby/tempfile/commit/f677941ea2
2024-08-20 18:37:53 +00:00
Peter Zhu bd7eda6038 [ruby/tempfile] Fix subprocess tests requires
Using `-rtempfile` requires the tempfile built into Ruby, not the
currently developed one, so the tests aren't testing this tempfile.

https://github.com/ruby/tempfile/commit/ea2dec6f46
2024-08-20 18:37:53 +00:00
Peter Zhu 2f67610f6b Remove dependency on Tempfile::Remover in leakchecker.rb 2024-08-20 14:29:40 -04:00
Peter Zhu a68331e703 [ruby/tempfile] Add FinalizerManager to manage finalizers
As @jeremyevans pointed out for commit eb2d8b1:

> Each Tempfile instance has a separate File instance and file descriptor:
>
>   t = Tempfile.new
>   t.to_i # => 6
>   t.dup.to_i => 7

FinalizerManager will keep track of the open File objects for the
particular file and will only unlink the file when all of the File objects
have been closed.

https://github.com/ruby/tempfile/commit/753ab16642
2024-08-20 18:07:42 +00:00
Peter Zhu 41b427a264 [ruby/tempfile] Ensure finalizer order in Tempfile
The Closer and Remover finalizers are defined on different objects in
Tempfile. The Closer is defined on the Tempfile object while the Remover
is defined on the finalizer_obj. This means that there is no guarantee
of the finalizer order.

On Windows, we must close the file before removing it because we cannot
remove an open file. But since the order is not guaranteed, the GC may
run the Remover finalizer first, which will fail with an Errno::EACCES
(Permission denied @ apply2files).

This commit changes it so that both the Closer and Remover finalizers
are defined on the finalizer_obj, which guarantees the order that it is
ran.

https://github.com/ruby/tempfile/commit/eb2d8b1175
2024-08-20 13:28:36 +00:00
Nobuyoshi Nakada d6f18b226e
Remove extraneous lock files
See https://github.com/rubygems/rubygems/pull/7939
2024-08-20 20:16:45 +09:00
Hiroshi SHIBATA 72d016e97b [ruby/reline] typofix
https://github.com/ruby/reline/commit/d44fbf9f7b
2024-08-20 11:03:13 +00:00