Open ShockwaveNN opened 3 years ago
Thanks for reporting this and the detailed description + project to reproduce, that'll help a lot. I agree this might not be easy to fix, we do some things to prevent accidental code execution on the dependabot side, and this might hit some of that code (but it could also be something entirely different 😅). We'll need some time to dive into this, but the report will help a lot 👍
@jurre I think have run into something similar. I am running multiple gemfiles that get loaded and handled fine by bundler. The Gemfile
looks like this:
Dir["gemfiles/*"].each do |gemfile|
instance_eval File.read(gemfile)
end
Any ideas on how to get this to work with Dependabot?
Possibly related (and more context on the underlying dynamic code processing problem):
@jurre I think have run into something similar. I am running multiple gemfiles that get loaded and handled fine by bundler. The
Gemfile
looks like this:Dir["gemfiles/*"].each do |gemfile| instance_eval File.read(gemfile) end
Any ideas on how to get this to work with Dependabot?
We have this exact same problem. We migrated in https://github.com/theforeman/smart-proxy/commit/bce882c4876ded145465a964f8ea0a4c0f04b4b3 to use eval_gemfile
since that was supposedly supported, but now see an error:
Dependabot only supports uninterpolated string arguments to eval_gemfile. Got `bundle`
Package ecosystem bundler Package manager version Bundler version 2.2.26 Language version ruby 3.0 dependabot.yml content
Description
TLDR: This sample repo contains two gemspec file
test-dependabot-instance-eval.gemspec
- simples gemspec file I cound create that build correct gemtest-dependabot-instance-eval-with-dependency.gemspec
- another gemspec which use original gemspec to create another gem with additional dependencyIn this repo dependabot cannot check dependency of my service with error:
Both gemspec files are fine and can build using
gem build
without any errorA more detailed description
I'm an author of
ooxml_parser
gem. It requireruby-filemagic
gem as dependency. This dependency is hell to isntall on Windows system so I was in need to make this dependency optional in my gem.I contacted
bundler
issue tracker here and team member tell that only option to solve this problem - create two differentgemspec
file and useinstance_eval
to add optional dependency. I've made this and everything worked fine, exceptdependabot
checks are started to failWe discussed this problem and decided to report this issue to dependabot team.
I'm not sure that this problem is easy to fix, but at least I've reported it