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

Updated to 1.36.0, compile error now #159

Closed
wittyhandle opened this issue Dec 17, 2014 · 10 comments · Fixed by #160
Closed

Updated to 1.36.0, compile error now #159

wittyhandle opened this issue Dec 17, 2014 · 10 comments · Fixed by #160

Comments

@wittyhandle
Copy link

Hi, my cookbooks have a transitive dependency to this one. Looks like what was just updated is causing some problems:

constant Chef::Resource::WindowsPackage not defined

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/windows/libraries/windows_package.rb:

257:          @provider = Chef::Provider::WindowsCookbookPackage
258:        end
259:      end
260:    end
261:  end
262:
263:  if Gem::Version.new(Chef::VERSION) < Gem::Version.new('12')
264>>   Chef::Resource.send(:remove_const, :WindowsPackage)
265:    Chef::Resource.const_set("WindowsPackage", Chef::Resource::WindowsCookbookPackage)
266:  end

I am not running chef 12.

@coryflucas
Copy link

Can confirm I am seeing this as well trying to setup an OpsWorks instance running Ubuntu with Chef 11. Adding 1.34.8 to my Berksfile seems to resolve the issue.

@jaym
Copy link
Contributor

jaym commented Dec 17, 2014

what version of chef 11

@wittyhandle
Copy link
Author

I am running Chef: 11.10.4

@jaym
Copy link
Contributor

jaym commented Dec 17, 2014

seems like Chef::Resource::WindowsPackage was introduced in 11.12.0, which is why it cannot find it

@wittyhandle
Copy link
Author

Anyway the version check can be a little more precise? I'm working in an environment where upgrading chef versions isn't that easy at this point.

@albertsj1
Copy link

Just hit this bug simply trying to install nodejs on CentOS. Really hating the Chef cookbook dependency hell when using community cookbooks. :(
The windows cookbook really should have been bumped to a 2.x release or at least a 1.4 when it introduced this dependency.

@btm
Copy link
Contributor

btm commented Dec 17, 2014

@albertsj1 Do you have a copy of the stacktrace? Was it the same as @wittyhandle?

What caused you to use 1.36.0? Did you use a new cookbook that depended on the windows cookbook?

Version 1.4 of this cookbook was released a long time ago, and 1.36.0 > 1.4.0. There are no breaking changes in this release to justify a major version bump. Yes, there was a bug, but that wasn't intended. You can use the pessimistic constraint like depends "windows", ">~ 1.34.8" in your own cookbooks to get only bugfix releases, but that doesn't guarantee perfect code either, just less changes.

@albertsj1
Copy link

Yes, same stacktrace as @wittyhandle . Sorry, I misremembered the version thinking it was 1.3.x, hence the recommendation of a bump to 1.4.x.
I hit this trying to install nodejs on Amazon Linux using Opsworks. The latest version of Chef available in Opsworks in 11.10. I tried using master, but hit the same error message. I was able to get around this by specifying tag 1.34.4 in my Berksfile.

@btm btm closed this as completed in #160 Dec 17, 2014
@btm
Copy link
Contributor

btm commented Dec 17, 2014

I've merged #160 to master. It'd be helpful if anyone could manually test it. We did add 11.10 to the test-kitchen tests. I'm late for dinner. I'll ship afterwards if anyone can confirm it.

@btm
Copy link
Contributor

btm commented Dec 18, 2014

I verified this with our new test-kitchen support with Chef 11.10.4. It has been released in windows cookbook v1.36.1. Thanks for the help testing and identifying the root issue folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

5 participants