Commit graph

64552 commits

Author SHA1 Message Date
Aaron Patterson
85e9cc2c87
Unpoison THEAP header before reading
Another ASAN fix.  THEAP header is poisoned, so we need to un-poison
before reading
2020-09-28 10:18:15 -07:00
Burdette Lamar
0555bd8435
Enhanced RDoc for String#succ! (#3596)
* Enhanced RDoc for String#succ!
2020-09-28 11:58:39 -05:00
Aaron Patterson
d598654c74
Fix ASAN and don't check SPECIAL_CONST_P
Heap allocated objects are never special constants.  Since we're walking
the heap, we know none of these objects can be special.  Also, adding
the object to the freelist will poison the object, so we can't check
that the type is T_NONE after poison.
2020-09-28 09:45:04 -07:00
Aaron Patterson
664eeda66e
Fix ASAN errors when updating call cache
Invalidating call cache walks the heap, so we need to take care to
un-poison objects when examining them
2020-09-28 09:45:04 -07:00
Aaron Patterson
0767d387ec
Pass ASAN options to child environments
I want to work with ASAN, but some child environments are not inheriting
the ASAN options I'm using.  This commit passes them to child
environments if specified
2020-09-28 09:45:04 -07:00
Jeremy Evans
346301e232 Add rb_category_warn{,ing} for warning messages with categories
This adds the following C-API functions that can be used to emit
warnings with categories included:

```c
void rb_category_warn(const char *, const char*, ...)
void rb_category_warning(const char*, const char*, ...)
```

Internally in error.c, there is an rb_warn_category function
that will call Warning.warn with the string and the category
keyword if it doesn't have an arity of 1, and will call
Warning.warn with just the string if it has an arity of 1.
This refactors the rb_warn_deprecated{,_to_remove} functions
to use rb_warn_category.

This makes Kernel#warn accept a category keyword and pass it
to Warning.warn, so that Ruby methods can more easily emit
warnings with categories.  rb_warn_category makes sure that
the passed category is a already defined category symbol
before calling Warning.warn.

The only currently defined warning category is :deprecated,
since that is what is already used.  More categories can be
added in later commits.
2020-09-28 08:38:06 -07:00
Jeremy Evans
92c3ad9c27 Make Warning.warn accept only category keyword
In general accepting arbitrary keywords is a bad idea unless you are
delegating keywords or acting on arbitrary keywords.  In this case,
the category keyword is ignored, and it's less error prone to not
ignore all keywords.
2020-09-28 08:38:06 -07:00
Jeremy Evans
5d7953f86b Switch conflicting chdir warning to RuntimeError
The documentation already stated this was an error in one case
(when it was previously a warning).  Describe the other case,
where chdir without block is called inside block passed to chdir.

Fixes [Bug #15661]
2020-09-28 08:34:04 -07:00
git
0164ac70a1 * 2020-09-29 [ci skip] 2020-09-29 00:20:47 +09:00
Aaron Patterson
0b0e2d88ce Refactor common heap iteration code
We have code common to all heap iteration paths in this file.  Refactor
such that we keep ASAN checks and flags checks in one place
2020-09-28 08:20:23 -07:00
Aaron Patterson
b9488accf9 Fix ASAN support when invalidating CCs
Again, this code is walking the heap.  Empty slots can be poisoned, so
we need to unpoison before checking the type
2020-09-28 08:20:23 -07:00
Aaron Patterson
b328b83026 make ext/coverage ASAN friendly 2020-09-28 08:20:23 -07:00
Aaron Patterson
18b3f0f54c Make ext/objspace ASAN friendly
ext/objspace iterates over the heap, but some slots in the heap are
poisoned, so we need to take care of that when running with ASAN
2020-09-28 08:20:23 -07:00
Kazuhiro NISHIYAMA
ac414139ec
Remove unnecessary executable bit [ci skip] 2020-09-28 23:07:43 +09:00
Hiroshi SHIBATA
4de32b3556
Removed unused option on racc 2020-09-28 18:53:25 +09:00
Hiroshi SHIBATA
87726143ef
Fixed the wrong variable for --executable flag 2020-09-28 18:53:25 +09:00
Benoit Daloze
f2c6a3513f Clarify spec description for Hash#{each,each_pair} 2020-09-28 11:29:15 +02:00
Marc-Andre Lafortune
245ed57ddc
[ruby/racc] Turn debugging off
872f75cfa7
2020-09-28 18:08:51 +09:00
Marc-Andre Lafortune
97d1a381e1
[Fixes #137] Improve reporting 2020-09-28 18:07:24 +09:00
Hiroshi SHIBATA
3da3c2747f
fixup d6a94a0c4b 2020-09-28 17:55:08 +09:00
Hiroshi SHIBATA
d6a94a0c4b
Removed useless RCS revisions 2020-09-28 17:39:59 +09:00
Steven Peckins
8863bfb1f4 [rubygems/rubygems] Move comment below shebang in bin/console template
In an executable script, the shebang line should be the first line (the
file needs to start with the bytes 0x23 0x21).  Putting a comment above
it will break the script.

(Regression test included per @deivid-rodriguez)

962e669feb
2020-09-28 14:54:22 +09:00
Nobuyoshi Nakada
18c642da86 [rubygems/rubygems] Fix ls-files matching regexp
As splitting by NUL means to allow the file names to contain
newlines, path names should match at beginning-of-string instead
of beginning-of-line.

8a81183236
2020-09-28 14:54:22 +09:00
xndcn
ac3f80a58e [rubygems/rubygems] Add writable check for cache dir
Sometimes "install_dir/cache" directory is not writable although "install_dir" is writable.

665221cb69
2020-09-28 14:54:22 +09:00
Yusuke Endoh
c55b5f1062 [rubygems/rubygems] Avoid duplicated generation of APISpecification objects
As far as I could see, `Gem::Resolver::APISpecification` objects are
supposed to be immutable.  If my guessing is correct, then we can cache
and reuse its instances for performance.
At least, `rake` passes on my machine.

Before this change:

```
$ time ruby -I lib bin/gem install --no-doc aws-sdk
Successfully installed aws-sdk-3.0.1
1 gem installed
real    0m37.104s
user    0m36.952s
sys     0m0.333s
```

After this change:

```
$ time ruby -I lib bin/gem install --no-doc aws-sdk
Successfully installed aws-sdk-3.0.1
1 gem installed
real    0m23.905s
user    0m23.740s
sys     0m0.365s
```

7e8fbba85c
2020-09-28 14:54:22 +09:00
Jean Boussier
91865230cd [rubygems/rubygems] Eval defaults with frozen_string_literal: true
d498ae3d62
2020-09-28 14:54:22 +09:00
Ellen Marie Dash
9bbca93aa8 [rubygems/rubygems] Remove last remaining line of output from gem update --system --silent
038203aaf8
2020-09-28 14:54:22 +09:00
Ellen Marie Dash
e8274a7683 [rubygems/rubygems] Add test for "gem update --system --silent"
c3fb0db930
2020-09-28 14:54:22 +09:00
Ellen Marie Dash
7fc8f83edb [rubygems/rubygems] Have "gem update --system" pass through the --silent flag.
5a1e56e892
2020-09-28 14:54:22 +09:00
Hiroshi SHIBATA
ab5e9516b7 [rubygems/rubygems] Added Ruby version for oldest supported version of rubygems
dd87d70f51
2020-09-28 14:54:22 +09:00
David Rodríguez
c6bdf75049 Disallow downgrades to too old versions
Consider the version original included with each ruby as the minimum
supported version.
2020-09-28 14:54:22 +09:00
bronzdoc
828cefd629 [rubygems/rubygems] Add --dryrun to the deprecated options when showing the help message
38230a77c1
2020-09-28 14:54:22 +09:00
bronzdoc
777840a16a [rubygems/rubygems] We don't need shortucts for a deprecated flag
087a1f9720
2020-09-28 14:54:22 +09:00
bronzdoc
be980dd9fa [rubygems/rubygems] Deprecate --dryrun
1715610648
2020-09-28 14:54:22 +09:00
bronzdoc
b83787b1ce [rubygems/rubygems] Make --dry-run flag consistent across rubygems commands
addc644cad
2020-09-28 14:54:22 +09:00
Nobuyoshi Nakada
0629e695e3 Added --platform option to build command 2020-09-28 14:54:22 +09:00
Nobuyoshi Nakada
67ae1d441d
Do not use clang on cygwin
Its `__has_declspec_attribute()` is not reliable.  For instance,
while `__has_declspec_attribute(noalias)` is true but 'noalias'
attribute is warned as unknown.
2020-09-28 13:42:04 +09:00
Nobuyoshi Nakada
36d1bb720c
sprintf.c: Removed conflicting definition 2020-09-28 12:51:53 +09:00
Nobuyoshi Nakada
ee7c260b60
thread_win32.c: native_mutex_trylock is not used right now 2020-09-28 12:51:20 +09:00
git
1c95436693 * 2020-09-28 [ci skip] 2020-09-28 04:33:14 +09:00
Benoit Daloze
41eba95920 Revert the first diff of "Use Tempfile.create instead of Tempfile.open in test_io.rb"
* This partially reverts commit dead747874.
* Windows will not allow a file to be unlinked if any file handles exist,
  see https://github.com/ruby/ruby/pull/3597
2020-09-27 21:32:26 +02:00
Kazuhiro NISHIYAMA
9a951c0931
Remove outdated comment [ci skip] 2020-09-27 14:26:38 +09:00
Koichi Sasada
5e91b4bdb3 fix typo [ci skip] 2020-09-27 09:49:16 +09:00
Yusuke Endoh
950614b088 ext/socket/ipsocket.c: prevent "warning: unused variable 'resolv_timeout'" 2020-09-27 02:38:39 +09:00
Kazuhiro NISHIYAMA
70d7e4c3f0
Fix a typo [ci skip] 2020-09-27 01:16:42 +09:00
Kazuhiro NISHIYAMA
48b5319006
Add links to the tickets [ci skip] 2020-09-27 01:13:52 +09:00
git
089b7698ba * 2020-09-27 [ci skip] 2020-09-27 01:02:22 +09:00
bogdanvlviv
cdb5258bec Fix ENV.except's docs 2020-09-26 12:02:00 -04:00
Benoit Daloze
dead747874 Use Tempfile.create instead of Tempfile.open in test_io.rb 2020-09-26 12:36:31 +02:00
NARUSE, Yui
4e31cbc070 update-deps
1169621878
2020-09-26 18:55:00 +09:00