Project

General

Profile

Actions

Bug #10558

closed

failing require digest.so on OSX statically compiled ruby

Added by mpapis (Michal Papis) over 9 years ago. Updated almost 8 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
2.2.0-preview2
[ruby-core:66597]

Description

compiling 2.2.0-preview2 and 2.2.0-preview1 with following flags:

env LDFLAGS=-L/Users/mpapis/.sm/pkg/active/lib -fPIC -Bstatic CFLAGS=-O3 -I/Users/mpapis/.sm/pkg/active/include -fPIC -mmacosx-version-min=10.7 ./configure --prefix=/Users/mpapis/.rvm/rubies/ruby-2.2.0-preview2 --disable-install-doc --enable-load-relative --with-static-linked-ext --with-out-ext=dl/win32,fiddle/win32,tk/tkutil,tk,win32ole,-test-/win32/dln,-test-/win32/fd_setsize --sysconfdir=/etc --disable-install-doc --disable-shared --with-arch=x86_64

it compiles but files on installation with:

/Users/travis/.rvm/src/ruby-2.2.0-preview2/.ext/common/digest.rb:1:in require': cannot load such file -- digest.so (LoadError)` (got the command and error from different machines)

this bug was reported earlier as https://bugs.ruby-lang.org/issues/8721 but now it happens on multiple machines, can not ignore it

this prevents from building a movable OSX ruby binary

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Status changed from Open to Feedback

I can't reproduce it.

$ LDFLAGS="-fPIC -Bstatic" CFLAGS="-O3 -fPIC -mmacosx-version-min=10.7" ../src/configure --prefix=$HOME/.rvm/rubies/ruby-2.2.0-preview2 --disable-install-doc --enable-load-relative --with-static-linked-ext --with-out-ext='win32*,tk*' --sysconfdir=/etc --disable-install-doc --disable-shared --with-arch=x86_64
(snip)
$ make -j8 && make install
(snip)
$ ~/.rvm/rubies/ruby-2.2.0-preview2/bin/ruby -e 'puts $".grep(/digest/)'
digest.so
/Users/nobu/.rvm/rubies/ruby-2.2.0-preview2/lib/ruby/2.2.0/digest.rb
digest/bubblebabble.so
digest/md5.so
digest/rmd160.so
digest/sha1.so
digest/sha2.so

Updated by rkh (Konstantin Haase) over 9 years ago

This is failing on Travis CI and unfortunately preventing us from offering 2.2.0-preview2.

See https://travis-ci.org/travis-ci/travis-rubies/jobs/42454368#L194

Konstantin

Updated by mpapis (Michal Papis) over 9 years ago

Nobuyoshi Nakada what OSX version are you trying? mine was 10.10, also could it make difference if it was compiled in sources directory instead of ../src?

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

Mine is also 10.10.
And I heard that it occurs with 2.1 but not with trunk.

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

I can't reproduce it:

  • plain ruby-2.1.5 tarball
  • in-place build
  • without ~/.sm/pkg/active directories

What libraries do you have under ~/.sm/pkg/active/lib?
Isn't ruby linked against a library there?

Updated by mpapis (Michal Papis) over 9 years ago

it's few libraries, most important here openssl 1.0.1j:

CFLAGS="-fPIC" LDFLAGS="-fPIC" ./Configure darwin64-x86_64-cc zlib no-shared --openssldir=/etc/openssl --prefix=~/openssl101j
make install -j 1
sed -e '/^Libs:/ s/Libs:/Libs: -lz/' -i ~/openssl101j/lib/pkgconfig/openssl.pc

and use ~/openssl101j for the -I/-L flags

Updated by mpapis (Michal Papis) over 9 years ago

looks like release fixed it: https://github.com/wayneeseguin/rvm/issues/3165#issuecomment-68320898 -- maybe something on the way was fixed

Updated by nobu (Nobuyoshi Nakada) almost 8 years ago

  • Status changed from Feedback to Third Party's Issue
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0