microsoft/rushstack

[rush] Line Ending Breaks Rush on Linux Systems

thepenguinmaster opened this issue · 1 comments

Summary

Hello,

I run Rush builds on an ubuntu server (ARM) and see a problem with the latest version. A windows line ending character is disrupting the application and it will not run. This breaks my build pipeline.

Repro steps

To reproduce, Launch an ubuntu container or VM with Node v18.12.1 is installed and run the following:

corepack enable
yarn global add @microsoft/rush
echo rush update
rush update --debug --full

This will emit the following:

+ echo rush update
rush update
+ rush update --debug --full
**/usr/bin/env: ‘node\r’: No such file or directory**

As you can see, the command will immediately fail, due to the \r character possibly appended to the main.js or other core file. the character is identified as part of the node command and the system is unable to find a command 'node\r' since it should be just 'node'.

Any Rush command will fail, including:

rush, rush -v, rush build, rush install, rush purge, etc.

Expected result:
Rush will run properly and display any output

Actual result:
All rush commands will fail and display the above error message

Details

When saving files, it is best to save with LF and not CRLF, since it can impact systems that are sensitive to line ending differences. This is most likely already known since previous versions have not had the problem. It is a simple mistake to make, one I am very familiar with :)

From what I can tell, the current version of Rush will not run on any Linux system.

If you find this bug report through a search engine, you will need to pin to an older version of Rush before this was introduced int he October release. For example:

yarn global add @microsoft/rush@5.87.0
 
Also, thank you for all of the hard work developing and maintaining Rush, it is a great system and I enjoy the benefits of its quick build times.

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.110.0 released October 30, 2023
rushVersion from rush.json? 5.87.0
useWorkspaces from rush.json? true
Operating system? Linux (Ubuntu core)
Would you consider contributing a PR? Yes
Node.js version (node -v)? v18.12.1 ARM64

Thanks for reporting this issue!

It was fixed in #4414