libarchive-ruby
libarchive-ruby copied to clipboard
Unable to compile from git
I'm trying to build libarchive-ruby on an Ubuntu 12.10 64bit machine, with libarchive-dev 3.0.4 installed (using the standard system-provided packages). I've tried using Ruby 1.9.3-p392 (built with/by RVM) and the system-provided Ruby 1.9.3p194. Both fail with the same results:
rmckern@galvatron libarchive-ruby $ rake compile
cd ext
/opt/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for main() in -larchive... yes
checking for archive.h... yes
checking for rb_string_value_cstr() in ruby.h... yes
checking for RETURN_ENUMERATOR in ruby.h... yes
checking for rb_proc_arity() in ruby.h... yes
checking for archive_read_support_format_raw() in archive.h... yes
creating extconf.h
creating Makefile
make
compiling main.cpp
main.cpp:26:7: error: redefinition of ‘VALUE wrap(T*) [with T = rarchive; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:60:14: error: ‘VALUE wrap(T*) [with T = rarchive; VALUE = long unsigned int]’ previously declared here
main.cpp:33:11: error: redefinition of ‘T wrap(const VALUE&) [with T = rarchive*; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:67:18: error: ‘T wrap(const VALUE&) [with T = rarchive*; VALUE = long unsigned int]’ previously declared here
main.cpp:42:7: error: redefinition of ‘VALUE wrap(T*) [with T = archive_entry; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:76:14: error: ‘VALUE wrap(T*) [with T = archive_entry; VALUE = long unsigned int]’ previously declared here
main.cpp:51:16: error: redefinition of ‘T wrap(const VALUE&) [with T = archive_entry*; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:85:23: error: ‘T wrap(const VALUE&) [with T = archive_entry*; VALUE = long unsigned int]’ previously declared here
main.cpp:60:7: error: redefinition of ‘VALUE wrap(T*) [with T = const char; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:94:14: error: ‘VALUE wrap(T*) [with T = const char; VALUE = long unsigned int]’ previously declared here
main.cpp:65:13: error: redefinition of ‘T wrap(const VALUE&) [with T = const char*; VALUE = long unsigned int]’
In file included from main.cpp:23:0:
main.hpp:99:13: error: ‘T wrap(const VALUE&) [with T = const char*; VALUE = long unsigned int]’ previously declared here
make: *** [main.o] Error 1
rake aborted!
Command failed with status (2): [make...]
/tmp/libarchive-ruby/Rakefile.rb:78:in `block in <top (required)>'
/opt/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/opt/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => compile
(See full trace by running task with --trace)
Additionally, on an OS X 10.8.3 machine with Xcode 4.6.2 (and associated command line tools), Ruby 1.9.3-p392 (from RVM), libarchive 3.1.2, and apple-gcc42 (4.2.1-5666.3, and both from Homebrew) I see this problem:
ryan@bender libarchive-ruby $ rake compile
cd ext
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for main() in -larchive... *** 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
--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/rvm/rubies/ruby-1.9.3-p392/bin/ruby
--with-archive-dir
--without-archive-dir
--with-archive-include
--without-archive-include=${archive-dir}/include
--with-archive-lib
--without-archive-lib=${archive-dir}/lib
--with-libarchive-config
--without-libarchive-config
--with-pkg-config
--without-pkg-config
--with-archivelib
--without-archivelib
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:870:in `block in find_library'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:866:in `find_library'
from extconf.rb:31:in `block in <main>'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:535:in `with_cflags'
from extconf.rb:29:in `<main>'
rake aborted!
Command failed with status (1): [/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/...]
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils.rb:45:in `sh'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `sh'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils.rb:82:in `ruby'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/file_utils_ext.rb:37:in `ruby'
/private/tmp/libarchive-ruby/Rakefile.rb:77:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => compile
(See full trace by running task with --trace)
Other binary gems compile and install fine. I am totally stumped.
i fixed the first bug, for the second bug i not know that happens ... you can try to build again but i may no know thats wrong
The second bug seems to have gone away with the fixing of the first, but now I'm seeing this error on the Linux instance: a lot of warnings are thrown to the console, stating that everything in the current directory is excluded. When I try to add files to a new archive I get the same warnings and an empty archive.
rmckern@galvatron ~ $ cd /tmp
rmckern@galvatron tmp $
rmckern@galvatron tmp $ irb
irb(main):001:0> require 'archive'
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./cache.carbon is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./facter is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./bootstrap.tar.bz2 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby-0.0.3.gem is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./pulse-PKdhtXMmr18n is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.ICE-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./facter.tar.bz2 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby-0.0.3 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.X11-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: 0
=> true
irb(main):002:0> a = Archive.new('test.tar.bz2')
=> #<Archive:/tmp/test.tar.bz2>
irb(main):003:0> a << 'libarchive-0.0.3.gem'
(irb):3: warning: ./test.tar.bz2 is excluded
(irb):3: warning: ./cache.carbon is excluded
(irb):3: warning: ./facter is excluded
(irb):3: warning: ./bootstrap.tar.bz2 is excluded
(irb):3: warning: ./libarchive-ruby-0.0.3.gem is excluded
(irb):3: warning: ./pulse-PKdhtXMmr18n is excluded
(irb):3: warning: ./.ICE-unix is excluded
(irb):3: warning: ./facter.tar.bz2 is excluded
(irb):3: warning: ./libarchive-ruby is excluded
(irb):3: warning: ./libarchive-ruby-0.0.3 is excluded
(irb):3: warning: ./.X11-unix is excluded
=> #<Archive:/tmp/test.tar.bz2>
irb(main):004:0>
rmckern@galvatron tmp $ ls -lha test.tar.bz2
-rw-r--r-- 1 rmckern users 42 Apr 18 10:39 test.tar.bz2
rmckern@galvatron tmp $ tar -xvf test.tar.bz2
rmckern@galvatron tmp $
hm oh ok the warnings are part of my testing but your << is wrong its not 'libarchive-0.0.3.gem' its 'libarchive-ruby-0.0.3.gem' (because libarchive was already taken)
After correcting the typo, I'm still getting empty archives (regardless of whether or not I try to add files or directories):
File:
rmckern@galvatron tmp $ irb
irb(main):001:0> require 'archive'
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./test.tar.bz2 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./cache.carbon is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./facter is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./bootstrap.tar.bz2 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby-0.0.3.gem is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./pulse-PKdhtXMmr18n is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.ICE-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./facter.tar.bz2 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby-0.0.3 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.X11-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: 0
=> true
irb(main):002:0> a = Archive.new "test.tar.bz2"
=> #<Archive:/tmp/test.tar.bz2>
irb(main):003:0> a << "./libarchive-ruby-0.0.3.gem"
(irb):3: warning: ./libarchive-ruby-0.0.3.gem is excluded
=> #<Archive:/tmp/test.tar.bz2>
irb(main):004:0>
rmckern@galvatron tmp $ ls -lha test.tar.bz2
-rw-r--r-- 1 rmckern users 42 Apr 18 10:48 test.tar.bz2
rmckern@galvatron tmp $ tar -xvf test.tar.bz2
rmckern@galvatron tmp $
Directory of files:
rmckern@galvatron tmp $ touch test/one
rmckern@galvatron tmp $ touch test/two
rmckern@galvatron tmp $ touch test/three
rmckern@galvatron tmp $ irb
irb(main):001:0> require 'archive'
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./cache.carbon is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./facter is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./test is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./pulse-PKdhtXMmr18n is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.ICE-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./libarchive-ruby-0.0.3 is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: ./.X11-unix is excluded
/opt/rvm/gems/ruby-1.9.3-p392/gems/libarchive-ruby-0.0.3/lib/archive.so: warning: 0
=> true
irb(main):002:0> a = Archive.new "test.tar.bz2"
=> #<Archive:/tmp/test.tar.bz2>
irb(main):003:0> a << "./test"
(irb):3: warning: ./test is excluded
=> #<Archive:/tmp/test.tar.bz2>
irb(main):004:0>
rmckern@galvatron tmp $ ls -lha test.tar.bz2
-rw-r--r-- 1 rmckern users 42 Apr 18 10:50 test.tar.bz2
rmckern@galvatron tmp $ tar -xvf test.tar.bz2
rmckern@galvatron tmp $
okay so it seems its currently broken, but i need more time to fix that. the warings comes from some fnmatch feature i wanted to add ... it seems that it did not work correct :(