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

make install no longer respects lib_binary_dir_path #196

Closed
konsolebox opened this issue Dec 11, 2021 · 6 comments
Closed

make install no longer respects lib_binary_dir_path #196

konsolebox opened this issue Dec 11, 2021 · 6 comments

Comments

@konsolebox
Copy link
Contributor

So I have a gem with a tree structure looking like this:

ext/digest/xxhash/ext.c
lib/digest/xxhash/version.rb

And before #191 was merged, I was able to configure rake-compiler like this:

Rake::ExtensionTask.new('digest/xxhash', Bundler::GemHelper.gemspec)

This is because binary_path is generated from name which contains the partial directory path digest, and the old install command, install tmp_binary_path, "#{lib_path}/#{binary_path}" refers to it.

But now I have to manually specify directories:

Rake::ExtensionTask.new('xxhash', Bundler::GemHelper.gemspec) do |task|
  task.ext_dir = "ext/digest/xxhash"
  task.lib_dir = "lib/digest"
end

I'm not sure but maybe it has to do with the line siteconf.puts "dest_path = mkintpath(#{File.expand_path(lib_path).dump})". Instead of lib_path, it should specify lib_binary_dir_path instead.

Maybe specifying name with a subdirectory is illegal but if that's the case, what's the point of calculating and using lib_binary_dir_path as an argument to directory, and as a requirement argument instead of just using lib_path.

@konsolebox
Copy link
Contributor Author

Also I did modify rake-compiler to use lib_binary_dir_path, installed it, and tested it against my gem with the Rake::ExtensionTask.new line reverted to the old one and it worked.

@kou
Copy link
Member

kou commented Dec 11, 2021

Is the your gem https://github.com/konsolebox/digest-xxhash-ruby ?
How to reproduce your problem?

@kou kou closed this as completed in 92b2d3e Dec 11, 2021
@konsolebox
Copy link
Contributor Author

One way to reproduce this is by cloning the repo to a temporary directory, checkout the v0.2.1 tag, install rake-compiler 1.1.3 or 1.1.4, then run rake test.

git clone https://github.com/konsolebox/digest-xxhash-ruby.git
cd digest-xxhash-ruby
git checkout v0.2.1
bundle
rake test

The significant output lines should be something like this:

/usr/bin/gmake install target_prefix=
/usr/bin/install -c -m 0755 xxhash.so /var/tmp/t/digest-xxhash-ruby/lib
cp tmp/x86_64-linux/digest/xxhash/3.0.2/digest/xxhash.so tmp/x86_64-linux/stage/lib/digest/xxhash.so
/usr/bin/ruby30 -w -I"lib" /usr/lib64/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader.rb "test/test.rb" 
<internal:/usr/lib64/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- /var/tmp/t/digest-xxhash-ruby/test/../lib/digest/xxhash (LoadError)

You can see that xxhash.so is copied to /lib instead of /lib/digest.

Here's also a failing log in AppVeyor: https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby/builds/41851529/job/9st82d9etf11w5q9

@kou
Copy link
Member

kou commented Dec 11, 2021

Could you try 1.1.5?

@konsolebox
Copy link
Contributor Author

I tested it locally and also in AppVeyor. It looks fixed: https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby/builds/41857053

@konsolebox
Copy link
Contributor Author

Thanks a lot!

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

2 participants