Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-1086

Ship custom Windows rbconfig.rb that sets build_os to mingw32 instead of cygwin

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • None
    • Agent
    • 2
    • Agent 2017-05-03, Agent 2017-05-31
    • No Action

    Description

      In pre-AIO packages, the rbconfig.rb came courtesy of the RubyInstaller workflow and was published to puppet-win32-ruby at https://github.com/puppetlabs/puppet-win32-ruby/blob/2.1.x-x64/ruby/lib/ruby/2.1.0/x64-mingw32/rbconfig.rb

      Of particular importance, the build_os value was set to mingw32 at https://github.com/puppetlabs/puppet-win32-ruby/blob/2.1.x-x64/ruby/lib/ruby/2.1.0/x64-mingw32/rbconfig.rb#L191

      With the DevKit installed (necessary to build gems with native code like the pry debugging tools), Ruby uses build_os to determine if it should use Cygwin tools on Windows - for instance at https://github.com/ruby/ruby/blob/v2_1_9/lib/mkmf.rb#L1801-L1817

      In AIO packages produced by Vanagon, the rbconfig.rb is built automatically based on the platform Ruby is compiled on, which sets build_os to cygwin instead. This causes gem installation to fail with the DevKit installed alongside / configured to use the Puppet Agent vendored Ruby, as described in https://gist.github.com/Iristyle/000a80a98ce73590896a

      The fix here is to audit the newly produced rbconfig.rb and ship one that, at the very least, does not specify CONFIG["build_os"] = "cygwin"

      A diff of the old pre-AIO and AIO rbconfig.rb is at https://gist.github.com/Iristyle/aeda4c717a2ee48af1176db3bd9dac9a which should be audited.

      Note that both the Ruby 2.1.9 and Ruby 2.3.3 rbconfig.rb files should be updated accordingly in the puppet-agent repo.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ethan Ethan Brown
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support