Commit graph

1856 commits

Author SHA1 Message Date
Kevin Newton
85c8e8b9bd
Fix VPATH for yarp/version.h 2023-08-25 15:53:01 -04:00
Kevin Newton
a7c7cd11bc
Update sync script to handle yarp/version.h 2023-08-25 15:47:25 -04:00
Kevin Newton
dd07b70253
Fix mutation visitor build for YARP templating 2023-08-25 15:33:14 -04:00
Peter Zhu
bfb395c620 Implement weak references in the GC
[Feature #19783]

This commit adds support for weak references in the GC through the
function `rb_gc_mark_weak`. Unlike strong references, weak references
does not mark the object, but rather lets the GC know that an object
refers to another one. If the child object is freed, the pointer from
the parent object is overwritten with `Qundef`.

Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
2023-08-25 09:01:21 -04:00
Takashi Kokubun
6f1dfa7411
Resurrect srcs dependency for YARP templates (#8285) 2023-08-24 18:46:06 -07:00
Takashi Kokubun
e89150b1d4
Render YARP templates into the build directory (#8266) 2023-08-22 21:56:51 -07:00
Takashi Kokubun
57dfd5c245 Revert "Fix tool/update-deps for YARP files"
This reverts commit 6fff5c5ba2.

Revert "Use $(top_srcdir) entries for mswin (#8244)"

This reverts commit e327bf32bd.

Revert "Update dependencies"

This reverts commit aba26a8804.

Revert "Use {$(VPATH)} for OpenBSD"

This reverts commit 2046e054bc.

---

None of those revisions actually worked for both mswin and OpenBSD at
the same time. I need more time to build something that works for both.
2023-08-18 01:12:41 -07:00
Takashi Kokubun
6fff5c5ba2 Fix tool/update-deps for YARP files 2023-08-18 01:07:05 -07:00
Takashi Kokubun
aba26a8804 Update dependencies 2023-08-18 00:34:36 -07:00
Takashi Kokubun
2046e054bc Use {$(VPATH)} for OpenBSD
Scratch build on OpenBSD has been failing since 67b5f63e97.
`make; make` works though. (`make` alone doesn't work)

I have no idea what I'm doing, but I do know that this patch fixes
scratch build on an OpenBSD machine.

My best guess is that BSD make isn't capable of distinguishing foo.c vs
./foo.c in dependencies, and {$(VPATH)} becomes empty when it needs to be.
2023-08-18 00:20:11 -07:00
Takashi Kokubun
78e7fd7b49 Include YARP templated files in snapshots
Those files should be part of CRuby distributions.
2023-08-17 15:04:14 -07:00
Takashi Kokubun
72a16c61dc Move the dependency of node.rb and serialize.rb
to `main`.

This is what lib/ruby_vm/rjit/instruction.rb currently does. Letting
.time depend on those files was just a workaround.
2023-08-17 14:52:23 -07:00
Takashi Kokubun
67b5f63e97
Render YARP templates in the build process (#8228) 2023-08-17 14:39:04 -07:00
Takashi Kokubun
87f74a349e Update dependencies 2023-08-16 17:47:32 -07:00
Nobuyoshi Nakada
2a3acbc420
Fix test and precheck order for old GNU Make 2023-08-14 11:30:05 +09:00
Nobuyoshi Nakada
efc9127790
Prefix excludes with a dot to prevent chkbuild from firing wrongly
Chkbuild runs for each directories just under `test` directory when
`test-all` failed.  `test/excludes` itself should not be a target.
2023-08-13 15:23:54 +09:00
Nobuyoshi Nakada
475241ee91
Group test-syntax-suggest and leaked-globals [ci skip] 2023-08-11 16:22:18 +09:00
Nobuyoshi Nakada
907560f5dc
Fix test-bundler dependencies 2023-08-11 15:23:48 +09:00
Nobuyoshi Nakada
8fbb79f49e
Fix order of test-syntax-suggest-prepare for old GNU Make 2023-08-11 14:47:20 +09:00
Nobuyoshi Nakada
5397fc315a
Remove duplicate prerequisite [ci skip] 2023-08-10 21:04:27 +09:00
Nobuyoshi Nakada
4ba348ec3e
Explicitly require rspec/expectations tentatively
Maybe only with load-relative, recent changes to bunder/setup.rb seem
affecting weirdly.  It fails to load rspec/expectations.rb inside
rspec-core.
2023-08-10 17:37:19 +09:00
Nobuyoshi Nakada
bde55d09ed
Make PREPARE_SYNTAX_SUGGEST include TEST_RUNNABLE prefix
So that `make PREPARE_SYNTAX_SUGGEST= test-syntax-suggest` works.
2023-08-10 17:35:50 +09:00
Takashi Kokubun
38be9a9b72
Clean up OPT_STACK_CACHING (#8132) 2023-07-27 17:27:05 -07:00
Jemma Issroff
84b5274143
[ruby/yarp] Resync YARP (#8098) 2023-07-19 16:15:01 -04:00
Jean Boussier
fa30b99c34 Implement Process.warmup
[Feature #18885]

For now, the optimizations performed are:

  - Run a major GC
  - Compact the heap
  - Promote all surviving objects to oldgen

Other optimizations may follow.
2023-07-17 11:20:15 +02:00
yui-knk
82cd70ef93 Use functions defined by parser_st.c to reduce dependency on st.c 2023-07-15 12:50:40 +09:00
Peter Zhu
1e7b67f733 [Feature #19730] Remove transient heap 2023-07-13 09:27:33 -04:00
Nobuyoshi Nakada
d516910b61
Serially update only the ripper source, even with old GNU make 2023-07-10 16:36:03 +09:00
Benoit Daloze
9ee1877e4a Ensure the name given to Module#set_temporary_name is not a valid constant path
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-07-06 18:27:13 +02:00
Jemma Issroff
9614a61379 Fixed build scripts for YARP 2023-07-05 16:58:55 -04:00
Nobuyoshi Nakada
fa6e14c45d
[DOC] Stop downloading Unicode data only for unicode_properties.rdoc 2023-07-02 13:00:44 +09:00
Janosch Müller
08b3fb1152
[Bug #19728] Auto-generate unicode property docs
https://bugs.ruby-lang.org/issues/19728
2023-07-01 23:22:17 +09:00
Jemma Issroff
1272865a8e
Fix broken wiki links (#8002)
Since [Misc #19679] migrated the wiki, these links should be updated
to their new locations.
2023-06-29 17:00:40 -04:00
Nobuyoshi Nakada
3cfcd3d166
Ripper sources are generated at once 2023-06-29 23:08:08 +09:00
Nobuyoshi Nakada
c89f519170
More dependencies for ripper 2023-06-29 18:47:56 +09:00
Nobuyoshi Nakada
c94b5f121d De-duplicate parse_st.c code from st.c 2023-06-24 19:17:37 +09:00
Jemma Issroff
d53e1f42ff [Feature #19741] Add yarp to builds
Add yarp to common.mk and windows builds to enable us to run yarp
correctly with CI.
2023-06-21 11:25:39 -07:00
Hiroshi SHIBATA
bd019ac87a Removed rake-compiler dependency for test-bundled-gems
It's needless with racc-1.7.1
2023-06-14 14:24:29 +09:00
Hiroshi SHIBATA
27d581ea6c rexml is also bundled gems 2023-06-13 19:49:32 +09:00
Hiroshi SHIBATA
e5cf6b6dbe Don't install bundled gems for test-bundled-gems and test-syntax-suggest 2023-06-13 19:49:32 +09:00
yui-knk
b481b673d7 [Feature #19719] Universal Parser
Introduce Universal Parser mode for the parser.
This commit includes these changes:

* Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions
  are passed via `struct rb_parser_config_struct` when this macro is enabled.
* Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu.
2023-06-12 18:23:48 +09:00
Hiroshi SHIBATA
8be4659b60 Run test-unit test without rake task to avoid yard dependency 2023-06-12 13:18:28 +09:00
Hiroshi SHIBATA
2ec181992b pry is not needed for test-bundled-gems 2023-06-12 13:18:28 +09:00
Hiroshi SHIBATA
d24e514d54 Added racc dependency 2023-06-08 17:25:38 +09:00
Samuel Williams
a218ed5692
Hide the usage of rb_io_t where possible. (#7880)
This retries the compatible parts of the previously reverted PR so we can continue to update related code without breaking backwards compatibility.
2023-06-01 14:23:30 +09:00
NARUSE, Yui
85dcc4866d Revert "Hide most of the implementation of struct rb_io. (#6511)"
This reverts commit 18e55fc1e1.

fix [Bug #19704]
https://bugs.ruby-lang.org/issues/19704
This breaks compatibility for extension libraries. Such changes
need a discussion.
2023-06-01 08:43:22 +09:00
Samuel Williams
18e55fc1e1
Hide most of the implementation of struct rb_io. (#6511)
* Add rb_io_path and rb_io_open_descriptor.

* Use rb_io_open_descriptor to create PTY objects

* Rename FMODE_PREP -> FMODE_EXTERNAL and expose it

FMODE_PREP I believe refers to the concept of a "pre-prepared" file, but
FMODE_EXTERNAL is clearer about what the file descriptor represents and
aligns with language in the IO::Buffer module.

* Ensure that rb_io_open_descriptor closes the FD if it fails

If FMODE_EXTERNAL is not set, then it's guaranteed that Ruby will be
responsible for closing your file, eventually, if you pass it to
rb_io_open_descriptor, even if it raises an exception.

* Rename IS_EXTERNAL_FD -> RUBY_IO_EXTERNAL_P

* Expose `rb_io_closed_p`.

* Add `rb_io_mode` to get IO mode.

---------

Co-authored-by: KJ Tsanaktsidis <ktsanaktsidis@zendesk.com>
2023-05-30 10:02:40 +09:00
KJ Tsanaktsidis
66871c5a06 Fix busy-loop when waiting for file descriptors to close
When one thread is closing a file descriptor whilst another thread is
concurrently reading it, we need to wait for the reading thread to be
done with it to prevent a potential EBADF (or, worse, file descriptor
reuse).

At the moment, that is done by keeping a list of threads still using the
file descriptor in io_close_fptr. It then continually calls
rb_thread_schedule() in fptr_finalize_flush until said list is empty.

That busy-looping seems to behave rather poorly on some OS's,
particulary FreeBSD. It can cause the TestIO#test_race_gets_and_close
test to fail (even with its very long 200 second timeout) because the
closing thread starves out the using thread.

To fix that, I introduce the concept of struct rb_io_close_wait_list; a
list of threads still using a file descriptor that we want to close. We
call `rb_notify_fd_close` to let the thread scheduler know we're closing
a FD, which fills the list with threads. Then, we call
rb_notify_fd_close_wait which will block the thread until all of the
still-using threads are done.

This is implemented with a condition variable sleep, so no busy-looping
is required.
2023-05-26 14:51:23 +09:00
yui-knk
98637d421d Move ruby_node_name to node.c and rename prefix of the function 2023-05-23 18:05:35 +09:00
Nobuyoshi Nakada
7f7a8fa555
Put rb_fork back into process.c
Now, calling `rb_fork` directly breaks the PID cache and the timer
thread, so must use `rb_fork_ruby` or similar instead.
2023-05-21 23:00:27 +09:00