Skip to content

ruby 3.2.2 An error occurred while installing stackprof (0.2.26), and Bundler cannot #225

@sunpengxin7

Description

@sunpengxin7

current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/stackprof-0.2.26/ext/stackprof
C:/Ruby32-x64/bin/ruby.exe extconf.rb
checking for rb_postponed_job_register_one()... yes
checking for rb_profile_frames()... yes
checking for rb_tracepoint_new()... yes
checking for RUBY_INTERNAL_EVENT_NEWOBJ... yes
creating Makefile

current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/stackprof-0.2.26/ext/stackprof
make DESTDIR= sitearchdir=./.gem.20240130-2780-oqwczr sitelibdir=./.gem.20240130-2780-oqwczr clean

current directory: C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/stackprof-0.2.26/ext/stackprof
make DESTDIR= sitearchdir=./.gem.20240130-2780-oqwczr sitelibdir=./.gem.20240130-2780-oqwczr
generating stackprof-x64-mingw-ucrt.def
compiling stackprof.c
In file included from stackprof.c:17:
C:/Ruby32-x64/msys64/ucrt64/include/sys/time.h:42:13: error: conflicting types for 'gettimeofday'; have 'int(struct timeval * restrict, void * restrict)'
42 | int __cdecl gettimeofday(struct timeval *restrict,
| ^~~~~~~~~~~~
In file included from C:/Ruby32-x64/include/ruby-3.2.0/ruby/internal/dosish.h:38,
from C:/Ruby32-x64/include/ruby-3.2.0/ruby/defines.h:78,
from C:/Ruby32-x64/include/ruby-3.2.0/ruby/ruby.h:25,
from stackprof.c:9:
C:/Ruby32-x64/include/ruby-3.2.0/ruby/win32.h:301:12: note: previous declaration of 'gettimeofday' with type 'int(struct timeval *, struct timezone *)'
301 | extern int gettimeofday(struct timeval , struct timezone );
| ^~~~~~~~~~~~
stackprof.c:145:47: error: unknown type name 'siginfo_t'
145 | static void stackprof_signal_handler(int sig, siginfo_t
sinfo, void
ucontext);
| ^~~~~~~~~
stackprof.c: In function 'stackprof_start':
stackprof.c:150:22: error: storage size of 'sa' isn't known
150 | struct sigaction sa;
| ^~
stackprof.c:151:22: error: storage size of 'timer' isn't known
151 | struct itimerval timer;
| ^~~~~
stackprof.c:204:27: error: 'stackprof_signal_handler' undeclared (first use in this function); did you mean 'stackprof_newobj_handler'?
204 | sa.sa_sigaction = stackprof_signal_handler;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| stackprof_newobj_handler
stackprof.c:204:27: note: each undeclared identifier is reported only once for each function it appears in
stackprof.c:205:23: error: 'SA_RESTART' undeclared (first use in this function); did you mean 'DRV_RESTART'?
205 | sa.sa_flags = SA_RESTART | SA_SIGINFO;
| ^~~~~~~~~~
| DRV_RESTART
stackprof.c:205:36: error: 'SA_SIGINFO' undeclared (first use in this function)
205 | sa.sa_flags = SA_RESTART | SA_SIGINFO;
| ^~~~~~~~~~
stackprof.c:206:9: warning: implicit declaration of function 'sigemptyset' [-Wimplicit-function-declaration]
206 | sigemptyset(&sa.sa_mask);
| ^~~~~~~~~~~
stackprof.c:207:9: warning: implicit declaration of function 'sigaction' [-Wimplicit-function-declaration]
207 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~~~
stackprof.c:207:38: error: 'SIGALRM' undeclared (first use in this function); did you mean 'SIGABRT'?
207 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
| SIGABRT
stackprof.c:207:48: error: 'SIGPROF' undeclared (first use in this function)
207 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
stackprof.c:212:9: warning: implicit declaration of function 'setitimer'; did you mean 'SetTimer'? [-Wimplicit-function-declaration]
212 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~
| SetTimer
stackprof.c:212:38: error: 'ITIMER_REAL' undeclared (first use in this function)
212 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:212:52: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
212 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
stackprof.c: In function 'stackprof_stop':
stackprof.c:240:22: error: storage size of 'sa' isn't known
240 | struct sigaction sa;
| ^~
stackprof.c:241:22: error: storage size of 'timer' isn't known
241 | struct itimerval timer;
| ^~~~~
stackprof.c:251:49: error: 'ITIMER_REAL' undeclared (first use in this function)
251 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:251:63: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
251 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
stackprof.c:254:23: error: 'SA_RESTART' undeclared (first use in this function); did you mean 'DRV_RESTART'?
254 | sa.sa_flags = SA_RESTART;
| ^~~~~~~~~~
| DRV_RESTART
stackprof.c:256:49: error: 'SIGALRM' undeclared (first use in this function); did you mean 'SIGABRT'?
256 | sigaction(_stackprof.mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
| SIGABRT
stackprof.c:256:59: error: 'SIGPROF' undeclared (first use in this function)
256 | sigaction(_stackprof.mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
stackprof.c: At top level:
stackprof.c:744:35: error: unknown type name 'siginfo_t'
744 | stackprof_signal_handler(int sig, siginfo_t *sinfo, void *ucontext)
| ^~~~~~~~~
stackprof.c: In function 'stackprof_atfork_prepare':
stackprof.c:856:22: error: storage size of 'timer' isn't known
856 | struct itimerval timer;
| ^~~~~
stackprof.c:860:53: error: 'ITIMER_REAL' undeclared (first use in this function)
860 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:860:67: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
860 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
stackprof.c: In function 'stackprof_atfork_parent':
stackprof.c:868:22: error: storage size of 'timer' isn't known
868 | struct itimerval timer;
| ^~~~~
stackprof.c:874:53: error: 'ITIMER_REAL' undeclared (first use in this function)
874 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:874:67: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
874 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
make: *** [Makefile:248:stackprof.o] 错误 1

make failed, exit code 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions