Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

devkit is broken on windows #100

Closed
btm opened this issue Jul 11, 2014 · 9 comments · Fixed by chef-boneyard/omnibus-chef#193
Closed

devkit is broken on windows #100

btm opened this issue Jul 11, 2014 · 9 comments · Fixed by chef-boneyard/omnibus-chef#193
Labels
Type: Bug Doesn't work as expected.

Comments

@btm
Copy link
Contributor

btm commented Jul 11, 2014

I noticed doing a "bundle install" for a project worked with the chef-client windows MSI, but not the chef-dk windows MSI.

chef-dk overwrites embedded/lib/ruby/site_ruby/2.0.0/rubygems/defaults/operating_system.rb with omnibus-chef/files/rubygems_customization/operating_system.rb

This file overrides c:/opscode/chedk/embedded/lib/ruby/2.0.0/rubygems/defaults/operating_system.rb which contains this code from "ruby dk.rb install"

# :DK-BEG: override 'gem install' to enable RubyInstaller DevKit usage
Gem.pre_install do |gem_installer|
  unless gem_installer.spec.extensions.empty?
    unless ENV['PATH'].include?('c:\\opscode\\chefdk\\embedded\\mingw\\bin') then
      Gem.ui.say 'Temporarily enhancing PATH to include DevKit...' if Gem.configuration.verbose
      ENV['PATH'] = 'c:\\opscode\\chefdk\\embedded\\bin;c:\\opscode\\chefdk\\embedded\\mingw\\bin;' + ENV['PATH']
    end
    ENV['RI_DEVKIT'] = 'c:\\opscode\\chefdk\\embedded'
    ENV['CC'] = 'gcc'
    ENV['CXX'] = 'g++'
    ENV['CPP'] = 'cpp'
  end
end
# :DK-END:

This can be worked around by running ruby dk.rb install again after the MSI is installeD:

PS C:\opscode\chefdk\embedded> ruby dk.rb install
[INFO] Updating existing gem override for 'c:/opscode/chefdk/embedded'
[WARN] Skipping existing DevKit helper library for 'c:/opscode/chefdk/embedded'
@adamedx
Copy link

adamedx commented Jul 11, 2014

So something we need to fix in chefdk software defs @btm?

@lamont-granquist
Copy link
Contributor

we need both so on windows we probably just need to drop in a file that is our bits plus the devkit bits, merged to make it make sense...

@sersut
Copy link

sersut commented Jul 11, 2014

Does this need to be fixed in the immediate release? What is the user impact of this issue?

@btm
Copy link
Contributor Author

btm commented Jul 11, 2014

Running ruby dk.rb install on my workstation kept our custom bits and added the devkit bits, so I'm thinking/hoping we could fix this with an ordering change (see chef-boneyard/omnibus-chef#193) so we don't have to hardcode the devkit bits, lest they change later.

@btm
Copy link
Contributor Author

btm commented Jul 11, 2014

@sersut you can't bundle install or gem install anything that compiles extensions, because it can't find gcc and friends from the devkit. it's certainly important to the work I'm doing with test-kitchen on windows. we could ship it in a patch release once we verify it too though.

@sersut
Copy link

sersut commented Jul 11, 2014

Thanks for the explanation @btm. Let's shoot for a patch release.

Also that would be awesome if we can have a test for this so that this doesn't get regressed in the future.

@btm
Copy link
Contributor Author

btm commented Aug 12, 2014

So Omnibus::Library#build_order has a hack that changes moves a top-level dependency to the end of the order if it is only a top-level dependency and I was having trouble getting this to work right at the time because of it. I'm still not sure if it's really fixed.

/~https://github.com/opscode/omnibus/blob/master/lib/omnibus/library.rb#L64

@lamont-granquist
Copy link
Contributor

reopening this issue because it sounds like it needs some validation to occur before its closed

@btm
Copy link
Contributor Author

btm commented Aug 27, 2014

Fixed by chef-boneyard/omnibus-chef#224

@btm btm closed this as completed Aug 27, 2014
ksubrama pushed a commit that referenced this issue Jan 11, 2016
Pick up OHAI on windows if a version is specified in the build.
@thommay thommay added Type: Bug Doesn't work as expected. and removed Bug labels Feb 1, 2017
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Doesn't work as expected.
Development

Successfully merging a pull request may close this issue.

7 participants