Getting error when trying to bundle fast_stack on windows - windows

I'm trying to understand how to fix error:
C:\inetpub\wwwroot\DISCOU~2>gem install fast_stack
ERROR: Error installing fast_stack:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR="
generating fast_stack-i386-mingw32.def
compiling fast_stack.c
In file included from c:/Ruby200/include/ruby-2.0.0/ruby/defines.h:153:0,
from c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200/include/ruby-2.0.0/ruby.h:33,
from fast_stack.c:3:
c:/Ruby200/include/ruby-2.0.0/ruby/win32.h:276:12: error: conflicting types for 'gettimeofday'
In file included from fast_stack.c:2:0:
c:\ruby200\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/sys/time.h:42:13: note: previous declaration of 'gettimeofday' was here
fast_stack.c: In function 'rb_profile_start':
fast_stack.c:9:22: error: storage size of 'timer' isn't known
fast_stack.c:11:34: error: 'suseconds_t' undeclared (first use in this function)
fast_stack.c:11:34: note: each undeclared identifier is reported only once for each function it appears in
fast_stack.c:11:46: error: expected ';' before 'rb_num2long_inline'
fast_stack.c:13:5: warning: implicit declaration of function 'setitimer' [-Wimplicit-function-declaration]
fast_stack.c:13:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:9:22: warning: unused variable 'timer' [-Wunused-variable]
fast_stack.c: In function 'rb_profile_stop':
fast_stack.c:21:22: error: storage size of 'timer' isn't known
fast_stack.c:23:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:21:22: warning: unused variable 'timer' [-Wunused-variable]
make: *** [fast_stack.o] Error 1
Gem files will remain installed in C:/inetpub/wwwroot/DISCOU~2/GEM_HOME/gems/fast_stack-0.1.0 for inspection.
It happens when I write "bundle install" command for the discourse.org application installing on Helicon Zoo environment.

It appears that it's not the Zoo itself, more issue with the gem. Try to install it separately, outside the environment of Zoo. Simply Ruby, in test catalog, but outside the Zoo. If that's working, contact HeliconTech directly and address as an issue, they're quite quick and good at fixing these things.

Related

Rbenv install of ruby 2.7.2 fails with the error [make: *** [Makefile:271: miniruby] Error 1] on termux-rooted

I am on android 7.1 running termux. I have recently installed rbenv to install ruby 2.7.2. Since the new ruby 3.0 release most of the tools have been broken. Ex:Metasploit. I have all the required dependencies. I have tried rbenv install 2.7.2 and RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.7.2. It gives me this error when I type rbenv install 2.7.2`
ERROR:
Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
BUILD FAILED (Linux 3.10.49-gd9886247 using ruby-build 20210119)
Inspect or clean up the working tree at /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E
Results logged to /data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.log
Last 10 log lines:
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:271: miniruby] Error 1
I have gave up after trying to fix this after 4 hours.
Here is the log file
compiling array.c
compiling mjit.c
WARNING: linker: /data/data/com.termux/files/home/.rbenv/versions/2.5.3/bin/ruby: unsupported flags DT_FLAGS_1=0x8000001
compiling coroutine/ucontext/Context.c
In file included from coroutine/ucontext/Context.c:14: coroutine/ucontext/Context.h:32:5: warning: implicitly declaring library function 'getcontext' with type 'int (ucontext_t *)' (aka 'int (struct ucontext *)') [-Wimplicit-function-dec
laration] getcontext(&context->state); ^
coroutine/ucontext/Context.h:32:5: note: include the header <setjmp.h> or explicitly provide a declaration for 'getcontext' coroutine/ucontext/Context.h:51:5: warning: implicit declaration of function 'makecontext' is invalid in C99 [-Wimplicit-function-declaration]
makecontext(&context->state, (void(*)(void))coroutine_trampoline, 2, (void*)start, (void*)context);
^
coroutine/ucontext/Context.h:59:5: warning: implicit declaration of function 'swapcontext' is invalid in C99 [-Wimplicit-function-declaration]
swapcontext(&current->state, &target->state);
^
3 warnings generated.
compiling enc/ascii.c
compiling enc/us_ascii.c
compiling enc/unicode.c compiling enc/utf_8.c
compiling enc/trans/newline.c
./revision.h unchanged
compiling version.c
1 warning generated.
building rb_mjit_header.h
linking miniruby
rb_mjit_header.h updated
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:51: undefined reference to `makecontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_initialize_main':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:32: undefined reference to `getcontext'
/data/data/com.termux/files/usr/bin/ld: cont.o: in function `coroutine_transfer':
/data/data/com.termux/files/usr/tmp/ruby-build.20210215164020.20674.SccO9E/ruby-2.7.2/./coroutine/ucontext/Context.h:59: undefined reference to `swapcontext'
clang-11: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [Makefile:271: miniruby] Error 1
I have no idea what to do. I am a noob , So please explain what to do and THANKS in advance.

Installing gosu on FreeBSD

