Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Installation on FreeBSD 9.0 #29

Closed
serxoz opened this issue Nov 15, 2012 · 21 comments
Closed

Installation on FreeBSD 9.0 #29

serxoz opened this issue Nov 15, 2012 · 21 comments
Assignees
Milestone

Comments

@serxoz
Copy link

serxoz commented Nov 15, 2012

trying to install it i get:

gem install oversip

Building native extensions. This could take a while...
ERROR: Error installing oversip:
ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb

creating Makefile

make
compiling stun_ruby.c
stun_ruby.c: In function 'Stun_parse_request':
stun_ruby.c:58: warning: ISO C90 forbids mixed declarations and code
stun_ruby.c:117:22: error: invalid suffix "b00000001" on integer constant
*** Error code 1

hope it helps you

@ibc
Copy link
Member

ibc commented Nov 15, 2012

Hi, that was fixed in master branch:

But don't use master branch please, it's unstable for now. Let me to release OverSIP 1.3.3 today or tomorrow with this change applied.

@serxoz
Copy link
Author

serxoz commented Nov 15, 2012

Oh, i haven't seen that issue (#23)
Thank you for your quick answer.
I'm going to wait for 1.3.3 release but don't stress yourself :D

@ibc
Copy link
Member

ibc commented Nov 15, 2012

Fixed in 834462a and included in version 1.3.3.

@ibc ibc closed this as completed Nov 15, 2012
@ibc
Copy link
Member

ibc commented Nov 15, 2012

OverSIP 1.3.3 has been released fixing this bug: http://oversip.net/news/2012-11-15/

Thanks a lot.

@serxoz
Copy link
Author

serxoz commented Nov 16, 2012

Thank you with you fast release of new version but installing 1.3.3 on FreeBSD now it gives another error:
ip_utils.h:38: error: 'AF_INET' undeclared (first use in this function)

this is full log:
/usr/local/bin/ruby extconf.rb
creating Makefile

make
compiling haproxy_protocol.c
haproxy_protocol.rl: In function 'struct_haproxy_protocol_parser_execute':
haproxy_protocol.rl:61: warning: unused variable 'mark'
haproxy_protocol.rl:63: warning: 'haproxy_protocol.ip_type' may be used uninitialized in this function
compiling utils_ruby.c
In file included from utils_ruby.c:3:
ip_utils.h: In function 'utils_compare_pure_ips':
ip_utils.h:38: warning: implicit declaration of function 'inet_pton'
In file included from utils_ruby.c:4:
utils_ruby.h: In function 'utils_normalize_ipv6':
utils_ruby.h:60: warning: implicit declaration of function 'inet_ntop'
In file included from utils_ruby.c:4:
utils_ruby.h:75:7: warning: no newline at end of file
In file included from utils_ruby.c:5:
../common/c_util.h: In function 'str_to_int':
../common/c_util.h:19: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_is_ip':
utils_ruby.c:24: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_is_pure_ip':
utils_ruby.c:43: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_ip_type':
utils_ruby.c:69: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_compare_ips':
utils_ruby.c:104: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_compare_pure_ips':
utils_ruby.c:157: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_normalize_ipv6':
utils_ruby.c:207: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_normalize_host':
utils_ruby.c:237: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_to_pure_ip':
utils_ruby.c:270: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_parser_outbound_udp_flow_token':
utils_ruby.c:298: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: In function 'Utils_parser_haproxy_protocol':
utils_ruby.c:341: warning: ISO C90 forbids mixed declarations and code
utils_ruby.c: At top level:
../common/c_util.h:39: warning: 'strnchr' defined but not used
../common/c_util.h:53: warning: 'str_find_upcase' defined but not used
../common/c_util.h:66: warning: 'downcase_char' defined but not used
compiling outbound_utils.c
outbound_utils.rl: In function 'outbound_udp_flow_token_parser_execute':
outbound_utils.rl:69: warning: comparison between signed and unsigned
outbound_utils.rl:53: warning: unused variable 'mark'
outbound_utils.rl:55: warning: 'outbound_udp_flow_token.ip_type' may be used uninitialized in this function
compiling ip_utils.c
In file included from ip_utils.rl:2:
ip_utils.h: In function 'utils_compare_pure_ips':
ip_utils.h:38: warning: implicit declaration of function 'inet_pton'
ip_utils.h:38: error: 'AF_INET' undeclared (first use in this function)
ip_utils.h:38: error: (Each undeclared identifier is reported only once
ip_utils.h:38: error: for each function it appears in.)
ip_utils.h:47: error: 'AF_INET6' undeclared (first use in this function)
ip_utils.rl: In function 'utils_ip_parser_execute':
ip_utils.rl:48: warning: comparison between signed and unsigned
*** Error code 1

Stop in /usr/local/lib/ruby/gems/1.9.1/gems/oversip-1.3.3/ext/utils.

hope it helps you ;D

@ghost ghost assigned ibc Nov 16, 2012
@ibc
Copy link
Member

ibc commented Nov 16, 2012

Interesting, so I must add something for BSD systems in order to find AF_INET and AF_INET6 defines... Let me take a look to it.

