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
--ext=rust
unexpected build and install behavior
#6268
Comments
The Rust extension build process needs to eliminate an extra directory level copied from cargo. Actual Expected |
On Ubuntu, it's also a problem:
and it's dropping another copy in the source directory:
Please stop these kind of files and directories pollution and churn when things should go in one place and never change. It should only be here:
or perhaps the "old way" was here:
|
How this differs? |
Rust extensions are installed in wrong directory, that's know problem (#6204). There are various reasons why two directories are used for extensions these days (for dev purpose and git sources). Feel free to join us at #6204 with your ideas and suggestions. |
I fixed this already. |
Can you provide more details? Is #6269 your take on fixing this you mean? |
@simi Your "take" didn't do any good because it's still broken. |
@steakknife hi. this is your warning under the conduct policy for the RubyGems issue tracker. If you're going to be rude and belligerent, we're just going to block you, even if you are reporting genuine issues. Please engage cooperatively and productively, so we don't have to do that. |
? |
To make it clear, RubyGems 3.4.6 is needed to fix the install problem of Rust ( Steps to reproduce the original problem and also steps to fix it. # prepare the gem
$ gem install bundler:2.4.6 # install current bundler
$ bundle _2.4.6_ gem --ext=rust hello # generate gem skeleton using specified bundler
$ cd hello # step into gem directory
$ cargo generate-lockfile # generate Cargo.lock
$ git add Cargo.lock # add Cargo.lock to git to make it into spec.files
$ gem build --force # build gem, ignore strict errors like TODO metadata # install using RubyGems 3.4.5 (before install was fixed)
$ gem update --system 3.4.5 # set RubyGems version
$ gem install hello-0.1.0.gem # install the gem
$ ruby -rhello -e "puts Hello.hello('World')" # running gem method result into require error
/home/retro/.gem/ruby/3.2.0/gems/hello-0.1.0/lib/hello.rb:4:in `require_relative': cannot load such file -- /home/retro/.gem/ruby/3.2.0/gems/hello-0.1.0/lib/hello/hello (LoadError)
from /home/retro/.gem/ruby/3.2.0/gems/hello-0.1.0/lib/hello.rb:4:in `<top (required)>'
from <internal:/home/retro/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:159:in `require'
from <internal:/home/retro/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:159:in `rescue in require'
from <internal:/home/retro/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
<internal:/home/retro/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- hello (LoadError)
from <internal:/home/retro/.rubies/ruby-3.2.0/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require' # install using RubyGems 3.4.6 (with fix included)
$ gem update --system 3.4.5 # set RubyGems version
$ gem install hello-0.1.0.gem # install the gem
$ ruby -rhello -e "puts Hello.hello('World')" # running gem method works as intended
Hello from Rust, World!
|
Related but different from #6204 which also appears to be a problem.
Describe the problem as clearly as you can
bundle gem example --ext=rust
doesn't mirror build and install behavior of native C extensions.Did you try upgrading rubygems & bundler?
Post steps to reproduce the problem
MCE Dockerfile
Which command did you run?
docker build .
What were you expecting to happen?
Rust native ext compiles at user-level
gem install
time.If a user doesn't have rust, it's the same as not having a C toolchain. Maintainers can push precompiled
--platform
flavors of a release to rubygems, or not. Don't try to do parts of both, and especially not for a--platform=ruby
gem.What actually happened?
gem build
time.### Notes1.Rakefile
includes problematicext.lib_dir = "lib/example"
. Deployed native exts live inext/
.2. Eliminatingrb-sys
not interesting for functionality first.The text was updated successfully, but these errors were encountered: