homeblogsupporting long file paths on windows

Supporting long file paths on Windows

Windows has been a huge focus for Puppet since the beginning, and never more so than with our recent news that the whole suite of DSC Resources are now accessible through the Forge, all fully supported by Puppet. Puppet and Windows have always gone hand in hand, but it hasn’t always been plain sailing.

Long file path support in Windows

As the Infrastructure and Automation Content (IAC) team has been hard at work supporting our new DSC Resources, we bumped into a long-standing issue with Windows, Ruby and long file paths. To cover a quick technical summary, the maximum length of a path addressable by the Windows API is MAX_PATH, or 260 characters. This is unfortunate, because several PowerShell DSC resources include file paths that approach this length. Once they're vendored into Puppet modules, the paths exceed MAX_PATH, and Puppet runs will fail with inscrutable file not found errors.

Puppet has supported Windows DSC since the days of Puppet 3.8, and we continue to overcome any hurdles we may face on this mission, including contributing to upstream dependencies. The complex nature of supporting Windows (sometimes incredibly long) file paths in Ruby, however, has resulted in our community - and internal teams! - using workarounds and hacks to harness Puppet capabilities. We knew it was time to ensure Puppet and Windows continued to have a happy and healthy partnership, so we got to work.

Community driven engineering teams

With our IAC team blocked without long file path support in Windows, Gabriel, an engineer on our Platform team, decided to dive into this long-standing problem, leading to long file path support being merged into the Ruby main branch. We are thrilled to empower our customers with the entire suite of DSC resources, and we hope to continue to enable customers to automate their enterprise anywhere, regardless of their computing strategy.

You can read more about Gabriel’s technical journey to find a solution on our dev.to blog.

Learn more

  • Keep up to date with our internal engineering teams on our dev.to blog here.

  • Find all Puppet supported DSC resources on the Forge.

  • Have a request for our Product team? Reach them through the Puppet Idea Portal.
  • Our CFP for Puppetize Digital 2021 is open through July 30th. Submit your talk today!

Beth Glenfield is a Product Manager at Puppet.

Puppet sites use proprietary and third-party cookies. By using our sites, you agree to our cookie policy.