Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing with Ruby 3.1 #183

Open
skvortsovvg opened this issue Aug 3, 2022 · 3 comments
Open

Error installing with Ruby 3.1 #183

skvortsovvg opened this issue Aug 3, 2022 · 3 comments

Comments

@skvortsovvg
Copy link

I get this huge error log while installing stackprof 0.2.20. Ruby version 3.1.2.
What's wrong with it? How to fix?

C:\Ruby\spree_starter-main>gem install stackprof

Fetching stackprof-0.2.20.gem

Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing stackprof:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/stackprof-0.2.20/ext/stackprof

C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220803-24152-1xdeq1.rb 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:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/stackprof-0.2.20/ext/stackprof
make DESTDIR= clean

current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/stackprof-0.2.20/ext/stackprof
make DESTDIR=
generating stackprof-x64-mingw-ucrt.def
compiling stackprof.c
In file included from stackprof.c:16:
C:/Ruby31-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:/Ruby31-x64/include/ruby-3.1.0/ruby/internal/dosish.h:38,
from C:/Ruby31-x64/include/ruby-3.1.0/ruby/defines.h:78,
from C:/Ruby31-x64/include/ruby-3.1.0/ruby/ruby.h:25,
from stackprof.c:9:
C:/Ruby31-x64/include/ruby-3.1.0/ruby/win32.h:304:12: note: previous declaration of 'gettimeofday' with type 'int(struct timeval *, struct timezone *)'
304 | extern int gettimeofday(struct timeval , struct timezone );
| ^~~~~~~~~~~~
stackprof.c:139:47: error: unknown type name 'siginfo_t'
139 | static void stackprof_signal_handler(int sig, siginfo_t
sinfo, void
ucontext);
| ^~~~~~~~~
stackprof.c: In function 'stackprof_start':
stackprof.c:144:22: error: storage size of 'sa' isn't known
144 | struct sigaction sa;
| ^~
stackprof.c:145:22: error: storage size of 'timer' isn't known
145 | struct itimerval timer;
| ^~~~~
stackprof.c:197:27: error: 'stackprof_signal_handler' undeclared (first use in this function); did you mean 'stackprof_newobj_handler'?
197 | sa.sa_sigaction = stackprof_signal_handler;
| ^~~~~~~~~~~~~~~~~~~~~~~~
| stackprof_newobj_handler
stackprof.c:197:27: note: each undeclared identifier is reported only once for each function it appears in
stackprof.c:198:23: error: 'SA_RESTART' undeclared (first use in this function); did you mean 'DRV_RESTART'?
198 | sa.sa_flags = SA_RESTART | SA_SIGINFO;
| ^~~~~~~~~~
| DRV_RESTART
stackprof.c:198:36: error: 'SA_SIGINFO' undeclared (first use in this function)
198 | sa.sa_flags = SA_RESTART | SA_SIGINFO;
| ^~~~~~~~~~
stackprof.c:199:9: warning: implicit declaration of function 'sigemptyset' [-Wimplicit-function-declaration]
199 | sigemptyset(&sa.sa_mask);
| ^~~~~~~~~~~
stackprof.c:200:9: warning: implicit declaration of function 'sigaction' [-Wimplicit-function-declaration]
200 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~~~
stackprof.c:200:38: error: 'SIGALRM' undeclared (first use in this function); did you mean 'SIGABRT'?
200 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
| SIGABRT
stackprof.c:200:48: error: 'SIGPROF' undeclared (first use in this function)
200 | sigaction(mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~
stackprof.c:205:9: warning: implicit declaration of function 'setitimer'; did you mean 'SetTimer'? [-Wimplicit-function-declaration]
205 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~
| SetTimer
stackprof.c:205:38: error: 'ITIMER_REAL' undeclared (first use in this function)
205 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:205:52: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
205 | setitimer(mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
stackprof.c: In function 'stackprof_stop':
stackprof.c:232:22: error: storage size of 'sa' isn't known
232 | struct sigaction sa;
| ^~
stackprof.c:233:22: error: storage size of 'timer' isn't known
233 | struct itimerval timer;
| ^~~~~
stackprof.c:243:49: error: 'ITIMER_REAL' undeclared (first use in this function)
243 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
stackprof.c:243:63: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'?
243 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0);
| ^~~~~~~~~~~
| TIMERPROC
stackprof.c:246:23: error: 'SA_RESTART' undeclared (first use in this function); did you mean 'DRV_RESTART'?
246 | sa.sa_flags = SA_RESTART;
| ^~~~~~~~~~
| DRV_RESTART
stackprof.c:248:49: error: 'SIGALRM' undeclared (first use in this function); did you mean 'SIGABRT'?
248 | sigaction(_stackprof.mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL);
| ^~~~~~~ | SIGABRT 23:11stackprof.c:248:59: error: 'SIGPROF' undeclared (first use in this function) 248 | sigaction(_stackprof.mode == sym_wall ? SIGALRM : SIGPROF, &sa, NULL); | ^~~~~~~ stackprof.c: At top level: stackprof.c:715:35: error: unknown type name 'siginfo_t' 715 | stackprof_signal_handler(int sig, siginfo_t *sinfo, void *ucontext) | ^~~~~~~~~ stackprof.c: In function 'stackprof_atfork_prepare': stackprof.c:792:22: error: storage size of 'timer' isn't known 792 | struct itimerval timer; | ^~~~~ stackprof.c:796:53: error: 'ITIMER_REAL' undeclared (first use in this function) 796 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0); | ^~~~~~~~~~~ stackprof.c:796:67: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'? 796 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0); | ^~~~~~~~~~~ | TIMERPROC stackprof.c: In function 'stackprof_atfork_parent': stackprof.c:804:22: error: storage size of 'timer' isn't known 804 | struct itimerval timer; | ^~~~~ stackprof.c:810:53: error: 'ITIMER_REAL' undeclared (first use in this function) 810 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0); | ^~~~~~~~~~~ stackprof.c:810:67: error: 'ITIMER_PROF' undeclared (first use in this function); did you mean 'TIMERPROC'? 810 | setitimer(_stackprof.mode == sym_wall ? ITIMER_REAL : ITIMER_PROF, &timer, 0); | ^~~~~~~~~~~ | TIMERPROC make: *** [Makefile:246: stackprof.o] Ошибка 1 make failed, exit code 2 Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/stackprof-0.2.20 for inspection. Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/stackprof-0.2.20/gem_make.out

@NickLaMuro
Copy link
Contributor

NickLaMuro commented Aug 4, 2022

@skvortsovvg There isn't a whole lot of info in this ticket, but it seems like Windows is not really supported for stackprof any more: #153

@skvortsovvg
Copy link
Author

😔 why is this world so hard

@sandstrom
Copy link

Is this an issue with the code itself, or a general question? For general questions Stackoverflow or Github Discussions (if one is setup for this repo) is better than Github.

I'd suggest closing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants