-
Notifications
You must be signed in to change notification settings - Fork 7
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
Bundle integration fails when Toys itself is a dependency #48
Comments
Re-opening to keep discussion alive for the moment. |
Then with the code: require 'bundler/setup'
Bundler.setup Output as earlier:
With suggested by you code: require 'toys/utils/gems'
Toys::Utils::Gems.new.bundle(search_dirs: Dir.getwd) It works!
But, honestly, I'm not sure about |
And maybe |
Instead of
I added As for |
OK, thank you, this is laconic.
That's strange, I don't see this via |
Also there is a strange output when you have a later version of some dependency in the
I don't know, maybe we can somehow reload bundle after this action. |
Also I found a strange warning (also it's somewhy wrote in red, as error, and not in yellow or orange, as regular warning):
So, if I have a project like an application, with |
Hi Alex, Thanks much for the reports! I've figured out how to suppress the I'm having trouble reproducing the error you're seeing when the |
Thank you!
I suggest to edit
Development, but I think it doesn't matter too.
For example, such line in a spec.add_development_dependency 'rubocop', '~> 0.87.0'
# frozen_string_literal: true
source 'https://rubygems.org'
gemspec And such lines in
By the way, here is a tool: tool :rubocop do
def run
exec 'rubocop'
end
end And then I'm editing And now we're getting:
If you're choosing
If
|
Also I've got a strange error, seems fully from
|
Hi, I found and fixed the I still can't reproduce your rubocop If you have time to do a bit of troubleshooting, can you answer some questions:
|
There are also other dependencies, like So, to reproduce with current (
The same result.
Outputs of
The same when I changed |
Hi, Thanks for the additional info! I'm finally able to reproduce it now. It seems to happen only if there is another gem in the bundle that depends on the gem that you're updating. (In this case, Anyway, now I can construct a test case, so I'll work on a fix (which will probably involve calling Thanks for the help on this one. |
Thank you much!
No problem, I glad to help you with such good project. |
Released version 0.10.5 |
Thank you! It works great with "yes" answer. But with "no" answer there is still an exception with a large backtrace:
Is it expected or maybe we should print more readable (human) error? |
I'm not sure is it related:
How to reproduce:
The second run is successful. |
I have a similar error as the last one, but in another (private) project with GitLab CI.
# .toys/.toys.rb
# frozen_string_literal: true
include :bundler, static: true
expand :rubocop
# ... # .gitlab-ci.yml
rubocop:
before_script:
# Bundler and Toys are not installed with the image
- gem install bundler toys --no-document
# Install dependencies into ./vendor/ruby
- bundle install -j $(nproc) --path vendor
script:
- toys rubocop The latest version of So, the output is like:
|
I'm going to close this, as it's kind of morphed into a dumping ground for different issues, and so is no longer actionable. Some of the latest issues reported in this thread may have been fixed in recent commits (targeting version 0.12), especially issues involving installing into a custom bundle path (such as Please open new issues for any additional problems. |
We recommend that Toys not be listed in a Gemfile or as a development dependency when using bundler integration, but that doesn't help when Toys itself (or toys-core) is a runtime dependency of the library being developed. As a result, Toys is in the bundle, and its version can clash with the actual running version of Toys.
Two possible approaches to solving this:
See #23 for earlier discussion.
The text was updated successfully, but these errors were encountered: