io-event 1.0.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92c441dcc5d0c1c052d12cca378cb86ed81ce156bbff09b8d699699424acb3e6
4
- data.tar.gz: bd971d884cd6decd4b6e2b0de10248255d17161acb556a709f24aa732594eb32
3
+ metadata.gz: bbc13d55bf16de818e95478a83d0da64de1b9844bf92fd2970df3e8cc42d8240
4
+ data.tar.gz: 41e8fb1ad62705688c44ff774e44360ffef8223c8d308c01d1163b66b67c3abe
5
5
  SHA512:
6
- metadata.gz: b296a4cabf9c7db248139f23821bd9f43894269494c9f831dd0e56a67ab4b89e7346dcb7bb20c510a5067a2309e0372a743a862c548a7f781c84e3f6a51e4287
7
- data.tar.gz: fd8df36184a53e494ec16e378721f0d35305c97b561e393821eae88d0c7b8775f04f9f883821530f07a2584525978a4c1c14912dba4f35cfe366638f396a82db
6
+ metadata.gz: 878bb331d512cd99115da6451c07e06160fcf868e208280ef042d652be2d5cd606b1bb14623337ff1672729cb2f20b78f85232fd793a5baea274b3b5159a51ef
7
+ data.tar.gz: 85fc1b0faa924bb3c4f62de80262275a321f8b36a23954f110e9e78e7d7c156a0df62b3bdcc1feabaff14ab14107db6f37d51aa7ad0d00c139690b7231b482c4
data/ext/IO_Event.bundle CHANGED
Binary file
data/ext/Makefile CHANGED
@@ -3,7 +3,6 @@ SHELL = /bin/sh
3
3
 
4
4
  # V=0 quiet, V=1 verbose. other values don't work.
5
5
  V = 0
6
- V0 = $(V:0=)
7
6
  Q1 = $(V:1=)
8
7
  Q = $(Q1:0=@)
9
8
  ECHO1 = $(V:1=@ :)
@@ -13,12 +12,12 @@ NULLCMD = :
13
12
  #### Start of system configuration section. ####
14
13
 
15
14
  srcdir = .
16
- topdir = /Users/samuel/.rubies/ruby-head/include/ruby-3.1.0
15
+ topdir = /Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0
17
16
  hdrdir = $(topdir)
18
- arch_hdrdir = /Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21
17
+ arch_hdrdir = /Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21
19
18
  PATH_SEPARATOR = :
20
19
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(srcdir)/io/event:$(srcdir)/io/event/selector
21
- prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-head
20
+ prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.0.3
22
21
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
22
  rubyarchprefix = $(rubylibprefix)/$(arch)
24
23
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -51,8 +50,8 @@ dvidir = $(docdir)
51
50
  htmldir = $(docdir)
52
51
  infodir = $(datarootdir)/info
53
52
  docdir = $(datarootdir)/doc/$(PACKAGE)
54
- oldincludedir = $(DESTDIR)/usr/include
55
- includedir = $(SDKROOT)$(prefix)/include
53
+ oldincludedir = $(SDKROOT)/usr/include
54
+ includedir = $(prefix)/include
56
55
  runstatedir = $(localstatedir)/run
57
56
  localstatedir = $(prefix)/var
58
57
  sharedstatedir = $(prefix)/com
@@ -66,33 +65,33 @@ archdir = $(rubyarchdir)
66
65
 
67
66
 
68
67
  CC_WRAPPER =
69
- CC = clang
70
- CXX = clang++
68
+ CC = clang -fdeclspec
69
+ CXX = clang++ -fdeclspec
71
70
  LIBRUBY = $(LIBRUBY_A)
72
71
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
73
72
  LIBRUBYARG_SHARED =
74
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
73
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework Security -framework Foundation $(MAINLIBS)
75
74
  empty =
76
75
  OUTFLAG = -o $(empty)
77
76
  COUTFLAG = -o $(empty)
78
77
  CSRCFLAG = $(empty)
79
78
 
80
79
  RUBY_EXTCONF_H = extconf.h
81
- cflags = -fdeclspec $(optflags) $(debugflags) $(warnflags)
80
+ cflags = $(optflags) $(debugflags) $(warnflags)
82
81
  cxxflags =
83
- optflags = -O3 -fno-fast-math
82
+ optflags = -O3
84
83
  debugflags = -ggdb3
85
- warnflags = -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef
84
+ warnflags = -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens
86
85
  cppflags =
87
86
  CCDLFLAGS = -fno-common
88
- CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -Wall -std=c99 $(ARCH_FLAG)
87
+ CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -Wall -std=c99 $(ARCH_FLAG)
89
88
  INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
90
89
  DEFS =
91
- CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
92
- CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
93
- ldflags = -L. -fstack-protector-strong
94
- dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress
95
- ARCH_FLAG =
90
+ CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\" -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
91
+ CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG)
92
+ ldflags = -L. -fstack-protector-strong -L/opt/local/lib
93
+ dldflags = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/opt/local/lib
94
+ ARCH_FLAG = -m64
96
95
  DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
97
96
  LDSHARED = $(CC) -dynamic -bundle
98
97
  LDSHAREDXX = $(CXX) -dynamic -bundle
@@ -100,7 +99,7 @@ AR = ar
100
99
  EXEEXT =
101
100
 
102
101
  RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
103
- RUBY_SO_NAME = ruby.3.1
102
+ RUBY_SO_NAME = ruby.3.0
104
103
  RUBYW_INSTALL_NAME =
105
104
  RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
106
105
  RUBYW_BASE_NAME = rubyw
@@ -108,13 +107,13 @@ RUBY_BASE_NAME = ruby
108
107
 
109
108
  arch = arm64-darwin21
110
109
  sitearch = $(arch)
111
- ruby_version = 3.1.0
110
+ ruby_version = 3.0.0
112
111
  ruby = $(bindir)/$(RUBY_BASE_NAME)
113
112
  RUBY = $(ruby)
114
113
  ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h $(RUBY_EXTCONF_H)
115
114
 
116
115
  RM = rm -f
117
- RM_RF = rm -fr
116
+ RM_RF = $(RUBY) -run -e rm -- -rf
118
117
  RMDIRS = rmdir -p
119
118
  MAKEDIRS = /opt/local/bin/gmkdir -p
120
119
  INSTALL = /opt/local/bin/ginstall -c
@@ -126,8 +125,8 @@ TOUCH = exit >
126
125
  #### End of system configuration section. ####
127
126
 
128
127
  preload =
129
- libpath = . $(libdir)
130
- LIBPATH = -L. -L$(libdir)
128
+ libpath = . $(libdir) /opt/local/lib
129
+ LIBPATH = -L. -L$(libdir) -L/opt/local/lib
131
130
  DEFFILE =
132
131
 
133
132
  CLEANFILES = mkmf.log
@@ -160,7 +159,7 @@ HDRDIR = $(sitehdrdir)$(target_prefix)
160
159
  ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
161
160
  TARGET_SO_DIR =
162
161
  TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
163
- CLEANLIBS = $(TARGET_SO) $(TARGET_SO).dSYM
162
+ CLEANLIBS = $(TARGET_SO)
164
163
  CLEANOBJS = *.o *.bak
165
164
 
166
165
  all: $(DLLIB)
@@ -173,7 +172,7 @@ clean-rb-default::
173
172
  clean-rb::
174
173
  clean-so::
175
174
  clean: clean-so clean-static clean-rb-default clean-rb
176
- -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
175
+ -$(Q)$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
177
176
 
178
177
  distclean-rb-default::
179
178
  distclean-rb::
data/ext/event.o CHANGED
Binary file
data/ext/extconf.h CHANGED
@@ -1,10 +1,6 @@
1
1
  #ifndef EXTCONF_H
2
2
  #define EXTCONF_H
3
3
  #define HAVE_RB_EXT_RACTOR_SAFE 1
4
- #define HAVE__RB_FIBER_TRANSFER 1
5
4
  #define HAVE_SYS_EVENT_H 1
6
- #define HAVE_RB_IO_DESCRIPTOR 1
7
5
  #define HAVE_RB_FIBER_CURRENT 1
8
- #define HAVE__RB_FIBER_RAISE 1
9
- #define HAVE_RUBY_IO_BUFFER_H 1
10
6
  #endif
data/ext/interrupt.o CHANGED
Binary file
@@ -231,6 +231,11 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE pid, V
231
231
  };
232
232
 
233
233
  process_wait_arguments.descriptor = pidfd_open(process_wait_arguments.pid, 0);
234
+
235
+ if (process_wait_arguments.descriptor == -1) {
236
+ rb_sys_fail("IO_Event_Selector_EPoll_process_wait:pidfd_open");
237
+ }
238
+
234
239
  rb_update_max_fd(process_wait_arguments.descriptor);
235
240
 
236
241
  struct epoll_event event = {
@@ -241,6 +246,7 @@ VALUE IO_Event_Selector_EPoll_process_wait(VALUE self, VALUE fiber, VALUE pid, V
241
246
  int result = epoll_ctl(data->descriptor, EPOLL_CTL_ADD, process_wait_arguments.descriptor, &event);
242
247
 
243
248
  if (result == -1) {
249
+ close(process_wait_arguments.descriptor);
244
250
  rb_sys_fail("IO_Event_Selector_EPoll_process_wait:epoll_ctl");
245
251
  }
246
252
 
@@ -330,13 +336,15 @@ VALUE IO_Event_Selector_EPoll_io_wait(VALUE self, VALUE fiber, VALUE io, VALUE e
330
336
 
331
337
  rb_update_max_fd(duplicate);
332
338
 
333
- if (descriptor == -1)
339
+ if (descriptor == -1) {
334
340
  rb_sys_fail("IO_Event_Selector_EPoll_io_wait:dup");
341
+ }
335
342
 
336
343
  result = epoll_ctl(data->descriptor, EPOLL_CTL_ADD, descriptor, &event);
337
344
  }
338
345
 
339
346
  if (result == -1) {
347
+ if (duplicate >= 0) close(duplicate);
340
348
  rb_sys_fail("IO_Event_Selector_EPoll_io_wait:epoll_ctl");
341
349
  }
342
350
 
@@ -190,7 +190,7 @@ int process_add_filters(int descriptor, int ident, VALUE fiber) {
190
190
 
191
191
  event.ident = ident;
192
192
  event.filter = EVFILT_PROC;
193
- event.flags = EV_ADD | EV_ENABLE | EV_ONESHOT;
193
+ event.flags = EV_ADD | EV_ENABLE | EV_ONESHOT | EV_UDATA_SPECIFIC;
194
194
  event.fflags = NOTE_EXIT;
195
195
  event.udata = (void*)fiber;
196
196
 
@@ -214,7 +214,7 @@ void process_remove_filters(int descriptor, int ident) {
214
214
 
215
215
  event.ident = ident;
216
216
  event.filter = EVFILT_PROC;
217
- event.flags = EV_DELETE;
217
+ event.flags = EV_DELETE | EV_UDATA_SPECIFIC;
218
218
  event.fflags = NOTE_EXIT;
219
219
 
220
220
  // Ignore the result.
@@ -273,7 +273,7 @@ int io_add_filters(int descriptor, int ident, int events, VALUE fiber) {
273
273
  if (events & IO_EVENT_READABLE) {
274
274
  kevents[count].ident = ident;
275
275
  kevents[count].filter = EVFILT_READ;
276
- kevents[count].flags = EV_ADD | EV_ENABLE | EV_ONESHOT;
276
+ kevents[count].flags = EV_ADD | EV_ENABLE | EV_ONESHOT | EV_UDATA_SPECIFIC;
277
277
  kevents[count].udata = (void*)fiber;
278
278
 
279
279
  // #ifdef EV_OOBAND
@@ -288,7 +288,7 @@ int io_add_filters(int descriptor, int ident, int events, VALUE fiber) {
288
288
  if (events & IO_EVENT_WRITABLE) {
289
289
  kevents[count].ident = ident;
290
290
  kevents[count].filter = EVFILT_WRITE;
291
- kevents[count].flags = EV_ADD | EV_ENABLE | EV_ONESHOT;
291
+ kevents[count].flags = EV_ADD | EV_ENABLE | EV_ONESHOT | EV_UDATA_SPECIFIC;
292
292
  kevents[count].udata = (void*)fiber;
293
293
  count++;
294
294
  }
@@ -310,7 +310,7 @@ void io_remove_filters(int descriptor, int ident, int events) {
310
310
  if (events & IO_EVENT_READABLE) {
311
311
  kevents[count].ident = ident;
312
312
  kevents[count].filter = EVFILT_READ;
313
- kevents[count].flags = EV_DELETE;
313
+ kevents[count].flags = EV_DELETE | EV_UDATA_SPECIFIC;
314
314
 
315
315
  count++;
316
316
  }
@@ -318,7 +318,7 @@ void io_remove_filters(int descriptor, int ident, int events) {
318
318
  if (events & IO_EVENT_WRITABLE) {
319
319
  kevents[count].ident = ident;
320
320
  kevents[count].filter = EVFILT_WRITE;
321
- kevents[count].flags = EV_DELETE;
321
+ kevents[count].flags = EV_DELETE | EV_UDATA_SPECIFIC;
322
322
  count++;
323
323
  }
324
324
 
@@ -695,7 +695,7 @@ VALUE IO_Event_Selector_KQueue_wakeup(VALUE self) {
695
695
  struct kevent trigger = {0};
696
696
 
697
697
  trigger.filter = EVFILT_USER;
698
- trigger.flags = EV_ADD|EV_CLEAR;
698
+ trigger.flags = EV_ADD | EV_CLEAR | EV_UDATA_SPECIFIC;
699
699
  trigger.fflags = NOTE_TRIGGER;
700
700
 
701
701
  int result = kevent(data->descriptor, &trigger, 1, NULL, 0, NULL);
@@ -21,6 +21,11 @@
21
21
  #include "selector.h"
22
22
  #include <fcntl.h>
23
23
 
24
+ #ifndef HAVE_RB_PROCESS_STATUS_WAIT
25
+ // Pull in WNOHANG.
26
+ #include <sys/wait.h>
27
+ #endif
28
+
24
29
  static const int DEBUG = 0;
25
30
 
26
31
  static ID id_transfer, id_alive_p;
data/ext/kqueue.o CHANGED
Binary file
data/ext/mkmf.log CHANGED
@@ -1,6 +1,6 @@
1
1
  have_func: checking for rb_ext_ractor_safe()... -------------------- yes
2
2
 
3
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
3
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
4
4
  checked program was:
5
5
  /* begin */
6
6
  1: #include "ruby.h"
@@ -11,7 +11,7 @@ checked program was:
11
11
  6: }
12
12
  /* end */
13
13
 
14
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
14
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
15
15
  checked program was:
16
16
  /* begin */
17
17
  1: #include "ruby.h"
@@ -32,9 +32,13 @@ checked program was:
32
32
 
33
33
  --------------------
34
34
 
35
- have_func: checking for &rb_fiber_transfer()... -------------------- yes
35
+ have_func: checking for &rb_fiber_transfer()... -------------------- no
36
36
 
37
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
37
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
38
+ conftest.c:14:76: error: use of undeclared identifier 'rb_fiber_transfer'
39
+ int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_transfer; return !p; }
40
+ ^
41
+ 1 error generated.
38
42
  checked program was:
39
43
  /* begin */
40
44
  1: #include "ruby.h"
@@ -57,7 +61,7 @@ checked program was:
57
61
 
58
62
  have_library: checking for -luring... -------------------- no
59
63
 
60
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc -luring "
64
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc -luring "
61
65
  ld: library not found for -luring
62
66
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
63
67
  checked program was:
@@ -83,7 +87,7 @@ checked program was:
83
87
 
84
88
  have_header: checking for sys/epoll.h... -------------------- no
85
89
 
86
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 -c conftest.c"
90
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -o conftest.i"
87
91
  conftest.c:3:10: fatal error: 'sys/epoll.h' file not found
88
92
  #include <sys/epoll.h>
89
93
  ^~~~~~~~~~~~~
@@ -99,7 +103,7 @@ checked program was:
99
103
 
100
104
  have_header: checking for sys/event.h... -------------------- yes
101
105
 
102
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 -c conftest.c"
106
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -o conftest.i"
103
107
  checked program was:
104
108
  /* begin */
105
109
  1: #include "ruby.h"
@@ -111,7 +115,7 @@ checked program was:
111
115
 
112
116
  have_header: checking for sys/eventfd.h... -------------------- no
113
117
 
114
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 -c conftest.c"
118
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -o conftest.i"
115
119
  conftest.c:3:10: fatal error: 'sys/eventfd.h' file not found
116
120
  #include <sys/eventfd.h>
117
121
  ^~~~~~~~~~~~~~~
@@ -125,9 +129,9 @@ checked program was:
125
129
 
126
130
  --------------------
127
131
 
128
- have_func: checking for rb_io_descriptor()... -------------------- yes
132
+ have_func: checking for rb_io_descriptor()... -------------------- no
129
133
 
130
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
134
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
131
135
  conftest.c:14:57: error: use of undeclared identifier 'rb_io_descriptor'
132
136
  int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
133
137
  ^
@@ -150,7 +154,12 @@ checked program was:
150
154
  14: int t(void) { void ((*volatile p)()); p = (void ((*)()))rb_io_descriptor; return !p; }
151
155
  /* end */
152
156
 
153
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
157
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
158
+ Undefined symbols for architecture arm64:
159
+ "_rb_io_descriptor", referenced from:
160
+ _t in conftest-d90377.o
161
+ ld: symbol(s) not found for architecture arm64
162
+ clang: error: linker command failed with exit code 1 (use -v to see invocation)
154
163
  checked program was:
155
164
  /* begin */
156
165
  1: #include "ruby.h"
@@ -174,7 +183,7 @@ checked program was:
174
183
 
175
184
  have_func: checking for &rb_process_status_wait()... -------------------- no
176
185
 
177
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
186
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
178
187
  conftest.c:14:76: error: use of undeclared identifier 'rb_process_status_wait'
179
188
  int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_process_status_wait; return !p; }
180
189
  ^
@@ -201,7 +210,7 @@ checked program was:
201
210
 
202
211
  have_func: checking for rb_fiber_current()... -------------------- yes
203
212
 
204
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
213
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
205
214
  checked program was:
206
215
  /* begin */
207
216
  1: #include "ruby.h"
@@ -222,9 +231,17 @@ checked program was:
222
231
 
223
232
  --------------------
224
233
 
225
- have_func: checking for &rb_fiber_raise()... -------------------- yes
234
+ have_func: checking for &rb_fiber_raise()... -------------------- no
226
235
 
227
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -o conftest -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-head/lib -L. -fstack-protector-strong -lruby.3.1-static -framework CoreFoundation -lpthread -ldl -lobjc "
236
+ "clang -fdeclspec -o conftest -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -L. -L/Users/samuel/.rubies/ruby-3.0.3/lib -L/opt/local/lib -L. -fstack-protector-strong -L/opt/local/lib -m64 -lruby.3.0-static -framework Security -framework Foundation -lpthread -lgmp -ldl -lobjc "
237
+ conftest.c:14:76: error: use of undeclared identifier 'rb_fiber_raise'; did you mean 'rb_fiber_resume'?
238
+ int t(void) { const volatile void *volatile p; p = (const volatile void *)&rb_fiber_raise; return !p; }
239
+ ^~~~~~~~~~~~~~
240
+ rb_fiber_resume
241
+ /Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/internal/intern/cont.h:32:7: note: 'rb_fiber_resume' declared here
242
+ VALUE rb_fiber_resume(VALUE fib, int argc, const VALUE *argv);
243
+ ^
244
+ 1 error generated.
228
245
  checked program was:
229
246
  /* begin */
230
247
  1: #include "ruby.h"
@@ -245,9 +262,14 @@ checked program was:
245
262
 
246
263
  --------------------
247
264
 
248
- have_header: checking for ruby/io/buffer.h... -------------------- yes
265
+ have_header: checking for ruby/io/buffer.h... -------------------- no
249
266
 
250
- DYLD_FALLBACK_LIBRARY_PATH=.:/Users/samuel/.rubies/ruby-head/lib "clang -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0/ruby/backward -I/Users/samuel/.rubies/ruby-head/include/ruby-3.1.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -pipe -Wall -std=c99 -c conftest.c"
267
+ "clang -E -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/arm64-darwin21 -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0/ruby/backward -I/Users/samuel/.rubies/ruby-3.0.3/include/ruby-3.0.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -pipe -Wall -std=c99 conftest.c -o conftest.i"
268
+ conftest.c:3:10: fatal error: 'ruby/io/buffer.h' file not found
269
+ #include <ruby/io/buffer.h>
270
+ ^~~~~~~~~~~~~~~~~~
271
+ conftest.c:3:10: note: did not find header 'io/buffer.h' in framework 'ruby' (loaded from '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks')
272
+ 1 error generated.
251
273
  checked program was:
252
274
  /* begin */
253
275
  1: #include "ruby.h"
@@ -259,15 +281,11 @@ checked program was:
259
281
 
260
282
  extconf.h is:
261
283
  /* begin */
262
- 1: #ifndef EXTCONF_H
263
- 2: #define EXTCONF_H
264
- 3: #define HAVE_RB_EXT_RACTOR_SAFE 1
265
- 4: #define HAVE__RB_FIBER_TRANSFER 1
266
- 5: #define HAVE_SYS_EVENT_H 1
267
- 6: #define HAVE_RB_IO_DESCRIPTOR 1
268
- 7: #define HAVE_RB_FIBER_CURRENT 1
269
- 8: #define HAVE__RB_FIBER_RAISE 1
270
- 9: #define HAVE_RUBY_IO_BUFFER_H 1
271
- 10: #endif
284
+ 1: #ifndef EXTCONF_H
285
+ 2: #define EXTCONF_H
286
+ 3: #define HAVE_RB_EXT_RACTOR_SAFE 1
287
+ 4: #define HAVE_SYS_EVENT_H 1
288
+ 5: #define HAVE_RB_FIBER_CURRENT 1
289
+ 6: #endif
272
290
  /* end */
273
291
 
data/ext/selector.o CHANGED
Binary file
@@ -30,7 +30,7 @@ module IO::Event
30
30
  @priority = {}
31
31
 
32
32
  unless Fiber.current == selector.loop
33
- raise "Selector must be initialized on event loop fiber!"
33
+ Kernel::raise "Selector must be initialized on event loop fiber!"
34
34
  end
35
35
  end
36
36
 
@@ -40,19 +40,16 @@ module IO::Event
40
40
 
41
41
  def close
42
42
  if @selector.nil?
43
- raise "Selector already closed!"
43
+ Kernel::raise "Selector already closed!"
44
44
  end
45
45
 
46
46
  @selector.close
47
47
  @selector = nil
48
48
  end
49
49
 
50
- def transfer(fiber, *arguments)
51
- @selector.transfer(fiber, *arguments)
52
- end
53
-
54
- def transfer(*arguments)
55
- @selector.transfer(*arguments)
50
+ # Transfer from the calling fiber to the event loop.
51
+ def transfer
52
+ @selector.transfer
56
53
  end
57
54
 
58
55
  def resume(*arguments)
@@ -80,7 +77,7 @@ module IO::Event
80
77
  end
81
78
 
82
79
  def io_wait(fiber, io, events)
83
- register_readable(fiber, io, events)
80
+ @selector.io_wait(fiber, io, events)
84
81
  end
85
82
 
86
83
  if IO.const_defined?(:Buffer)
@@ -95,67 +92,11 @@ module IO::Event
95
92
 
96
93
  def select(duration = nil)
97
94
  unless Fiber.current == @selector.loop
98
- raise "Selector must be run on event loop fiber!"
95
+ Kernel::raise "Selector must be run on event loop fiber!"
99
96
  end
100
97
 
101
98
  @selector.select(duration)
102
99
  end
103
-
104
- private
105
-
106
- def register_readable(fiber, io, events)
107
- if (events & IO::READABLE) > 0
108
- if @readable.key?(io)
109
- raise "Cannot wait for #{io} to become readable from multiple fibers."
110
- end
111
-
112
- begin
113
- @readable[io] = fiber
114
-
115
- register_writable(fiber, io, events)
116
- ensure
117
- @readable.delete(io)
118
- end
119
- else
120
- register_writable(fiber, io, events)
121
- end
122
- end
123
-
124
- def register_writable(fiber, io, events)
125
- if (events & IO::WRITABLE) > 0
126
- if @writable.key?(io)
127
- raise "Cannot wait for #{io} to become writable from multiple fibers."
128
- end
129
-
130
- begin
131
- @writable[io] = fiber
132
-
133
- register_priority(fiber, io, events)
134
- ensure
135
- @writable.delete(io)
136
- end
137
- else
138
- register_priority(fiber, io, events)
139
- end
140
- end
141
-
142
- def register_priority(fiber, io, events)
143
- if (events & IO::PRIORITY) > 0
144
- if @priority.key?(io)
145
- raise "Cannot wait for #{io} to become priority from multiple fibers."
146
- end
147
-
148
- begin
149
- @priority[io] = fiber
150
-
151
- @selector.io_wait(fiber, io, events)
152
- ensure
153
- @priority.delete(io)
154
- end
155
- else
156
- @selector.io_wait(fiber, io, events)
157
- end
158
- end
159
100
  end
160
101
  end
161
102
  end
@@ -26,8 +26,7 @@ module IO::Event
26
26
  def initialize(loop)
27
27
  @loop = loop
28
28
 
29
- @readable = Hash.new.compare_by_identity
30
- @writable = Hash.new.compare_by_identity
29
+ @waiting = Hash.new.compare_by_identity
31
30
 
32
31
  @blocked = false
33
32
 
@@ -52,8 +51,7 @@ module IO::Event
52
51
  @interrupt.close
53
52
 
54
53
  @loop = nil
55
- @readable = nil
56
- @writable = nil
54
+ @waiting = nil
57
55
  end
58
56
 
59
57
  Optional = Struct.new(:fiber) do
@@ -114,23 +112,40 @@ module IO::Event
114
112
  !@ready.empty?
115
113
  end
116
114
 
117
- def io_wait(fiber, io, events)
118
- remove_readable = remove_writable = false
115
+ Waiter = Struct.new(:fiber, :events, :tail) do
116
+ def alive?
117
+ self.fiber&.alive?
118
+ end
119
+
120
+ def transfer(events)
121
+ if fiber = self.fiber
122
+ self.fiber = nil
123
+
124
+ fiber.transfer(events & self.events) if fiber.alive?
125
+ end
119
126
 
120
- if (events & IO::READABLE) > 0 or (events & IO::PRIORITY) > 0
121
- @readable[io] = fiber
122
- remove_readable = true
127
+ self.tail&.transfer(events)
123
128
  end
124
129
 
125
- if (events & IO::WRITABLE) > 0
126
- @writable[io] = fiber
127
- remove_writable = true
130
+ def invalidate
131
+ self.fiber = nil
132
+ end
133
+
134
+ def each(&block)
135
+ if fiber = self.fiber
136
+ yield fiber, self.events
137
+ end
138
+
139
+ self.tail&.each(&block)
128
140
  end
141
+ end
142
+
143
+ def io_wait(fiber, io, events)
144
+ waiter = @waiting[io] = Waiter.new(fiber, events, @waiting[io])
129
145
 
130
146
  @loop.transfer
131
147
  ensure
132
- @readable.delete(io) if remove_readable
133
- @writable.delete(io) if remove_writable
148
+ waiter&.invalidate
134
149
  end
135
150
 
136
151
  if IO.const_defined?(:Buffer)
@@ -155,9 +170,9 @@ module IO::Event
155
170
  else
156
171
  return -EAGAIN
157
172
  end
173
+ when nil
174
+ break
158
175
  else
159
- break unless result
160
-
161
176
  buffer.set_string(result, offset)
162
177
 
163
178
  size = result.bytesize
@@ -238,25 +253,38 @@ module IO::Event
238
253
  duration = 0
239
254
  end
240
255
 
256
+ readable = Array.new
257
+ writable = Array.new
258
+
259
+ @waiting.each do |io, waiter|
260
+ waiter.each do |fiber, events|
261
+ if (events & IO::READABLE) > 0
262
+ readable << io
263
+ end
264
+
265
+ if (events & IO::WRITABLE) > 0
266
+ writable << io
267
+ end
268
+ end
269
+ end
270
+
241
271
  @blocked = true
242
272
  duration = 0 unless @ready.empty?
243
- readable, writable, _ = ::IO.select(@readable.keys, @writable.keys, nil, duration)
273
+ readable, writable, _ = ::IO.select(readable, writable, nil, duration)
244
274
  @blocked = false
245
275
 
246
276
  ready = Hash.new(0)
247
277
 
248
278
  readable&.each do |io|
249
- fiber = @readable.delete(io)
250
- ready[fiber] |= IO::READABLE
279
+ ready[io] |= IO::READABLE
251
280
  end
252
281
 
253
282
  writable&.each do |io|
254
- fiber = @writable.delete(io)
255
- ready[fiber] |= IO::WRITABLE
283
+ ready[io] |= IO::WRITABLE
256
284
  end
257
285
 
258
- ready.each do |fiber, events|
259
- fiber.transfer(events) if fiber.alive?
286
+ ready.each do |io, events|
287
+ @waiting.delete(io).transfer(events)
260
288
  end
261
289
 
262
290
  return ready.size
@@ -19,6 +19,7 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  require_relative 'selector/select'
22
+ require_relative 'debug/selector'
22
23
 
23
24
  module IO::Event
24
25
  module Selector
@@ -40,8 +41,14 @@ module IO::Event
40
41
  end
41
42
  end
42
43
 
43
- def self.new(loop)
44
- default.new(loop)
44
+ def self.new(loop, env = ENV)
45
+ selector = default(env).new(loop)
46
+
47
+ if debug = env['IO_EVENT_DEBUG_SELECTOR']
48
+ selector = Debug::Selector.new(selector)
49
+ end
50
+
51
+ return selector
45
52
  end
46
53
  end
47
54
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module IO::Event
22
- VERSION = "1.0.1"
22
+ VERSION = "1.0.4"
23
23
  end
metadata CHANGED
@@ -1,14 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - machty
9
+ - Benoit Daloze
10
+ - Delton Ding
8
11
  autorequire:
9
12
  bindir: bin
10
13
  cert_chain: []
11
- date: 2021-12-24 00:00:00.000000000 Z
14
+ date: 2022-03-09 00:00:00.000000000 Z
12
15
  dependencies:
13
16
  - !ruby/object:Gem::Dependency
14
17
  name: bake
@@ -120,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
123
  - !ruby/object:Gem::Version
121
124
  version: '0'
122
125
  requirements: []
123
- rubygems_version: 3.3.2
126
+ rubygems_version: 3.3.8
124
127
  signing_key:
125
128
  specification_version: 4
126
129
  summary: An event loop.