ruby / ruby/digest

Two loader.rb files not copied from ext to lib

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
51
Forks
37
Avg merge
8h 16m
Merged PRs (30d)
4

Description

OS: SLES 15 SP4
ruby: ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux-gnu] (from SLES distro)
digest gem version: 3.1.1 (latest avail at time of writing)

The actionmailer gem from v7.0.1, as well as the mail gem from v2.8.0 have new dependent gems net-imap, net.pop, net-smtp. Of these, net-imap has dependent gem digest. Thus from Rails 7.0.1 or if using mail 2.8.0 or higher, users are forced to use the digest gem.

As part of an app upgrade to Rails 6.1.7 I included mail 2.8.0, and found my application build breaking: all calls to bundler (in my case the first call is bundle exec rake assets:precompile) following bundle install fail with:

#16 3.145 rake aborted!
#16 3.145 LoadError: cannot load such file -- digest/loader
#16 3.145 <my app path>/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.13.0-x86_64-linux/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require' 

In my case I pre-compile gems first and push the compiles gems to a geminabox server. This is then accessed by the application build.

The problem appears to be that two loader files are not copied from the ext tree of the gem to the lib tree. When I copied the files manually the issue was resolved:

DIGEST=<my app path>/vendor/bundle/ruby/2.5.0/gems/digest-3.1.1-x86_64-linux
mkdir -p ${DIGEST}/lib/digest/sha2
cp -p ${DIGEST}/ext/digest/lib/digest/loader.rb      ${DIGEST}/lib/digest/loader.rb
cp -p ${DIGEST}/ext/digest/lib/digest/sha2/loader.rb ${DIGEST}/lib/digest/sha2/loader.rb

This problem also appears to be discussed in github.com/rubygems/rubygems/issues/5619

Can the gem be corrected so that copying of the loader files is no longer required?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing ext/digest/lib/digest/loader.rb and ext/digest/lib/digest/sha2/loader.rb with the installed gem's lib paths, then reproduce the failure with bundle exec rake assets:precompile. Done means a normal gem installation provides both loader files under lib so bundler no longer raises LoadError without manual copying.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.