summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-25[rubygems/rubygems] Generate native gems with `-fvisibility=hidden`Jean Boussier
I recently ran into very nasty issues with dynamic symbols clashing between two native gems. I believe the overwhelming majority of native gems don't want to export their symbols, so hidding them by default would make sense to me. https://github.com/rubygems/rubygems/commit/449624aa54
2023-03-24Fix Dir.for_fd call-seqJeremy Evans
2023-03-25IO::Buffer#resize: Free internal buffer if new size is zero (#7569)Kasumi Hanazuki
`#resize(0)` on an IO::Buffer with internal buffer allocated will result in calling `realloc(data->base, 0)`. The behavior of `realloc` with size = 0 is implementation-defined (glibc frees the object and returns NULL, while BSDs return an inaccessible object). And thus such usage is deprecated in standard C (upcoming C23 will make it UB). To avoid this problem, just `free`s the memory when the new size is zero. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2023-03-24YJIT: Rest and block_arg support (#7584)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-24Adjust SHAPE_BUFFER_SIZE with shape_id_tNobuyoshi Nakada
On platforms where `shape_id_t` is 16-bits, 0x80000 is out of range of this type. ``` ../src/shape.c: In function ‘shape_alloc’: ../src/shape.c:129:18: warning: comparison is always false due to limited range of data type [-Wtype-limits] 129 | if (shape_id == MAX_SHAPE_ID) { | ^~ ```
2023-03-24Raise ArgumentError if IO.read is provided negative offsetJeremy Evans
Fixes [Bug #19380] Notes: Merged: https://github.com/ruby/ruby/pull/7289
2023-03-24Add Dir.for_fdJeremy Evans
This returns a Dir instance for the given directory file descriptor. If fdopendir is not supported, this raises NotImplementedError. Implements [Feature #19347] Notes: Merged: https://github.com/ruby/ruby/pull/7135
2023-03-24Add Dir#chdirJeremy Evans
This uses Dir.fchdir if supported, or Dir.chdir otherwise. Implements [Feature #19347] Notes: Merged: https://github.com/ruby/ruby/pull/7135
2023-03-24Add Dir.fchdirJeremy Evans
This is useful for passing directory file descriptors over UNIX sockets or to child processes to avoid TOCTOU vulnerabilities. The implementation follows the Dir.chdir code. This will raise NotImplementedError on platforms not supporting both fchdir and dirfd. Implements [Feature #19347] Notes: Merged: https://github.com/ruby/ruby/pull/7135
2023-03-24Change Hash#compact to keep default values and compare_by_identity flagJeremy Evans
The documentation states it returns a copy of self with nil value entries removed. However, the previous behavior was creating a plain new hash with non-nil values copied into it. This change aligns the behavior with the documentation. Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-24Copy compare_by_identity flag for empty hashes in Hash.ruby2_keywords_hashJeremy Evans
This was already copied for non-empty hashes. As Hash.ruby2_keywords_hash copies default values, it should also copy the compare_by_identity flag. Partially Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-24Do not copy compare_by_identity flag for non-empty hashes in Hash.[]Jeremy Evans
It wasn't copied for empty hashes, and Hash.[] doesn't copy the default value, so copying the compare_by_identity flag does not make sense. Partially Fixes [Bug #19113] Notes: Merged: https://github.com/ruby/ruby/pull/6702
2023-03-24YJIT: Constify EC to avoid an `as` pointer cast (#7591)Alan Wu
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-24[rubygems/rubygems] remove test skips/pends on mswin platformMSP-Greg
https://github.com/rubygems/rubygems/commit/1d52eff8bf
2023-03-24Write keyword arguments directlyNobuyoshi Nakada
`assert_normal_exit` uses keyword arguments since 2013, commit 05dd6b194cc29961a7cecfd5c3852f06dd56a871. Notes: Merged: https://github.com/ruby/ruby/pull/7589
2023-03-24Cache pid itself instead of converted VALUENobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7585
2023-03-24Added sync tools for test libraries like core_assertions.rb to default gems ↵Hiroshi SHIBATA
repositories
2023-03-23YJIT: Save PC on rb_str_concat (#7586)Takashi Kokubun
[Bug #19483] Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-03-23YJIT: Use starting context for status === CantCompile (#7583)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-24Fix ENABLE_MULTIARCHNobuyoshi Nakada
This macro is used in `ruby_init_loadpath()`, but was removed mistakenly at 31f4b2d86bfbc753cec9be376719acc4b120e944.
2023-03-23Use shape information in YJIT's definedivar implementation (#7579)Ole Friis Østergaard
* Use shape information in YJIT's definedivar implementation * Handle complex shape for definedivar Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-23Suppress -Wsign-compare warningNobuyoshi Nakada
2023-03-23[ruby/time] Update required ruby versionNobuyoshi Nakada
`Regexp#match?` which is introduced at ruby 2.4 is used since https://github.com/ruby/time/pull/1852. https://github.com/ruby/time/commit/b0a965dcaa
2023-03-23thread_pthread.c: Use a `fork_gen` to protect against fork instead of getpid()Jean Boussier
[Feature #19443] Until recently most libc would cache `getpid()` so this was a cheap check to make. However as of glibc version 2.25 the PID cache is removed and calls to getpid() always invoke the actual system call which significantly degrades the performance of existing applications. The reason glibc removed the cache is that some libraries were bypassing fork(2) by issuing system calls themselves, causing stale cache issues. That isn't a concern for Ruby as bypassing MRI's primitive for forking would render the VM unusable, so we can safely cache the PID. Notes: Merged: https://github.com/ruby/ruby/pull/7434
2023-03-23Don't suggest `--full-index` on API Response mismatch errorsDavid Rodríguez
I've never seen this error in real life, and if it was happening, I think it's either some server side issue that would need to be fixed or some transient issue. We should move away from the full index, since it's slow, so let's stop recommending it. Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Don't suggest retrying with `--full-index` on gemspec errorsDavid Rodríguez
We're actually already using the full index here, so it makes no sense to suggest retrying the same thing. Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Fix logging the fallback to the full index on GemspecError'sDavid Rodríguez
The debug message suggests retrying using `--full-index`, but the retry is happening automatically. Just log that we are falling back to the full index, like we do with other errors. Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Avoid intermediate array in TarHeader#calculate_checksumMau Magnaguagno
String#sum(0) sums the character bytes without a modulo. Follow-up of #6476 based on comment from @nobu. Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Fix flaky when making materialized specs uniqDavid Rodríguez
Sometimes we'll have an heterogenous array of specs which include `Gem::Specification` objects, which don't define `#identifier`. Let's use `#full_name` consistently. Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Skip test_gem_with_platform_and_platform_dependencies only ruby/ruby repositoryHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Refactor and fix usage of Gem.rubyなつき
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Move duplicated logic to parent classなつき
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Make sure native extensions are loaded correctly in ext_conf builderなつき
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Make sure native extensions are loaded correctly in rake builderなつき
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Reuse `SpecSet#materialize` logicDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Refactor incomplete specs handlingDavid Rodríguez
Recent bugs fixed made me realize we were relying on state too much here. We only need to keep incomplete specs to be able to expire them and retry resolution without them locked. If we use a separate class, we can do that more transparently and handle them just like we handle "missing specs". Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Don't remove RUBY platform when healing a lockfile with missing specsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23Don't remove RUBY platform when healing a lockfile with missing specsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23util/rubocop -A --only Style/AsciiCommentsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23util/rubocop -A --only Layout/EmptyLineAfterMagicCommentHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23util/rubocop -A --only Style/FrozenStringLiteralCommentHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23util/rubocop -A --only Lint/NonLocalExitFromIteratorHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] Enabled Style/RedundantReturn copHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/05cc97bdf8 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only ↵Hiroshi SHIBATA
Lint/BinaryOperatorWithIdenticalOperands Many of class of RubyGems have original <=> methods. We should ignore these cops for testing. https://github.com/rubygems/rubygems/commit/0a8645dc3b Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Lint/VoidHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/9d25906e44 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Lint/RequireParenthesesHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/ee6814afbc Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Style/NextHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/e5868e92f7 Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Style/MultilineMemoizationHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/c1f6e4a97b Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Style/MultilineTernaryOperatorHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/be853dfe3b Notes: Merged: https://github.com/ruby/ruby/pull/7582
2023-03-23[rubygems/rubygems] util/rubocop -A --only Lint/ShadowingOuterLocalVariableHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/82ed77178d Notes: Merged: https://github.com/ruby/ruby/pull/7582