Thanks for the report.

@ibc
Copy link
Member

ibc commented Nov 16, 2012

Can you use branch "v1.3.x" and test if it compiles (by running rake)? I've made a commit that may fix the issue in FreeBSD: d9fc237

@serxoz
Copy link
Author

serxoz commented Nov 16, 2012

seems like missing headers (edit: more like an error in stud Makefile)

[...]
ws_http_parser_ruby.c: In function 'HttpRequestParser_is_finished':
ws_http_parser_ruby.c:564: warning: ISO C90 forbids mixed declarations and code
ws_http_parser_ruby.c: In function 'HttpRequestParser_nread':
ws_http_parser_ruby.c:581: warning: ISO C90 forbids mixed declarations and code
ws_http_parser_ruby.c: At top level:
../utils/ip_utils.h:22: warning: 'utils_compare_pure_ips' defined but not used
../common/c_util.h:66: warning: 'downcase_char' defined but not used
../common/ruby_c_util.h:21: warning: 'my_rb_str_hex_unescape' defined but not used
ws_http_parser_ruby.c: In function 'req_uri_scheme':
ws_http_parser_ruby.c:103: warning: 'v' may be used uninitialized in this function
linking shared-object oversip/websocket/ws_http_parser.so
cp ext/websocket_http_parser/ws_http_parser.so lib/oversip/websocket/
mkdir -p tmp
/usr/local/bin/ruby extconf.rb
system command: tar -zxf stud.tar.gz
system command: make
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
extconf.rb:8:in sys': system commandmake' failed (RuntimeError)
from extconf.rb:21:in block (2 levels) in <main>' from extconf.rb:20:inchdir'
from extconf.rb:20:in block in <main>' from extconf.rb:18:inchdir'
from extconf.rb:18:in <main>' rake aborted! Command failed with status (1): [/usr/local/bin/ruby extconf.rb...] /root/OverSIP-1.3.x/Rakefile:31:inblock (2 levels) in <top (required)>'
/root/OverSIP-1.3.x/Rakefile:30:in chdir' /root/OverSIP-1.3.x/Rakefile:30:inblock in <top (required)>'
Tasks: TOP => default => compile => bin/oversip_stud
(See full trace by running task with --trace)

and thirdparty/stud/mkmf.log paste:

"tar -zxf stud.tar.gz"
make
"Makefile", line 17: Missing dependency operator
"Makefile", line 29: Need an operator
"Makefile", line 32: Missing dependency operator
"Makefile", line 34: Need an operator
make: fatal errors encountered -- cannot continue

@serxoz
Copy link
Author

serxoz commented Nov 16, 2012

I can provide you a shell on a testing server with FreeBSD 9.0 if you want.
Send me an email to sergio at cotelo dot net

@ibc
Copy link
Member

ibc commented Nov 16, 2012

Honestly I have no idea about FreeBSD, but I could try. So the problem seems more related to stud's Makefile, right?

PS: I will ask you for the shell, thanks a lot.

@serxoz
Copy link
Author

serxoz commented Nov 16, 2012

I'm testing FreeBSD too :D
And yes on mkmf.log seems like Makefile should be tune to work on BSD hence the offer of the shell :D
I think that way it will be easy for you to make tests.

@ibc
Copy link
Member

ibc commented Nov 16, 2012

There is a related commit in stud, "Fixes for FreeBSD 9 build": bumptech/stud@e42f311

However such a commit is already present in the stud tar.gz provided by OverSIP so...

@ibc
Copy link
Member

ibc commented Nov 16, 2012

Bug reported in Stud: bumptech/stud#127

@serxoz
Copy link
Author

serxoz commented Nov 16, 2012

:D

@gvoider
Copy link

gvoider commented Mar 24, 2013

Had the same - that problem gets fixed by switching stud compiler to gmake.
unpack the oversip git, edit file: /ext/stud/extconf.rb replace
sys("make")
with
sys("gmake")
and rebuild the git.

@ibc
Copy link
Member

ibc commented Mar 25, 2013

@gvoider would that also work in Linux? Or maybe I should call sys("make") or sys("gmake") in runtime by detecting the OS?

@ibc
Copy link
Member

ibc commented Mar 25, 2013

@gvoider could you please run the following command in FreeBSD and paste the result?

require "rbconfig"

puts RbConfig::CONFIG["host_os"]

@gvoider
Copy link

gvoider commented Mar 25, 2013

sure

freebsd9.0

@ibc
Copy link
Member

ibc commented Mar 25, 2013

Thanks, may be you could try the same in other BSD host (i.e. some OpenBSD and others)? Or maybe we could assume that RbConfig::CONFIG["host_os"] will always return something mathing /bsd/i, right?

@gvoider
Copy link

gvoider commented Mar 25, 2013

Sorry, I don't have access to other BSD hosts, only FreeBSD... I think sor, /bsd/ .

@ibc ibc closed this as completed in ddf76fb Mar 25, 2013
@ibc
Copy link
Member

ibc commented Mar 25, 2013

@gvoider could you please with branch "v1.3.x" which also includes the fix in ddf76fb? If it works I will release 1.3.8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants