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

Gem faster_path built by thermite trying to load a dylib file from user travis instead of current user #48

Open
PikachuEXE opened this issue Mar 8, 2018 · 6 comments

Comments

@PikachuEXE
Copy link

I am testing gem faster_path without installing rust
https://github.com/danielpclark/faster_path/issues/143

When using ruby 2.5.0 I got an error when requiring faster_path
It looks like the gem is trying to load a /Users/travis/.rvm/rubies/ruby-2.5.0/lib/libruby.2.5.dylib
But it should be loading /users/pikachuexe/.rvm/rubies/ruby-2.5.0/lib/libruby.2.5.dylib
No error occur in other ruby versions though

Error message and other details:
danielpclark/faster_path#143 (comment)

@malept
Copy link
Owner

malept commented Mar 8, 2018

Hmmm. This shouldn't happen due to

def prepare_downloaded_library
return unless config.target_os.start_with?('darwin')
libruby_path = Shellwords.escape(config.libruby_path)
library_path = Shellwords.escape(config.ruby_extension_path)
`install_name_tool -id #{library_path} #{library_path}`
`install_name_tool -change @libruby_path@ #{libruby_path} #{library_path}`
end

(when the tarball is created) and

def prepare_built_library
return unless config.target_os.start_with?('darwin')
libruby_path = Shellwords.escape(config.libruby_path)
library_path = Shellwords.escape(config.ruby_extension_path)
`install_name_tool -change #{libruby_path} @libruby_path@ #{library_path}`
end

(when the Rust extension is installed locally). I'd have to test on a Mac with Ruby 2.5, although I'm not sure when I'd have time.

@PikachuEXE
Copy link
Author

Is possible to output some logging to debug this situation?
And check the difference of logs between ruby 2.5 and other ruby versions

@malept
Copy link
Owner

malept commented Mar 8, 2018

Installing gems makes it very irritating to log things to stdout/stderr, so there's an environment variable you can set.

@PikachuEXE
Copy link
Author

PikachuEXE commented Mar 8, 2018

2.3.6

Unpacking GitHub release from Cargo version: faster_path-0.0.1-ruby2.3.6-darwin16-x86_64.tar.gz
Unpacking file: lib/faster_path.so

2.4.3

Unpacking GitHub release from Cargo version: faster_path-0.0.1-ruby2.4.3-darwin16-x86_64.tar.gz
Unpacking file: lib/faster_path.so

2.5.0

Unpacking GitHub release from Cargo version: faster_path-0.0.1-ruby2.5.0-darwin16-x86_64.tar.gz
Unpacking file: lib/faster_path.so

@malept
Copy link
Owner

malept commented Mar 8, 2018

Looks like it needs more debug logging.

@danielpclark
Copy link

The patches for steveklabnik/ruby-sys#31 and d-unsed/ruru#95 make this issue go away. That's not to say this issue still isn't possible for others who still keep using the older version.

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