summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* IO::Buffer#resize: Free internal buffer if new size is zero (#7569)Kasumi Hanazuki2023-03-252-0/+23
| | | | | | | | | | `#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.
* YJIT: Rest and block_arg support (#7584)Jimmy Miller2023-03-243-9/+24
|
* Adjust SHAPE_BUFFER_SIZE with shape_id_tNobuyoshi Nakada2023-03-241-3/+3
| | | | | | | | | | | | 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) { | ^~ ```
* Raise ArgumentError if IO.read is provided negative offsetJeremy Evans2023-03-243-3/+19
| | | | Fixes [Bug #19380]
* Add Dir.for_fdJeremy Evans2023-03-243-0/+56
| | | | | | | This returns a Dir instance for the given directory file descriptor. If fdopendir is not supported, this raises NotImplementedError. Implements [Feature #19347]
* Add Dir#chdirJeremy Evans2023-03-243-4/+70
| | | | | | This uses Dir.fchdir if supported, or Dir.chdir otherwise. Implements [Feature #19347]
* Add Dir.fchdirJeremy Evans2023-03-244-0/+215
| | | | | | | | | | | | 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]
* Change Hash#compact to keep default values and compare_by_identity flagJeremy Evans2023-03-242-11/+29
| | | | | | | | | 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]
* Copy compare_by_identity flag for empty hashes in Hash.ruby2_keywords_hashJeremy Evans2023-03-242-3/+30
| | | | | | | 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]
* Do not copy compare_by_identity flag for non-empty hashes in Hash.[]Jeremy Evans2023-03-242-4/+34
| | | | | | | | 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]
* YJIT: Constify EC to avoid an `as` pointer cast (#7591)Alan Wu2023-03-243-3/+3
|
* [rubygems/rubygems] remove test skips/pends on mswin platformMSP-Greg2023-03-244-6/+6
| | | | https://github.com/rubygems/rubygems/commit/1d52eff8bf
* Write keyword arguments directlyNobuyoshi Nakada2023-03-241-2/+2
| | | | | `assert_normal_exit` uses keyword arguments since 2013, commit 05dd6b194cc29961a7cecfd5c3852f06dd56a871.
* Cache pid itself instead of converted VALUENobuyoshi Nakada2023-03-241-18/+6
|
* Added sync tools for test libraries like core_assertions.rb to default gems ↵Hiroshi SHIBATA2023-03-241-0/+51
| | | | repositories
* YJIT: Save PC on rb_str_concat (#7586)Takashi Kokubun2023-03-232-2/+23
| | | | | [Bug #19483] Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* YJIT: Use starting context for status === CantCompile (#7583)Jimmy Miller2023-03-232-3/+50
|
* Fix ENABLE_MULTIARCHNobuyoshi Nakada2023-03-241-0/+3
| | | | | This macro is used in `ruby_init_loadpath()`, but was removed mistakenly at 31f4b2d86bfbc753cec9be376719acc4b120e944.
* Use shape information in YJIT's definedivar implementation (#7579)Ole Friis Østergaard2023-03-232-19/+113
| | | | | * Use shape information in YJIT's definedivar implementation * Handle complex shape for definedivar
* Suppress -Wsign-compare warningNobuyoshi Nakada2023-03-231-1/+4
|
* [ruby/time] Update required ruby versionNobuyoshi Nakada2023-03-231-1/+1
| | | | | | `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
* thread_pthread.c: Use a `fork_gen` to protect against fork instead of getpid()Jean Boussier2023-03-232-45/+39
| | | | | | | | | | | | | | | [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.
* Don't suggest `--full-index` on API Response mismatch errorsDavid Rodríguez2023-03-233-3/+3
| | | | | | | 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.
* Don't suggest retrying with `--full-index` on gemspec errorsDavid Rodríguez2023-03-231-1/+1
| | | | | We're actually already using the full index here, so it makes no sense to suggest retrying the same thing.
* Fix logging the fallback to the full index on GemspecError'sDavid Rodríguez2023-03-232-15/+7
| | | | | | 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.
* Avoid intermediate array in TarHeader#calculate_checksumMau Magnaguagno2023-03-232-2/+2
| | | | | String#sum(0) sums the character bytes without a modulo. Follow-up of #6476 based on comment from @nobu.
* Fix flaky when making materialized specs uniqDavid Rodríguez2023-03-234-19/+7
| | | | | | 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.
* Skip test_gem_with_platform_and_platform_dependencies only ruby/ruby repositoryHiroshi SHIBATA2023-03-231-1/+1
|
* Refactor and fix usage of Gem.rubyなつき2023-03-233-8/+9
|
* Move duplicated logic to parent classなつき2023-03-233-26/+15
|
* Make sure native extensions are loaded correctly in ext_conf builderなつき2023-03-231-1/+15
|
* Make sure native extensions are loaded correctly in rake builderなつき2023-03-231-1/+13
|
* Reuse `SpecSet#materialize` logicDavid Rodríguez2023-03-231-5/+3
|
* Refactor incomplete specs handlingDavid Rodríguez2023-03-234-13/+39
| | | | | | | | 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".
* Don't remove RUBY platform when healing a lockfile with missing specsDavid Rodríguez2023-03-232-39/+55
|
* Don't remove RUBY platform when healing a lockfile with missing specsDavid Rodríguez2023-03-233-2/+8
|
* util/rubocop -A --only Style/AsciiCommentsHiroshi SHIBATA2023-03-236-12/+22
|
* util/rubocop -A --only Layout/EmptyLineAfterMagicCommentHiroshi SHIBATA2023-03-23290-0/+290
|
* util/rubocop -A --only Style/FrozenStringLiteralCommentHiroshi SHIBATA2023-03-2315-3/+18
|
* util/rubocop -A --only Lint/NonLocalExitFromIteratorHiroshi SHIBATA2023-03-232-2/+2
|
* [rubygems/rubygems] Enabled Style/RedundantReturn copHiroshi SHIBATA2023-03-2326-45/+43
| | | | https://github.com/rubygems/rubygems/commit/05cc97bdf8
* [rubygems/rubygems] util/rubocop -A --only ↵Hiroshi SHIBATA2023-03-239-13/+15
| | | | | | | | | Lint/BinaryOperatorWithIdenticalOperands Many of class of RubyGems have original <=> methods. We should ignore these cops for testing. https://github.com/rubygems/rubygems/commit/0a8645dc3b
* [rubygems/rubygems] util/rubocop -A --only Lint/VoidHiroshi SHIBATA2023-03-232-3/+0
| | | | https://github.com/rubygems/rubygems/commit/9d25906e44
* [rubygems/rubygems] util/rubocop -A --only Lint/RequireParenthesesHiroshi SHIBATA2023-03-231-1/+1
| | | | https://github.com/rubygems/rubygems/commit/ee6814afbc
* [rubygems/rubygems] util/rubocop -A --only Style/NextHiroshi SHIBATA2023-03-239-102/+88
| | | | https://github.com/rubygems/rubygems/commit/e5868e92f7
* [rubygems/rubygems] util/rubocop -A --only Style/MultilineMemoizationHiroshi SHIBATA2023-03-232-15/+13
| | | | https://github.com/rubygems/rubygems/commit/c1f6e4a97b
* [rubygems/rubygems] util/rubocop -A --only Style/MultilineTernaryOperatorHiroshi SHIBATA2023-03-233-6/+10
| | | | https://github.com/rubygems/rubygems/commit/be853dfe3b
* [rubygems/rubygems] util/rubocop -A --only Lint/ShadowingOuterLocalVariableHiroshi SHIBATA2023-03-232-5/+5
| | | | https://github.com/rubygems/rubygems/commit/82ed77178d
* [rubygems/rubygems] util/rubocop -A --only Lint/UnreachableCodeHiroshi SHIBATA2023-03-231-1/+0
| | | | https://github.com/rubygems/rubygems/commit/f06047f52a
* [rubygems/rubygems] util/rubocop -A --only Lint/UnderscorePrefixedVariableNameHiroshi SHIBATA2023-03-233-24/+24
| | | | https://github.com/rubygems/rubygems/commit/6dc4bc3a5b