puppetlabs / r10k

Smarter Puppet deployment
Other
802 stars 355 forks source link

r10k does not write files correctly from git on Windows #1381

Open benjamin-robertson opened 3 months ago

benjamin-robertson commented 3 months ago

Describe the Bug

On Windows r10k include carriage return (CRLF) in files when syncing modules from Git.

This occurs when using 'bolt module install'

Expected Behaviour

It should not insert CRLF when installing modules.

Steps to Reproduce

Steps to reproduce the behaviour:

  1. Install a git module on windows.
  2. Run a ruby task on a non-window host.
  3. Will get error when trying to run against a Linux host.
    /opt/puppetlabs/puppet/bin/ruby^M: bad interpreter: No such file or directory

Environment

Additional Context

Noticed this issue when troubleshooting cd4peadm module on Windows.

Solution

Need to disable autocrlf in git for on Windows platform.

benjamin-robertson commented 2 months ago

This issue may be fixed in the bolt project itself, in that case this issue can be closed.

The r10k solution will only fix when modules are installed via git to a windows bolt project. If a user creates local tasks\scripts these will still suffer the same issue. Hence why it may be better to correct within bolt. Waiting for engineering decision.

github-actions[bot] commented 4 weeks ago

This issue has been marked stale because it has had no activity for 60 days. The Puppet Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.