Commit graph

512 commits

Author SHA1 Message Date
Nobuyoshi Nakada
849087ccb1
Apply zone offset to the last modified time 2023-02-13 15:12:14 +09:00
Nobuyoshi Nakada
17f5631c6e [Bug #19340] Fix bundle gems with test revision
Build temporary gem package from cloned repository if test revision is
set.
2023-01-26 12:50:39 +09:00
Hiroshi SHIBATA
ba45be3c43
Supressing warnings messages like:
Ignoring debug-1.7.1 because its extensions are not built. Try: gem pristine debug --version 1.7.

  Revert "Clear gem paths for each test"

  This reverts commit 6698b580dd.
2023-01-18 16:14:00 +09:00
Nobuyoshi Nakada
6698b580dd Clear gem paths for each test
So that rubygems can find the bundled rake.
2023-01-15 23:57:43 +09:00
Hiroshi SHIBATA
b496578758
Skip Test::Unit::AutoRunner logic in ruby/ruby repository 2023-01-05 08:16:24 +09:00
Hiroshi SHIBATA
1f2fef1f9a
[ruby/openssl] Stop AutoRunner with test-unit
0d4cd8b9ca
2023-01-05 08:06:49 +09:00
Koichi Sasada
c182d46d24 check NO_COLOR envval
Support `NO_COLOR` (https://no-color.org/) to make parsing output easy.
2022-12-26 23:06:35 +09: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 33c6dd2cc8, 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 806583c093
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
Nobuyoshi Nakada
5791171201
Load gemspec file at that directory
Gemspec files generated by old bundler run `git` without changing the
working directory.
Or some gemspec files expect an owned file at the top exists ath the
current working directory.
2022-08-05 09:52:20 +09:00
Nobuyoshi Nakada
44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada
5921bfc7ce
Add --stdout-on-failure, the reverse of --stderr-on-failure 2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada
1b34bd07c1
Separate failed output option
It is unrelated to `GlobOption` at all.
2022-07-05 14:40:19 +09:00
Nobuyoshi Nakada
f159bbd17d
Prevent accidental use of assert_raises 2022-06-25 19:09:06 +09:00
Nobuyoshi Nakada
7fd51c0241
vcs.rb: ignore configuration files get rid of aliases [ci skip] 2022-06-22 09:33:25 +09:00
Nobuyoshi Nakada
bc77cda8fd
vcs.rb: just one log to check if --date option works [ci skip] 2022-06-22 09:32:01 +09:00
Nobuyoshi Nakada
0dcd25b711
vcs.rb: show diagnostic/progressing messages when debugging [ci skip] 2022-06-22 09:31:19 +09:00