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

Explicit require for Set #184

Merged
merged 1 commit into from Jul 28, 2021

Conversation

marcotc
Copy link
Contributor

@marcotc marcotc commented Jul 6, 2021

As rake moved their require "set"'" statement in 13.0.4#diff-191505f9c8 today, appraisal install started to fail with the error:

$ bundle exec appraisal install
bundler: failed to load command: appraisal (/app/bin/appraisal)
/app/gems/appraisal-2.4.0/lib/appraisal/dependency_list.rb:7:in `initialize': uninitialized constant Appraisal::DependencyList::Set (NameError)
	from /app/gems/appraisal-2.4.0/lib/appraisal/bundler_dsl.rb:13:in `new'
	from /app/gems/appraisal-2.4.0/lib/appraisal/bundler_dsl.rb:13:in `initialize'
	from /app/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:16:in `new'
	from /app/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:16:in `initialize'
	from /app/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:11:in `new'
	from /app/gems/appraisal-2.4.0/lib/appraisal/appraisal_file.rb:11:in `each'
	from /app/gems/appraisal-2.4.0/lib/appraisal/task.rb:32:in `block in initialize'
	from /app/gems/rake-13.0.4/lib/rake/task_manager.rb:232:in `in_namespace'
	from /app/gems/rake-13.0.4/lib/rake/dsl_definition.rb:141:in `namespace'
	from /app/gems/appraisal-2.4.0/lib/appraisal/task.rb:9:in `initialize'
	from /app/gems/appraisal-2.4.0/lib/appraisal.rb:4:in `new'
	from /app/gems/appraisal-2.4.0/lib/appraisal.rb:4:in `<top (required)>'
	from /app/gems/appraisal-2.4.0/bin/appraisal:4:in `require'
	from /app/gems/appraisal-2.4.0/bin/appraisal:4:in `<top (required)>'
	from /app/bin/appraisal:23:in `load'
	from /app/bin/appraisal:23:in `<top (required)>'
	from /app/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:63:in `load'
	from /app/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /app/gems/bundler-2.2.19/lib/bundler/cli/exec.rb:28:in `run'
	from /app/gems/bundler-2.2.19/lib/bundler/cli.rb:474:in `exec'
	from /app/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /app/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /app/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /app/gems/bundler-2.2.19/lib/bundler/cli.rb:30:in `dispatch'
	from /app/gems/bundler-2.2.19/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /app/gems/bundler-2.2.19/lib/bundler/cli.rb:24:in `start'
	from /app/gems/bundler-2.2.19/exe/bundle:49:in `block in <top (required)>'
	from /app/gems/bundler-2.2.19/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	from /app/gems/bundler-2.2.19/exe/bundle:37:in `<top (required)>'
	from /app/bin/bundle:23:in `load'
	from /app/bin/bundle:23:in `<main>'

This fails for any Appraisals file.

This affects Ruby 2.4 up to 3.0, as far as I could test.

This PR adds the require 'set' statement to the file that references the Set class.

Copy link

@dzunk dzunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please 🙏 I was wondering why my gem's CI randomly broke...

@@ -1,4 +1,5 @@
require 'appraisal/dependency'
require "set"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should remain consistent with single vs. double quotes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that at first, but the CI linting bot yield at me for that, so I changed it to double quotes.

Looking at recent changes in the repo, double quotes seems to be the new pattern.

@dzunk
Copy link

dzunk commented Jul 13, 2021

cc: @nickcharlton would be great to get this into a 2.4.1 patch release

@mhenrixon
Copy link

Downgrading rake to 13.0.3 worked for me until we get a new release.

@nickcharlton
Copy link
Member

Thanks for fixing this! I'm a bit swamped at the minute, but I'll have time to look properly on Friday and should be able to cut a release.

@ayoa77
Copy link

ayoa77 commented Jul 26, 2021

Came here to do just this. Props to you @marcotc!

@nickcharlton
Copy link
Member

Funny looking Friday like I thought, but thanks again. I'm going to merge this now and push out a release.

@nickcharlton nickcharlton merged commit 9e605ef into thoughtbot:master Jul 28, 2021
@marcotc marcotc deleted the explicit-require-set branch July 28, 2021 19:08
jaredbeck added a commit to paper-trail-gem/paper_trail that referenced this pull request Aug 30, 2021
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

Successfully merging this pull request may close these issues.

None yet

5 participants