io-event 1.0.0 → 1.0.3

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: 19b363c469b81cd49232e4e91a07c26cd0883984b8b54aa3fb34c5d861d5c577
4
- data.tar.gz: 050f76cc397e3ec9e44b861c6469ba37d845d6a11fbc05f390e32a12a24061b5
3
+ metadata.gz: 702073dbb4f3ae83c132f359f31cd28ff1773fd59555ee4d55f53da963cab6c0
4
+ data.tar.gz: a3237cb6b6499259203da3d26d4ecc67cf019dac3ebb5f1b0636f2148ddc08b5
5
5
  SHA512:
6
- metadata.gz: 704987de2d3aa4107621717ef84e9aad8d06c0c0ba062e4f63b0f0ef40f11e86e2971fec26e2e95f45494d2c60045d1991cdaf26c92bb7580d98e4eea0a94be8
7
- data.tar.gz: 1d6da8310ee63c3e6d821d2dbc5c23affe02015ba44daa1e999a71de6a929d7c274379fab981495e47ea82157bda22e1dfe1e5ffc36ba380a36cd8ac9c65515f
6
+ metadata.gz: 686ff45aecfa4bc3c79328595291d05e1c5887656a054ded3ee6108208ab03a6320d5c82cc8e171533630993c514455a6775ee076b3e0c43af592b065f040f19
7
+ data.tar.gz: c653fb07fab4818a7c9aa46ba97e1b0bc9490c4a3df632c9195874b6ba616ed48d760492e6995fe68ca4ac45f69e80f6d0bce7b7370d7eabdc4192ae831fc3e0
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
@@ -299,6 +299,11 @@ VALUE io_wait_transfer(VALUE _arguments) {
299
299
 
300
300
  VALUE result = IO_Event_Selector_fiber_transfer(arguments->data->backend.loop, 0, NULL);
301
301
 
302
+ // If the fiber is being cancelled, it might be resumed with nil:
303
+ if (!RTEST(result)) {
304
+ return Qfalse;
305
+ }
306
+
302
307
  return INT2NUM(events_from_epoll_flags(NUM2INT(result)));
303
308
  };
304
309
 
@@ -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
 
@@ -355,6 +355,11 @@ VALUE io_wait_transfer(VALUE _arguments) {
355
355
 
356
356
  VALUE result = IO_Event_Selector_fiber_transfer(arguments->data->backend.loop, 0, NULL);
357
357
 
358
+ // If the fiber is being cancelled, it might be resumed with nil:
359
+ if (!RTEST(result)) {
360
+ return Qfalse;
361
+ }
362
+
358
363
  return INT2NUM(events_from_kqueue_filter(RB_NUM2INT(result)));
359
364
  }
360
365
 
@@ -690,7 +695,7 @@ VALUE IO_Event_Selector_KQueue_wakeup(VALUE self) {
690
695
  struct kevent trigger = {0};
691
696
 
692
697
  trigger.filter = EVFILT_USER;
693
- trigger.flags = EV_ADD|EV_CLEAR;
698
+ trigger.flags = EV_ADD | EV_CLEAR | EV_UDATA_SPECIFIC;
694
699
  trigger.fflags = NOTE_TRIGGER;
695
700
 
696
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;
@@ -338,6 +338,10 @@ VALUE io_wait_transfer(VALUE _arguments) {
338
338
  VALUE result = IO_Event_Selector_fiber_transfer(data->backend.loop, 0, NULL);
339
339
  if (DEBUG) fprintf(stderr, "io_wait:IO_Event_Selector_fiber_transfer -> %d\n", RB_NUM2INT(result));
340
340
 
341
+ if (!RTEST(result)) {
342
+ return Qfalse;
343
+ }
344
+
341
345
  // We explicitly filter the resulting events based on the requested events.
342
346
  // In some cases, poll will report events we didn't ask for.
343
347
  short flags = arguments->flags & NUM2INT(result);
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.0"
22
+ VERSION = "1.0.3"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bake
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.3.0
123
+ rubygems_version: 3.2.32
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: An event loop.