1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

70037 commits

Author SHA1 Message Date
Nobuyoshi Nakada
5ce3272e51
autogen.sh: Copy auxiliary files instead of symlinks with -i
When accessing from containers, symbolic links may not be able to
reach outer file systems.
2021-12-06 17:53:37 +09:00
Colby Swandale
9c0c66f721 [rubygems/rubygems] add login & logout for the signin & signout commands respectively
https://github.com/rubygems/rubygems/commit/49b491970b
2021-12-06 17:42:56 +09:00
Nobuyoshi Nakada
e563c6068e
sync_default_gems.rb: convert commit hashes to github URLs [ci skip] 2021-12-06 14:18:01 +09:00
Shugo Maeda
c2192cb985
Clarify the error message when trying to import C methods [Bug ] 2021-12-06 09:40:54 +09:00
David Rodríguez
e713552868 [rubygems/rubygems] LOAD_PATH is already reset globally
https://github.com/rubygems/rubygems/commit/b0bbb27115
2021-12-06 05:25:22 +09:00
David Rodríguez
2fc47bad78 [rubygems/rubygems] Remove unneded setup
https://github.com/rubygems/rubygems/commit/9815a04e31
2021-12-06 05:25:21 +09:00
Alan Wu
a785e6c356 Make leaf const in VM generator
Assigning to `leaf` in insns.def would give undesirable results.
2021-12-05 11:06:05 -05:00
git
26e4887eed * 2021-12-06 [ci skip] 2021-12-06 00:26:51 +09:00
Alan Wu
26063d3954 YJIT: Initialize code buffer with PUSH DS
PUSH DS triggers the #UD processor exception in 64-bit mode, which the
OS translates to a SIGILL. Unlike INT3, this triggers the usual crash
reporter, which makes failures easier to notice. When there is a
debugger attached, the PUSH DS pauses execution just like INT3.
2021-12-05 10:26:35 -05:00
Nobuyoshi Nakada
bbfefd45c6
[ruby/securerandom] Remove no longer used helper methods
Unused since r59801, 782b2050b8,
or https://github.com/ruby/securerandom/commit/52c8e7a85e017f.

https://github.com/ruby/securerandom/commit/38fc2c4427
2021-12-05 23:13:23 +09:00
Kazuhiro NISHIYAMA
00a941ac4b
Update stdlib versions [ci skip] 2021-12-05 20:34:25 +09:00
Kazuhiro NISHIYAMA
20dfc7621c
Sort URLs by issue numbers [ci skip] 2021-12-05 20:31:58 +09:00
Nobuyoshi Nakada
19f037e452
More indentation in NEWS.md [ci skip]
The current Markdown implementation of RDoc requires list contents
to be indented 4 columns except for the first paragraph.
Maybe fixed as other implementations in the future.
2021-12-05 19:23:42 +09:00
Junichi Ito
e818193784 Fix wrong indentation in NEWS.md [ci skip] 2021-12-05 19:07:06 +09:00
Nobuyoshi Nakada
b555e659c4
Do not use fcopyfile if appending to non-empty file [Bug ]
`fcopyfile` appends `src` to `to` and then truncates `to` to it's
original size.
2021-12-05 18:47:02 +09:00
David Rodríguez
a72aecac3a [rubygems/rubygems] Don't write outside of destdir when regenerating plugins
https://github.com/rubygems/rubygems/commit/141ef4cb9a
2021-12-05 05:47:46 +09:00
David Rodríguez
9dc76e102e [rubygems/rubygems] Don't write outside of destdir when installing default bundler
https://github.com/rubygems/rubygems/commit/a62d00c5e8
2021-12-05 05:47:45 +09:00
David Rodríguez
ec28771fde [rubygems/rubygems] Fold a line that got out of hand
https://github.com/rubygems/rubygems/commit/49317d8beb
2021-12-05 05:47:45 +09:00
David Rodríguez
ed7a50015a [rubygems/rubygems] Fix binstubs and plugins regeneration with --destdir is used
https://github.com/rubygems/rubygems/commit/7079de16fa
2021-12-05 05:47:44 +09:00
Alan Wu
62957debd5 README.md: Fix link to platform maintainers list
Follow up for 6bca410ae8
[ci skip]
2021-12-04 13:04:57 -05:00
git
9733b7e38f * 2021-12-05 [ci skip] 2021-12-05 01:35:56 +09:00
Alan Wu
34b5e2566d YJIT: Enable out of memory tests
As of [1] and [2], YJIT has enough support for out of memory conditions
to pass these two basic tests.

OOM code paths are prone to bugs since they are rarely exercised in
common workloads. We might want to add CI runs that stress test these
code paths. Maybe outside of GitHub Actions for capacity reasons.

