Pinning the rails gem to a git commit causes the build to fail with a collision
- Dominant language
- Nix
- Stars
- 22
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
For example, in the `Gemfile`:
```
gem 'rails', github: "rails/rails", branch: "main"
```
This will end up installing gems like `activerecord`, `actioncable`, etc. Since each of those depend on the Rails repo, a new copy of the Rails repo is checked out for each. Each of these, in turn, have a full collection of the Rails gems installed in `lib`. Example:
```
$ du -sh /nix/store/fdy5gxqj75b1a1lavpp9r991xc7jsdj1-ruby2.7.4-actionmailer-7.1.0.alpha/lib
87M /nix/store/fdy5gxqj75b1a1lavpp9r991xc7jsdj1-ruby2.7.4-actionmailer-7.1.0.alpha/lib
```
```
/nix/store/fdy5gxqj75b1a1lavpp9r991xc7jsdj1-ruby2.7.4-actionmailer-7.1.0.alpha/lib/ruby/gems/2.7.0/bundler/gems/rails-2c21a39493b3/activestorage
```
The very slow part happens when "stripping":
`stripping (with command strip and flags -S) in /nix/store/paczzlaiyh0fb84zbxm8gkhicrg7bfm9-ruby2.7.4-actiontext-7.1.0.alpha/lib`
`nix-shell` eventually crashes with:
```
error: collision between `/nix/store/al3dpzj19ahr6blkgr3csh0r28v9hyh1-ruby2.7.4-actionmailbox-7.1.0.alpha/lib/ruby/gems/2.7.0/cache/bundler/git/rails-fcf0202857b07db1a0f6220dae5ca99319ca0f32/index' and `/nix/store/94qxcr15bvmvvyr4bfpsbkqnyxmx3fm8-ruby2.7.4-actioncable-7.1.0.alpha/lib/ruby/gems/2.7.0/cache/bundler/git/rails-fcf0202857b07db1a0f6220dae5ca99319ca0f32/index'
error: builder for '/nix/store/v9ns982yljn0bx4g2pq207zgsalwa1w6-rails-nix-gems.drv' failed with exit code 255;
last 1 log lines:
> error: collision between `/nix/store/al3dpzj19ahr6blkgr3csh0r28v9hyh1-ruby2.7.4-actionmailbox-7.1.0.alpha/lib/ruby/gems/2.7.0/cache/bundler/git/rails-fcf0202857b07db1a0f6220dae5ca99319ca0f32/index' and `/nix/store/94qxcr15bvmvvyr4bfpsbkqnyxmx3fm8-ruby2.7.4-actioncable-7.1.0.alpha/lib/ruby/gems/2.7.0/cache/bundler/git/rails-fcf0202857b07db1a0f6220dae5ca99319ca0f32/index'
For full logs, run 'nix log /nix/store/v9ns982yljn0bx4g2pq207zgsalwa1w6-rails-nix-gems.drv'.
error: build of '/nix/store/1xcmpr9fsblay1g5x83s4v0s45jrgl17-wrapped-ruby-rails-nix-gems.drv', '/nix/store/v9ns982yljn0bx4g2pq207zgsalwa1w6-rails-nix-gems.drv' failed
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.