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

Duplicate shared libraries in gem store #382

Open
gl-yziquel opened this issue May 30, 2024 · 0 comments
Open

Duplicate shared libraries in gem store #382

gl-yziquel opened this issue May 30, 2024 · 0 comments

Comments

@gl-yziquel
Copy link
Contributor

gl-yziquel commented May 30, 2024

Hi.

The .so shared library is duplicated in the gem store after installation.

See here for code: https://github.com/gl-yziquel/skeleton_rust_gem/tree/develop
Tagged: https://github.com/gl-yziquel/skeleton_rust_gem/releases/tag/gh-rb-sys-380

Having had a look at the Makefile, it seems that the installation process does not clean up. Ideally, I'd have cargo / rust generate the cdylib library, copy or move it to the relevant location, and remove the target/ folder. Why is this not done in the Makefile ? Is there some reason ?

mini-me@virtucon ~/h/s/skeleton_rust_gem (develop)> just wipe install-gem store
[...]
tree `gem env gemdir`/gems/skeleton_rust_gem-0.0.1
/home/mini-me/.local/share/gem/ruby/3.1.0/gems/skeleton_rust_gem-0.0.1
├── Cargo.lock
├── Cargo.toml
├── ext
│   └── skeleton_rust_gem
│       ├── Cargo.toml
│       ├── extconf.rb
│       ├── Makefile
│       ├── skeleton_rust_gem.so
│       ├── src
│       │   └── lib.rs
│       └── target
│           └── CACHEDIR.TAG
├── lib
│   ├── skeleton_rust_gem
│   │   ├── skeleton_rust_gem.so
│   │   └── version.rb
│   └── skeleton_rust_gem.rb
└── README.md

7 directories, 12 files
tree `gem env gemdir`/extensions/x86_64-linux/3.1.0/skeleton_rust_gem-0.0.1
/home/mini-me/.local/share/gem/ruby/3.1.0/extensions/x86_64-linux/3.1.0/skeleton_rust_gem-0.0.1
├── gem.build_complete
├── gem_make.out
├── mkmf.log
└── skeleton_rust_gem
    └── skeleton_rust_gem.so

2 directories, 4 files

I'd also be very much interested in the logic internal to rb-sys which allows to construct the lib/skeleton_rust_gem portion of the lib/skeleton_rust_gem/skeleton_rust_gem.so path. A quick walkthrough through what happens to determine the exact location of that path would matter quite a bit to me.

Best.

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

1 participant