I'm trying to install this Ruby gem on FreeBSD, and it's failing with the following error:
# gem install gosu
Building native extensions. This could take a while...
ERROR: Error installing gosu:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
/usr/local/bin/ruby24 -I /usr/local/lib/ruby/site_ruby/2.4 -r ./siteconf20190322-6847-x8s25j.rb extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
cat: /proc/cpuinfo: No such file or directory
checking for -lopenal... yes
checking for AL/al.h... yes
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:17:
../../src/SndFile.hpp:111:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
../../src/SndFile.hpp:123:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
2 warnings generated.
compiling ../../src/AudioImpl.cpp
compiling ../../src/Bitmap.cpp
compiling ../../src/BitmapIO.cpp
compiling ../../src/BlockAllocator.cpp
compiling ../../src/Channel.cpp
compiling ../../src/Color.cpp
compiling ../../src/DirectoriesApple.cpp
compiling ../../src/DirectoriesUnix.cpp
compiling ../../src/DirectoriesWin.cpp
compiling ../../src/FileUnix.cpp
../../src/FileUnix.cpp:53:47: error: use of undeclared identifier 'S_IRUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:55: error: use of undeclared identifier 'S_IWUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:63: error: use of undeclared identifier 'S_IRGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:71: error: use of undeclared identifier 'S_IWGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:79: error: use of undeclared identifier 'S_IROTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:87: error: use of undeclared identifier 'S_IWOTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
6 errors generated.
*** Error code 1
Stop.
make: stopped in /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
Other things I tried:
Switching compilers - from clang and c++ to g++ and gcc.
Cloning the repository and building "manually" - got the same errors.
Is it even possible to install it on FreeBSD? Searches didn't return anything useful.
On FreeBSD system headers are organized slightly differently than in Linux.
Quick man lookup reveals, that you need to
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
to make these definitions visible.

Failing to install Stalin Scheme on OSX because it is "not supported yet" - is there any workaround?

