Skip to content

All shell scripts in bin/ directory use Windows CRLF line endings causing execution failures on Linux #21

@eilokevin

Description

@eilokevin

Description

All shell scripts in the bin/ directory are saved with Windows CRLF line endings (\r\n), which causes execution failures on Linux systems. This affects all users trying to use the jacinle command-line tools.

Error Symptoms

When running any jacinle command (e.g., jac-run, jac-crun), users encounter errors like:

  • /bin/bash: $'\r': command not found
  • _jac-init.sh: No such file or directory (due to path corruption)
  • syntax error: unexpected end of file

Root Cause

The shell scripts contain Windows-style line endings (CRLF) instead of Unix-style (LF), causing bash to interpret the carriage return character (\r) as part of commands.

Temporary Workaround

Users must manually convert all scripts:

find /path/to/jacinle/bin -name "*.sh" -o -name "jac-*" | xargs dos2unix

Proposed Solution

  1. Convert all shell scripts to use Unix line endings (LF) in the repository
  2. Add .gitattributes file to enforce proper line ending handling:
    *.sh text eol=lf
    jac-* text eol=lf
    
  3. Consider adding a CI check to prevent CRLF line endings in shell scripts

Impact

This issue affects every Linux user and significantly impacts the user experience, as the tools fail immediately upon installation without any clear error message indicating the root cause.

Environment

  • OS: Linux (Ubuntu, CentOS, etc.)
  • jacinle version: [current version]
  • Installation method: git clone

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions