370 Commits

Author SHA1 Message Date
nagachika
04fab1dfd9 merge revision(s) bb849ffdb18305f01457de4e9848c830eb83a2d7:
Added explicitly begin-end block for Ruby 2.4.

	  strscan, ipaddr and some default gems still support Ruby 2.4.

	  After this, I extract this CoreAssertions to their repositories.
2024-08-31 19:09:13 +09:00
nagachika
f095a085a4 merge revision(s) 8a7e6f6852740e989ef8f679db5631306466a4ed:
Improve base time of assert_linear_performance (#11369)

	Remove `.ceil` from base time calculation that makes 10x gap.
	This will make the assertion more strict and also less flaky.
2024-08-31 18:51:41 +09:00
nagachika
f4847607ee merge revision(s) f1c78b23313e63eb31a213cc7277b1eb206a581b:
Suppress warning for shadowing outer local variable
2024-08-31 18:49:58 +09:00
nagachika
b5bb0ee64b merge revision(s) d23964360335ad561f252cb6fe8e90df7ebee90e:
core_assertions.rb: Support old rubies

	Some symbol argument might not be accepted by Process.clock_gettime.
2024-08-31 18:49:27 +09:00
nagachika
bec6da392d merge revision(s) 533423ebe46ebfe3005198c12aa0d2c899c695ea:
core_assertions.rb: Prefer CPU time clocks

	To prevent influence from other processes.
2024-08-31 18:49:12 +09:00
nagachika
7c2cdca7f2 merge revision(s) f9eb2515a3221cced611b4de971b72a78a7a566f:
core_assertions.rb: Extract common code block
2024-08-31 18:48:57 +09:00
nagachika
07d7ffeb9c merge revision(s) 3fe134759cc4904c74306e0832c22fa518a5bea2:
Skip assert_linear_performance for RJIT
2024-08-31 18:48:17 +09:00
nagachika
00fada3890 merge revision(s) f07c756494b0e473ff8e4ece6f04c7ababe93b01:
core_assertions.rb: Tweak timeout limit

	Increase the timeout limit when variance at rehearsal is small.
2024-08-31 18:45:29 +09:00
Hiroshi SHIBATA
16f795b5e9 Reapply "merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]"
This reverts commit 367ad5055c3d5210c884d4611e08ffa32ec608ee.
2024-08-06 18:59:52 +09:00
nagachika
367ad5055c Revert "merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]"
This reverts commit 56c311aa0b20dee13ab43309ae3386f57f8cb797.
2024-07-26 20:53:32 +09:00
nagachika
56c311aa0b merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]
Clear runtime dependencies if default gems is specified.

	The current build system uses runtime dependencies from only
	`.bundle` directory. We shouldn't install runtime dependencies
	from rubygems.org when `make test-bundled-gems` is invoked.

	Fixed dependencies list format

	Re-use strscan with ruby repo
2024-06-18 22:50:39 +09:00
nagachika
c48b2312ac Revert "merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]"
This reverts commit 0de1ff12973ffc04bc9a8b0799e963922986d1eb.
2024-06-03 12:22:25 +09:00
nagachika
0de1ff1297 merge revision(s) 9f708d48f6df37ee9600db9d51b57a156609a13b,0301473fb523c71d8cdc4966971f31f502001185,7f0e26b7f99bf76408569892ce20318501f74729: [Backport #20516]
Clear runtime dependencies if default gems is specified.

	The current build system uses runtime dependencies from only
	`.bundle` directory. We shouldn't install runtime dependencies
	from rubygems.org when `make test-bundled-gems` is invoked.

	Fixed dependencies list format

	Re-use strscan with ruby repo
2024-06-02 07:13:25 +09:00
nagachika
9d8d0585ec merge revision(s) f6adc5be94a9f70a5b9897b81dabdeb49b573393,bccdc041665032b819fab1c04ed4dbdfeeeb366b: [Backport #19582]
Check if Bundler is defined

	---
	 tool/lib/leakchecker.rb | 2 +-
	 1 file changed, 1 insertion(+), 1 deletion(-)

	Check if `Bundler::EnvironmentPreserver` is defined

	Only `Bundler` might be defined.  `EnvironmentPreserver` and its
	`BUNDLER_PREFIX` would be defined together in the same file.
	---
	 tool/lib/leakchecker.rb | 5 ++++-
	 1 file changed, 4 insertions(+), 1 deletion(-)
2023-07-17 09:54:51 +09:00
Hiroshi SHIBATA
f8c775cb41
Use URI-0.12.1 for Ruby 3.2 (#7603)
* Merge URI-0.12.1

* Use URI-0.12.1

* Update core_assertions for using assert_linear_performance
2023-03-28 11:36:36 +00:00
Nobuyoshi Nakada
3cbe37bd35
Support new style diagnostic reports 2022-12-25 00:43:27 +09:00
Samuel Williams
d20bd06a97
Remove require 'io/wait' where it's no longer necessary. (#6932)
* Remove `require 'io/wait'` as it's part of core now.

* Update ruby specs using version gates.

* Add note about why it's conditional.
2022-12-15 11:37:01 +13:00
Takashi Kokubun
3262842e0a
Skip calling f.read for overwrite: true-only cases
We only need to set outpath for that case.
2022-12-13 00:25:02 -08:00
Takashi Kokubun
5ba9dcff16
Make sure f.read is not called twice
--revision.h and --if-change are not used simultaneously, but they might
be in the future.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-12-13 00:17:47 -08:00
Takashi Kokubun
7edcdc380f
Avoid overwriting revision.h when .git doesn't exist (#6915)
* Avoid overwriting revision.h when .git doesn't exist

* Overwrite revision.h if it's blank
2022-12-12 23:34:30 -08:00
Nobuyoshi Nakada
e809bd31fd
Fix positional argument color [ci skip] 2022-12-12 23:32:37 +09:00
Nobuyoshi Nakada
d752cf7601 Use class methods of File over Kernel.open and IO.read 2022-12-01 02:28:49 +09:00
Nobuyoshi Nakada
70c9d5b504
Try to overwrite the file in VPATH if possible 2022-11-13 18:05:11 +09:00
Nobuyoshi Nakada
ab01b8f23f
jobserver option may not be at the last 2022-11-07 10:08:09 +09:00
Nobuyoshi Nakada
180d37c817
Set autoclose: for inherited FDs only [ci skip] 2022-11-07 09:06:15 +09:00
Nobuyoshi Nakada
12883f8fa6
GNU make 4.4 now uses a fifo for the jobserver 2022-11-06 23:39:55 +09:00
Peter Zhu
6d83590157 Don't report changed ENV caused by Bundler
Bundler's backups changes environment variables starting with
BUNDLER_ORIG_. This causes a lot of noise in tests as the leakchecker
reports them as changed.
2022-11-04 15:36:30 -04:00
Peter Zhu
b777408c33 Fix crash in test runner on timeout
When a test worker hangs and timeouts, the test runner crashes with the
following stack trace:

ruby/tool/lib/test/unit.rb:1747:in `puke': undefined method `backtrace' for Timeout::Error:Class (NoMethodError)
	from ruby/tool/lib/test/unit.rb:790:in `block in _run_parallel'
	from ruby/tool/lib/test/unit.rb:788:in `each'

This commit adds handling for Timeout::Error and outputs a message.
2022-11-02 13:34:02 -04:00
Nobuyoshi Nakada
3475b66160
file2lastrev.rb: try to overwrite the found revision.h as before 2022-11-02 12:38:31 +09:00
Nobuyoshi Nakada
ac06951c31
file2lastrev.rb: separate options for Output and VPath
So the `--srcdir` option in this file can override the same option in
`VPath`.
2022-11-02 12:38:03 +09:00
Nobuyoshi Nakada
a2e7b11f2a
output.rb: extract from generic_erb.rb
- writing to a file or stdout
- touching timestamp files
- overwriting only if changed
- colorizing
2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada
99a79dc40b
colorize.rb: support for NO_COLOR 2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada
f0c8c1e878
vpath.rb: tweak --vpath option message 2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada
aa8c6759ee
vcs.rb: do not reference the constant before assignment 2022-11-01 11:40:32 +09:00
Nobuyoshi Nakada
00d5b7ce7c vcs.rb: copy safe directory configuration
Now revision.tmp will be regenerated always and every times, even if
the recent file exists in the source directory, as far as using git.
On the other hand, VirtualBox mounts shared folders as root, and git
rejects the repository there as dubious ownership.
2022-10-30 17:06:33 +09:00
Nobuyoshi Nakada
b64514f132 vcs.rb: prettify debug print 2022-10-30 17:06:33 +09:00
Nobuyoshi Nakada
ab31d2e69f
Add --zone option to VCS
Which controls the timezone offset for `RUBY_RELEASE_DATE`.
2022-09-30 10:39:43 +09:00
Nobuyoshi Nakada
5a5644dadc
Introduce VCS::Null for fallback 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
f70ba9cf80
Check for the availability of the command when detecting 2022-09-30 10:39:42 +09:00
Nobuyoshi Nakada
58b3a535cc
Pull up VCS.short_revision from VCS::SVN 2022-09-30 09:21:02 +09:00
Takashi Kokubun
922e61fcc2
Remove git command existence check again
With 33c6dd2cc89c27bbf406508ec39038a181fb99bc, it's no longer necessary.

This is what I got on openbsd-current:

```
-bash-5.1$ git -v
unknown option: -v
usage: git [--version] [--help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]
-bash-5.1$ git version
git version 2.35.1
```
2022-09-17 23:05:10 +09:00
Takashi Kokubun
33c6dd2cc8
Fallback to VCS.release_date on VCS::NotFoundError
when -q is given.

One of the RubyCI servers, freebsd12, had a broken git environment:

```
$ git show
fatal: detected dubious ownership in repository at '/usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby'
To add an exception for this directory, call:

        git config --global --add safe.directory /usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby
```

tool/lib/vcs.rb doesn't work normally for that server.
Even for such cases, we'd like to generate a usable revision.h.

So this patch lets revision.h fallback to default VCS.release_date
when VCS::NotFoundError is raised.
2022-09-17 22:24:10 +09:00
Takashi Kokubun
38a7a13ac6
Auto-generate the release date on version.h from git CommitDate (#6382)
* Auto-generate the release date on version.h

from git CommitDate

* Generate revision.h on mswin
2022-09-17 21:16:06 +09:00
Nobuyoshi Nakada
c28a4e0340
Replace "Fixes"/"Fixed" in commit logs as well as vcs.rb [ci skip]
Use the same regexp to replace "(#NNNN)" and "GH-NNNN" style
references in vcs.rb, too.
2022-09-14 11:24:06 +09:00
Benoit Daloze
92b907d12d Enable deprecation warnings for test-all
* So deprecated methods/constants/functions are dealt with early,
  instead of many tests breaking suddenly when removing a deprecated
  method/constant/function.
* Follows https://bugs.ruby-lang.org/issues/17591
2022-09-10 13:14:18 +02:00
Nobuyoshi Nakada
462a8be511
VCS#revision_header: Make arguments optional 2022-09-01 20:57:30 +09:00
Nobuyoshi Nakada
55b1600987
Update revision.h in packages using VCS#revision_header 2022-09-01 18:45:09 +09:00
Nobuyoshi Nakada
ee09f75a6b
Extract VCS#revision_header 2022-09-01 18:01:40 +09:00
Hiroshi SHIBATA
f229b36087
Fix test fail with assert_ractor outside of ruby/ruby repo
Revert 806583c093ecc2d67830f0a8f0d94decf0ed71e5
2022-09-01 16:15:51 +09:00
Nobuyoshi Nakada
d903e76726 Allow strings in assert_pattern_list 2022-08-19 01:28:31 +09:00