I've downloaded Stalin Scheme and tried to install it on OSX, but I've got this error:
gcc -O -I./include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS -DLARGE_CONFIG -DUSE_MMAP -DDONT_ADD_BYTE_AT_END -o if_mach ./if_mach.c
In file included from ./if_mach.c:3:
./include/private/gcconfig.h:477: error: expected identifier or ‘(’ before ‘--’ token
./if_mach.c: In function ‘main’:
./if_mach.c:14: error: ‘MACH_TYPE’ undeclared (first use in this function)
./if_mach.c:14: error: (Each undeclared identifier is reported only once
./if_mach.c:14: error: for each function it appears in.)
make: *** [if_mach] Error 1
cp: gc6.8/gc.a: No such file or directory
ranlib: can't open file: include/libgc.a (No such file or directory)
Cannot (yet) run Stalin on this architecture
Is there any workaround for this?

Error compiling imapfilter 2.4.1 in CentOS 5.6

I am trying to compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in CentOS 5.6. I believe I've got all the dependencies sorted but when I run make I get:
make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2
Based on other user comments and file revision dates I am sure this should compile. I am guessing I'm missing a library somewhere. I'll appreciate any help I can get on this.
Starting from first error message:
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
Line 41 of core.c is:
static const luaL_reg ifcorelib[] = {
Cryptic message from gcc means that it knows nothing about what is the luaL_reg and it thinks that it is variable name. Then it goes into panic when reads second variable name in the same definition/declaration. luaL_reg should be something like struct.
So, it seems that your problems are located in LUA development headers. May be you have too old or even to modern Lua package.
The imapfilter's github's readme says:
Compile time requirements are Lua (version 5.1)
Are you sure that your lua is 5.1 and the lua-devel (or any other package with lua headers) is 5.1 too?

error at building libjingle on Mac OS X 10.7.2 like "error: string.h: No such file or directory"

I failed to build libjingle on Mac OS X 10.7.2. The output was the following when I run $path_to_swtoolkit/hammer.sh according to the README of libjingle.
MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh
scons: Reading SConscript files ...
scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead.
File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts
scons: done reading SConscript files.
scons: Building targets ...
________Compiling build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o
third_party/expat-2.0.1/lib/xmlparse.c:6:48: error: string.h: No such file or directory
third_party/expat-2.0.1/lib/xmlparse.c:7:20: error: assert.h: No such file or directory
In file included from third_party/expat-2.0.1/lib/xmlparse.c:24:
third_party/expat-2.0.1/lib/expat.h:17:20: error: stdlib.h: No such file or directory
cc1: warnings being treated as errors
third_party/expat-2.0.1/lib/xmlparse.c: In function 'parserCreate':
third_party/expat-2.0.1/lib/xmlparse.c:719: warning: implicit declaration of function 'malloc'
third_party/expat-2.0.1/lib/xmlparse.c:719: warning: incompatible implicit declaration of built-in function 'malloc'
third_party/expat-2.0.1/lib/xmlparse.c:723: error: 'realloc' undeclared (first use in this function)
third_party/expat-2.0.1/lib/xmlparse.c:723: error: (Each undeclared identifier is reported only once
third_party/expat-2.0.1/lib/xmlparse.c:723: error: for each function it appears in.)
third_party/expat-2.0.1/lib/xmlparse.c:724: error: 'free' undeclared (first use in this function)
third_party/expat-2.0.1/lib/xmlparse.c: In function 'parserInit':
third_party/expat-2.0.1/lib/xmlparse.c:848: warning: implicit declaration of function 'memset'
third_party/expat-2.0.1/lib/xmlparse.c:848: warning: incompatible implicit declaration of built-in function 'memset'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_Parse':
third_party/expat-2.0.1/lib/xmlparse.c:1543: warning: implicit declaration of function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c:1543: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_GetBuffer':
third_party/expat-2.0.1/lib/xmlparse.c:1627: warning: implicit declaration of function 'memmove'
third_party/expat-2.0.1/lib/xmlparse.c:1627: warning: incompatible implicit declaration of built-in function 'memmove'
third_party/expat-2.0.1/lib/xmlparse.c:1656: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_GetParsingStatus':
third_party/expat-2.0.1/lib/xmlparse.c:1750: warning: implicit declaration of function 'assert'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'storeRawNames':
third_party/expat-2.0.1/lib/xmlparse.c:2009: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'doContent':
third_party/expat-2.0.1/lib/xmlparse.c:2424: warning: implicit declaration of function 'memcmp'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'storeAtts':
third_party/expat-2.0.1/lib/xmlparse.c:2922: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c:2931: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'addBinding':
third_party/expat-2.0.1/lib/xmlparse.c:3039: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'lookup':
third_party/expat-2.0.1/lib/xmlparse.c:5871: warning: incompatible implicit declaration of built-in function 'memset'
third_party/expat-2.0.1/lib/xmlparse.c:5898: warning: incompatible implicit declaration of built-in function 'memset'
third_party/expat-2.0.1/lib/xmlparse.c:5927: warning: incompatible implicit declaration of built-in function 'memset'
third_party/expat-2.0.1/lib/xmlparse.c: In function 'poolGrow':
third_party/expat-2.0.1/lib/xmlparse.c:6112: warning: incompatible implicit declaration of built-in function 'memcpy'
third_party/expat-2.0.1/lib/xmlparse.c:6148: warning: incompatible implicit declaration of built-in function 'memcpy'
scons: *** [build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o] Error 1
scons: building terminated because of errors.
I'm sure about the existence of string.h, assert.h and so on in my Mac.
I also tried cd to the directory expat-2.0.1 and run ./configure and make, and succeeded.
I've searched the web for this problem and it seems nothing useful to me. So, if you know why, thank you for telling me!
P.S My problem seems to be like this one: http://groups.google.com/group/googletestframework/browse_thread/thread/e8ed5a3f410b7ec7/a8ba72e727801fc8?show_docid=a8ba72e727801fc8
I had the same problem with lion. As wayon pointed out it's appears the developers hardcoded a particular SDK version "/Developer/SDKs/MacOSX10.5.sdk". As of the time of posting, the latest version is 10.7 which comes with Xcode 4. After fixing that there were a couple other issues with the build, I'm not sure if they're related to OS X or just a broken build script for lib jingle.
Here's the patch which fixes the other issues I found, libjingle patch.
Also, you'll probably have to fix swtoolkit via stackoverflow swtoolkit fix.
I haven't checked if the unit tests pass, but at least it compiles now.
I had the same issue.
In my case the issue was caused by the wrong CCFLAGS in the main.scons file in the directory 'talk' (top level of the source tree).
There was a wrong path for '-isysroot' argument:
CCFLAGS = [
'-arch', 'i386',
'-isysroot', '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk',
'-fasm-blocks',
],
There was not iPhoneSimulator4.0.sdk on my mac, only iPhoneSimulator4.3.sdk and iPhoneSimulator5.0.sdk.
So, I just replaced 4.0 to 5.0 and got the following:
CCFLAGS = [
'-arch', 'i386',
'-isysroot', '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk',
'-fasm-blocks',
],
It helped to me.
To resolve the issue try the following:
Check what version of sdk you've got in the folder /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
Set an appropriate path for -isysroot argument in the main.scons file at the top of source tree (in my case it's ilibjingle/gtalk/libjingle-0.5/talk):
Then try to run $path_to_swtoolkit/hammer.sh again.
I hope it will help you.
Try to add the following include to your main.scons file:
main.scons:
... // more than 300 lines and the you will find the mac_env section
mac_env.Append(
CPPDEFINES = [
'OSX',
],
CCFLAGS = [
'-m32',
'-arch', 'i386',
'-isysroot', '/Developer/SDKs/MacOSX10.5.sdk',
'-fasm-blocks',
'-I/usr/include', <--- Add this line and this will tell to scons where is your includes
...

Resources