I've scoured many examples of projects built with rb-sys. As far as I know, none of them support installing from source with bundle exec rake install. The commands gem install and rake install work out fine, but for a weird reason, bundle exec rake install does not, and the error message is rather cryptic.
On the example repo linked here, on that given tag gh-rb-sys-380, you may run just wipe build followed by just install-bundle-bug and get the following:
mini-me@virtucon ~/h/s/skeleton_rust_gem (develop)> just install-bundle-bug
[...]
bundle exec rake install
cd tmp/x86_64-linux-gnu/skeleton_rust_gem/3.1.2
/usr/bin/ruby3.1 -I. ../../../../ext/skeleton_rust_gem/extconf.rb
checking for x86_64-linux-gnu-gcc... yes
checking for x86_64-linux-gnu-g++... yes
checking for x86_64-linux-gnu-gcc-ar... yes
cd -
cd tmp/x86_64-linux-gnu/skeleton_rust_gem/3.1.2
/usr/bin/gmake
generating /home/mini-me/home/stove/skeleton_rust_gem/target/release/libskeleton_rust_gem.so (release)
cargo rustc --manifest-path /home/mini-me/home/stove/skeleton_rust_gem/ext/skeleton_rust_gem/Cargo.toml --target-dir /home/mini-me/home/stove/skeleton_rust_gem/target --lib --profile release -- -C linker=x86_64-linux-gnu-gcc -L native=/usr/lib -C link-arg=-Wl,-Bsymbolic-functions -C link-arg=-Wl,-z,relro -C link-arg=-Wl,-z,now -C link-arg=-lm
Finished release [optimized] target(s) in 0.09s
cd -
/usr/bin/gmake install sitearchdir=../../../../lib/skeleton_rust_gem sitelibdir=../../../../lib/skeleton_rust_gem target_prefix=
generating /home/mini-me/home/stove/skeleton_rust_gem/target/release/libskeleton_rust_gem.so (release)
cargo rustc --manifest-path /home/mini-me/home/stove/skeleton_rust_gem/ext/skeleton_rust_gem/Cargo.toml --target-dir /home/mini-me/home/stove/skeleton_rust_gem/target --lib --profile release -- -C linker=x86_64-linux-gnu-gcc -L native=/usr/lib -C link-arg=-Wl,-Bsymbolic-functions -C link-arg=-Wl,-z,relro -C link-arg=-Wl,-z,now -C link-arg=-lm
Finished release [optimized] target(s) in 0.09s
installing skeleton_rust_gem.so to ../../../../lib/skeleton_rust_gem
/usr/bin/install -c -m 0755 skeleton_rust_gem.so ../../../../lib/skeleton_rust_gem
cp tmp/x86_64-linux-gnu/skeleton_rust_gem/3.1.2/skeleton_rust_gem.so tmp/x86_64-linux-gnu/stage/lib/skeleton_rust_gem/skeleton_rust_gem.so
skeleton_rust_gem 0.0.1 built to pkg/skeleton_rust_gem-0.0.1.gem.
rake aborted!
Running `gem install /home/mini-me/home/stove/skeleton_rust_gem/pkg/skeleton_rust_gem-0.0.1.gem` failed with the following output:
ERROR: Error installing /home/mini-me/home/stove/skeleton_rust_gem/pkg/skeleton_rust_gem-0.0.1.gem:
ERROR: Failed to build gem native extension.
No such file or directory @ dir_s_mkdir - /home/mini-me/.local/share/gem/ruby/3.1.0/gems/skeleton_rust_gem-0.0.1/ext/skeleton_rust_gem/.gem.20240530-4135307-ysxlwl
Gem files will remain installed in /home/mini-me/.local/share/gem/ruby/3.1.0/gems/skeleton_rust_gem-0.0.1 for inspection.
Results logged to /home/yziquel/.local/share/gem/ruby/3.1.0/extensions/x86_64-linux/3.1.0/skeleton_rust_gem-0.0.1/gem_make.out
/home/mini-me/.local/share/gem/ruby/3.1.0/gems/bundler-2.5.6/lib/bundler/gem_helper.rb:210:in `sh'
/home/mini-me/.local/share/gem/ruby/3.1.0/gems/bundler-2.5.6/lib/bundler/gem_helper.rb:101:in `install_gem'
/home/mini-me/.local/share/gem/ruby/3.1.0/gems/bundler-2.5.6/lib/bundler/gem_helper.rb:57:in `block in install'
/home/mini-me/.local/share/gem/ruby/3.1.0/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => install
(See full trace by running task with --trace)
error: Recipe `install-bundle-bug` failed on line 31 with exit code 1
Some context as to the internals of rb-sys w/r to .gem.20240530-4135307-ysxlwl would be appreciated to unblock me.
Hi.
I've scoured many examples of projects built with rb-sys. As far as I know, none of them support installing from source with
bundle exec rake install
. The commandsgem install
andrake install
work out fine, but for a weird reason,bundle exec rake install
does not, and the error message is rather cryptic.https://github.com/gl-yziquel/skeleton_rust_gem
Tagged: https://github.com/gl-yziquel/skeleton_rust_gem/releases/tag/gh-rb-sys-380
On the example repo linked here, on that given tag gh-rb-sys-380, you may run
just wipe build
followed byjust install-bundle-bug
and get the following:Some context as to the internals of rb-sys w/r to .gem.20240530-4135307-ysxlwl would be appreciated to unblock me.