86825 Commits

Author SHA1 Message Date
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
Hiroshi SHIBATA
a105bf8169 [ruby/open-uri] Removed needless setup and teardown, tmpdir variables
https://github.com/ruby/open-uri/commit/b2d7fc4ff3
2024-07-08 04:53:09 +00:00
Hiroshi SHIBATA
846c45c2b4 [ruby/open-uri] Extract FTP tests from test_open-uri.rb
https://github.com/ruby/open-uri/commit/324111eb41
2024-07-08 04:53:09 +00:00
Hiroshi SHIBATA
6fb482d429 [ruby/open-uri] Extract HTTP Proxy tests from test_open-uri.rb
https://github.com/ruby/open-uri/commit/e9e6bd2779
2024-07-08 04:53:08 +00:00
dependabot[bot]
6d24bc49ab Bump actions/upload-artifact from 4.3.3 to 4.3.4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.3 to 4.3.4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65462800fd...0b2256b8c0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 12:54:12 +09:00
dependabot[bot]
6ac030981f Bump ruby/setup-ruby from 1.184.0 to 1.185.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.184.0 to 1.185.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](97e35c5302...3a77c29278)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 12:15:25 +09:00
Naoto Ono
8ede84aa95 Move the file location of launchable.rb 2024-07-08 10:15:04 +09:00
Naoto Ono
5b78925455 Integrate Launchable into make btest 2024-07-08 10:15:04 +09:00
KJ Tsanaktsidis
dface4427d Also export CC for dtrace's benefit as well
The CFLAGS might contain flags that only work with the specified CC
2024-07-07 22:37:36 +10:00
KJ Tsanaktsidis
8ec67052e6 Do not define SHSTK feature for amd64 Context.S
We do not implement CET shadow-stack switching in amd64 Context.S. If
you compile Ruby with `-fcf-protection=full` and run it with
`GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK` exported, it will crash with a
control flow exception.

Configure the appropriate notes at the end of Context.S

[Bug #18061]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis
3381c60836 Ensure CFLAGS are passed to probes.o generation
The dtrace python script from systemtap on Linux actually looks at the
CFLAGS environment variable when invoking gcc to make the probes.o file.
If we don't pass the CFLAGS we're using, this probes.o file can wind up
without the required annotations indicating that it supports e.g. Intel
CET.

Fix this by explicitly exporting our build flags to the environment for
this script.

[Bug #18061]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis
b940de83de Revert autoconf macros defining RUBY_AARCH64_{BTI|PAC}_ENABLED
This partially reverts https://github.com/ruby/ruby/pull/10944; now that
we decided to pass CFLAGS to $(CC) when assembling .S files, we don't
need these autoconf macros that capture the state of
__ARM_FEATURE{PAC|BTI}_DEFAULT.

[Bug #20601]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis
b18701a7ae Remove $(ASFLAGS) from build system and assemble with $(CFLAGS) instead
We already assemble our assembly files using the $(CC) compiler driver,
rather than the actual $(AS) assembler. This means that

* The C preprocessor gets run on the assembly file
* It's valid to pass gcc-style flags to it, like e.g.
  -mbranch-protection or -fcf-protection
* If you do so, the relevant preprocessor macros like __CET__ get set
* If you really wanted to pass assembler flags, you would need to do
  that using -Wa,... anyway

So I think it makes sense to pass "$(XCFLAGS) $(CFLAGS) $(CPPFLAGS)" to
gcc/clang/etc when assembling, rather than passing $(ASFLAGS) (since
the flags are not actually passed to `as`, but `cc`!).

The side effect of this is that if there are mitigation flags like
-fcf-protection in $CFLAGS, then the relevant macros like __CET__ will
be defined when assembling the files.

[Bug #20601]
2024-07-07 20:14:44 +10:00
cdfzo
087b461c83
[DOC] Fix typo with -> wish 2024-07-07 13:09:42 +09:00
git
d76332e551 Update default gems list at abaa1b913d6ac15ab1cb6c639a9b8b [ci skip] 2024-07-06 17:55:53 +00:00
Stan Lo
abaa1b913d [ruby/irb] Bump version to v1.14.0
(https://github.com/ruby/irb/pull/980)

https://github.com/ruby/irb/commit/6a9e129714
2024-07-06 17:55:00 +00:00
Jeremy Evans
7f1fe5f091 Raise a TypeError for Thread#thread_variable{?,_get} for non-symbol
Previously, a TypeError was not raised if there were no thread
variables, because the conversion to symbol was done after that
check.  Convert to symbol before checking for whether thread
variables are set to make the behavior consistent.

Fixes [Bug #20606]
2024-07-06 12:07:32 +02:00
Alan Wu
e240fc9c3c [DOC] yjit.md: Markdown fixes for RDoc
It now renders properly on both GitHub and with RDoc's darkfish theme.
2024-07-05 18:38:46 -04:00
Peter Zhu
3fede665ff Update GitHub actions for shared GC 2024-07-05 14:05:58 -04:00
Peter Zhu
e2ceded2c6 Change external GC to use directory at configure
This commit changes the external GC API to use `--with-shared-gc=DIR` at
configure time with a directory of the external GC and uses
`RUBY_GC_LIBRARY` environment variable to load the external GC at
runtime.
2024-07-05 14:05:58 -04:00
Peter Zhu
8fd2df529b Revert "Load external GC using command line argument"
This reverts commit 8ddb1110c283c5cb59b6582383f36fdbcc43ab19.
2024-07-05 14:05:58 -04:00
Stan Lo
32ba86c9be [ruby/irb] Return only commands when completing help command's
argument
(https://github.com/ruby/irb/pull/973)

The command only takes command names as arguments, so we should only
return command names as candidates.

This will help users find a command faster as completion will be
another useful hint too.

https://github.com/ruby/irb/commit/7b6557cc24
2024-07-05 17:51:17 +00:00
Peter Zhu
1afcaa3e4b Fix flaky test_stat_heap_all
We only collect GC.stat_heap(nil, stat_heap_all)
once, outside of the loop, but assert_equal could
allocate objects which can cause a GC to run and
cause stat_heap_all to be out-of-sync.
2024-07-05 09:15:32 -04:00
Koichi Sasada
685a4e5be7 VM barrier needs to store GC root
On the VM barrier waiting, it needs to store machine context
as a GC root.

Also it needs to wait for barrier synchronization correctly
by `while` (for continuous barrier sync by another ractor).

This is why GC marking misses are occerred on ARM machines.
like: https://rubyci.s3.amazonaws.com/fedora40-arm/ruby-master/log/20240702T063002Z.fail.html.gz
2024-07-05 21:20:54 +09:00
なつき
88a2a46e23 [rubygems/rubygems] Restrict generic arm to only match 32-bit arm
https://github.com/rubygems/rubygems/commit/14c4c16e96
2024-07-05 09:02:52 +00:00
dependabot[bot]
cd1ea98bdc Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](5e5f99653a...dbb049abf0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-04 20:51:32 -07:00
Hiroshi SHIBATA
3b48a5a11c Use macos-14 instead of macos-arm-oss
Unfortunately, we can't use macos-arm-oss with enterprise account
2024-07-05 12:10:23 +09:00
Jerome Dalbert
bbb4da78c7 [rubygems/rubygems] Use preferred add_dependency instead of add_runtime_dependency
https://github.com/rubygems/rubygems/commit/9a08043858
2024-07-05 02:24:53 +00:00
Peter Zhu
c480dec1cc Fix RUBY_FREE_AT_EXIT with ASAN
When Ruby is built with ASAN and RUBY_FREE_AT_EXIT is enabled, the
following error occurs:

    READ of size 8 at 0x74c666610020 thread T0
        #0 0x593b6712ecc6 in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30
        #1 0x593b6712ecc6 in rb_gc_impl_shutdown_free_objects gc_impl.c:3208:17
        #2 0x593b6749a62e in ruby_vm_destruct vm.c:3133:17
2024-07-04 09:25:50 -04:00
Hiroshi SHIBATA
478ada0e2b [rubygems/rubygems] Handle OpenSSL::SSL::SSLError in local https server
https://github.com/rubygems/rubygems/commit/ccbbe84d77
2024-07-04 03:33:09 +00:00
Hiroshi SHIBATA
ba4495d75a [rubygems/rubygems] Align code styles with rubocop and others.
https://github.com/rubygems/rubygems/commit/c31a1592ee
2024-07-04 03:33:09 +00:00
Hiroshi SHIBATA
7e69d74729 [rubygems/rubygems] Correctly handling fetcher leak
https://github.com/rubygems/rubygems/commit/c538558522
2024-07-04 03:33:08 +00:00
Hiroshi SHIBATA
318af23baa [rubygems/rubygems] Removed needless variable
https://github.com/rubygems/rubygems/commit/29f71ee6d2
2024-07-04 03:33:08 +00:00
Hiroshi SHIBATA
2cd270aecc [rubygems/rubygems] YAML is always enabled
https://github.com/rubygems/rubygems/commit/c755bcde62
2024-07-04 03:33:07 +00:00