[1]: f41b4d44f9
[2]: b5b6ab4194
2021-12-04 11:35:37 -05:00
Nobuyoshi Nakada
4a6ca12904
Remove unversioned phony target for pkgconfig file [Bug ]
It results in a circular dependency when `--with-ruby-pc=ruby.pc`
is given.  [ci skip]
2021-12-04 16:20:30 +09:00
Nobuyoshi Nakada
a4964174e2
Fix circular dependencies specific to in-place build [Bug ]
* Move the rubyspec running recipe after the rule for rubyspec
  C-API extension library, so that separate dummy recipe is not
  needed.

* Add a dummy recipe for rubyspec.h before the rubyspec running
  recipe, so that the dependency of extensions do not fire the
  latter.
2021-12-04 10:40:15 +09:00
Nobuyoshi Nakada
d118e7c025
Turn nd_type_p into an inline function 2021-12-04 10:35:44 +09:00
Alan Wu
f41b4d44f9 YJIT: Bounds check every byte in the assembler
Previously, YJIT assumed that basic blocks never consume more than
1 KiB of memory. This assumption does not hold for long Ruby methods
such as the one in the following:

```ruby
eval(<<RUBY)
def set_local_a_lot
  #{'_=0;'*0x40000}
end
RUBY

set_local_a_lot
```

For low `--yjit-exec-mem-size` values, one basic block could exhaust the
entire buffer.

Introduce a new field `codeblock_t::dropped_bytes` that the assembler
sets whenever it runs out of space. Check this field in
gen_single_block() to respond to out of memory situations and other
error conditions. This design avoids making the control flow graph of
existing code generation functions more complex.

Use POSIX shell in misc/test_yjit_asm.sh since bash is expanding
`0%/*/*` differently.

Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-12-03 20:02:25 -05:00
John Hawthorn
3be067234f
NEWS for [GH-#5146] [ci skip] () 2021-12-03 12:58:09 -08:00
David Rodríguez
c38c1d82b1 [rubygems/rubygems] Let original EACCES error be raised
This block of code already wraps file operations with
`SharedHelpers.filesystem_access`, which rescues and re-raises more
friendly errors. Also, I'm not fully sure creating a temporary directory
can end up raising an `Errno::EACCES` error from reading `tmpdir`
sources. Finally, this rescue block apparently leads to some false
positives when firewall is blocking the ruby executable on Windows, or
at least that's what we've got reported.

In any case, I think it's best to let the original error be raised.

https://github.com/rubygems/rubygems/commit/f7dbe54404
2021-12-04 05:18:11 +09:00
eileencodes
54ca530dbe YJIT: Add ivar counter exits
On Rails we're seeing a lot of exits for ivars in the Active Record
tests. In trying to track them down it was hard to find what code is
exiting.

This change adds a counted exit for when an object is "megamorphic". In
these cases there are too many specializations in the Ruby code so YJIT
exits.

Co-authored-by: Aaron Patterson tenderlove@ruby-lang.org
2021-12-03 09:45:58 -08:00
Burdette Lamar
7fc9d83bd1
Fix link () 2021-12-03 10:46:35 -06:00
Peter Zhu
081539023a Refactor GC functions to have consistent naming
Refactor function names for consistency. Function with name xyz_page
should have a corresponding function named xyz_plane.
2021-12-03 10:26:26 -05:00
git
81eadd976f * 2021-12-04 [ci skip] 2021-12-04 00:01:42 +09:00
S.H
ec7f14d9fa
Add nd_type_p macro 2021-12-04 00:01:24 +09:00
Burdette Lamar
28fb6d6b9e
Adding links to literals and Kernel ()
* Adding links to literals and Kernel
2021-12-03 07:12:28 -06:00
Jean Boussier
324d57df0b TestClass#test_subclass_gc reduce the number of iteration by 10x
The test was taking 10 seconds on my machine and did timeout
on CI once.
2021-12-03 20:27:29 +09:00
David Rodríguez
0073f624f0 [rubygems/rubygems] Don't unnecessarily loop twice through dependencies
https://github.com/rubygems/rubygems/commit/06b4a7994d
2021-12-03 20:00:51 +09:00
David Rodríguez
4c5e862434 [rubygems/rubygems] Improve source gemfile/lockfile equivalence checks
Since we no longer have multiple global sources, each top level dependency is
always pinned to a single source, so it makes little sense to talk about
adding or removing a source. Instead, source changes always mean to
change the source one or more dependencies are pinned to. This logic can
now be much simpler.

https://github.com/rubygems/rubygems/commit/f1d33fa0df
2021-12-03 20:00:51 +09:00
David Rodríguez
248fae0ec4 [rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.

This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.

https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-12-03 20:00:50 +09:00
David Rodríguez
7d974cc56f [rubygems/rubygems] Don't overwrite locked dependency sources too early
Otherwise we hide some useful message about dependency source changes.

https://github.com/rubygems/rubygems/commit/c926673c5b
2021-12-03 20:00:50 +09:00
David Rodríguez
aa87780f8f [rubygems/rubygems] Fix incorrect order in changed sources message
https://github.com/rubygems/rubygems/commit/6f1b5f68de
2021-12-03 20:00:49 +09:00
David Rodríguez
ca65f7bb8a [rubygems/rubygems] Remove unnecessary code
Somehow this is trying to relax frozen mode constraints for path
sources. It doesn't make sense to me and it's not covered by any spec so
I'm killing it.

https://github.com/rubygems/rubygems/commit/17c978e161
2021-12-03 20:00:49 +09:00
David Rodríguez
d19c266b49 [rubygems/rubygems] Reuse locked_dependencies helper
It makes the code more consistent with the above line.

https://github.com/rubygems/rubygems/commit/f28d05a548
2021-12-03 20:00:48 +09:00
David Rodríguez
901a257533 [rubygems/rubygems] Reformat for consistency with the above line
https://github.com/rubygems/rubygems/commit/11193be3f1
2021-12-03 20:00:47 +09:00
David Rodríguez
906b95780f [rubygems/rubygems] Remove unnecessary nil checks
https://github.com/rubygems/rubygems/commit/d047b8935d
2021-12-03 20:00:47 +09:00
Nobuyoshi Nakada
e4c7c5468e
Add tests of string argument to Time.at 2021-12-03 18:35:35 +09:00
git
dd6c59cdaf Update bundled_gems at 2021-12-03 2021-12-03 07:00:45 +00:00
Nobuyoshi Nakada
433a5a0eb0
[DOC] Fix Time.new description [ci skip] 2021-12-03 13:17:38 +09:00
John Hawthorn
733500e9d0
Lazily create singletons on instance_{exec,eval} ()
* Lazily create singletons on instance_{exec,eval}

Previously when instance_exec or instance_eval was called on an object,
that object would be given a singleton class so that method
definitions inside the block would be added to the object rather than
its class.

This commit aims to improve performance by delaying the creation of the
singleton class unless/until one is needed for method definition. Most
of the time instance_eval is used without any method definition.

This was implemented by adding a flag to the cref indicating that it
represents a singleton of the object rather than a class itself. In this
case CREF_CLASS returns the object's existing class, but in cases that
we are defining a method (either via definemethod or
VM_SPECIAL_OBJECT_CBASE which is used for undef and alias).

This also happens to fix what I believe is a bug. Previously
instance_eval behaved differently with regards to constant access for
true/false/nil than for all other objects. I don't think this was
intentional.

    String::Foo = "foo"
    "".instance_eval("Foo")   # => "foo"
    Integer::Foo = "foo"
    123.instance_eval("Foo")  # => "foo"
    TrueClass::Foo = "foo"
    true.instance_eval("Foo") # NameError: uninitialized constant Foo

This also slightly changes the error message when trying to define a method
through instance_eval on an object which can't have a singleton class.

Before:

    $ ruby -e '123.instance_eval { def foo; end }'
    -e:1:in `block in <main>': no class/module to add method (TypeError)

After:

    $ ./ruby -e '123.instance_eval { def foo; end }'
    -e:1:in `block in <main>': can't define singleton (TypeError)

IMO this error is a small improvement on the original and better matches
the (both old and new) message when definging a method using `def self.`

    $ ruby -e '123.instance_eval{ def self.foo; end }'
    -e:1:in `block in <main>': can't define singleton (TypeError)

Co-authored-by: Matthew Draper <matthew@trebex.net>

* Remove "under" argument from yield_under

* Move CREF_SINGLETON_SET into vm_cref_new

* Simplify vm_get_const_base

* Fix leaf VM_SPECIAL_OBJECT_CONST_BASE

Co-authored-by: Matthew Draper <matthew@trebex.net>
2021-12-02 15:53:39 -08:00
Josef Šimánek
1f4af99383 [rubygems/rubygems] Move required_ruby_version gemspec attribute to recommended section.
https://github.com/rubygems/rubygems/commit/de6552ac30
2021-12-03 06:01:18 +09:00
Peter Zhu
9f0c6f20c5 [Bug ] Fix crash in compaction for ObjectSpace.trace_object_allocations
ObjectSpace.trace_object_allocations can crash when auto-compaction is
enabled.
2021-12-02 13:06:44 -05:00