Skip to content

Conversation

@myurasov-nv
Copy link

On Windows, when IsaacLab is checked out from a repo with Git installed from Windows installer with default settings for line endings handling, docker container fails to build. This fixes it by setting rule for .sh files in .gitattributes and replacing damaged line endings when building docker.

Fixes # (issue)

#4488

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • NA - I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • NA - I have updated the changelog and the corresponding version in the extension's config/extension.toml file
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions bot added bug Something isn't working infrastructure labels Feb 1, 2026
@myurasov-nv myurasov-nv changed the title Fix Docker failing after checking out on Windows (#4488) Fix Docker build failing on Windows (#4488) Feb 1, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 1, 2026

Greptile Overview

Greptile Summary

This PR fixes Docker build failures on Windows by addressing line ending issues with shell scripts. It implements a two-layer defense: .gitattributes enforces LF endings for *.sh files at checkout, and the Dockerfiles include a sed command to strip any carriage returns that might slip through.

Key Changes:

  • Added *.sh text eol=lf to .gitattributes to prevent Git from converting LF to CRLF on Windows
  • Added find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} + in both Dockerfiles as a safety measure
  • Updated CONTRIBUTORS.md to add @myurasov-nv (Mikhail Yurasov) and alphabetize previously unsorted entries

The fix is minimal, well-targeted, and follows best practices for cross-platform compatibility.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are minimal, well-understood, and follow standard practices for fixing Windows Git line ending issues. The dual approach (gitattributes + sed) ensures robustness without side effects
  • No files require special attention

Important Files Changed

Filename Overview
.gitattributes Added rule to enforce LF line endings for .sh files, preventing Windows Git from converting them to CRLF
docker/Dockerfile.base Added sed command to strip carriage returns from shell scripts copied into container, fixing execution issues
docker/Dockerfile.curobo Added sed command to strip carriage returns from shell scripts copied into container, matching Dockerfile.base fix

Sequence Diagram

sequenceDiagram
    participant WinDev as Windows Developer
    participant Git as Git (Windows)
    participant Repo as Repository
    participant Docker as Docker Build
    participant Container as Linux Container
    
    Note over WinDev,Git: Before Fix
    WinDev->>Git: git clone/checkout
    Git->>WinDev: .sh files with CRLF
    WinDev->>Docker: docker build
    Docker->>Container: COPY .sh files (with CRLF)
    Container->>Container: Execute .sh scripts
    Note over Container: ❌ Fails: /bin/bash: bad interpreter: ^M
    
    Note over WinDev,Container: After Fix
    WinDev->>Git: git clone/checkout
    Note over Git: .gitattributes enforces LF for *.sh
    Git->>WinDev: .sh files with LF
    WinDev->>Docker: docker build
    Docker->>Container: COPY .sh files
    Note over Container: Defense: find + sed removes any \r
    Container->>Container: chmod +x isaaclab.sh
    Container->>Container: Execute .sh scripts
    Note over Container: ✓ Success: Scripts execute properly
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Feb 2, 2026
@myurasov-nv myurasov-nv requested review from Mayankm96 and removed request for Mayankm96, hhansen-bdai, jtigue-bdai and pascal-roth February 2, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant