Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Tempest scripts has Windows-style line endings, which breaks the env call in the shebang #826

Open
kevinfrom opened this issue Dec 8, 2024 · 6 comments · May be fixed by #828
Open
Labels
Bug Something isn't working

Comments

@kevinfrom
Copy link
Contributor

Tempest Version

1.0-alpha4

PHP Version

8.3

Operating System

Windows, Other

Description

Operation System: Windows/WSL2.
PHP version: 8.4.1

Some scripts, e.g. the tempest script has issues with Windows-style line endings (\r\n). By replacing all the Windows-style line endings with Unix-style line endings makes the scripts run as expected.

billede

I checked my global Git config and I use core.autocrlf, meaning Git will replace all line endings with Windows-style line endings. Maybe we should set this value to false in the tempest repositories to avoid this issue?

Steps to Reproduce

Run any tempest command, e.g. tempest serve in a WSL2 terminal.

@kevinfrom kevinfrom added Bug Something isn't working Triage New issues that need to be reviewed by the Tempest team. labels Dec 8, 2024
@innocenzi innocenzi removed the Triage New issues that need to be reviewed by the Tempest team. label Dec 8, 2024
@ericsizemore
Copy link
Contributor

I tend to use the following in my .gitattributes file:

* text eol=lf
*.php text diff=php
*.md text diff=markdown

For me, personally, it doesn't seem to cause any issues. I am also on Windows with core.autocrlf set to true.

Maybe we should set this value to false in the tempest repositories to avoid this issue?

As far as I am aware, core.autocrlf is not something that can be set on a per repository level, unless you're speaking of having contributors changing this setting on their system. It is not recommended to set this to false on a Windows system. From what I remember, it's always recommended to create a .gitattributes file instead; so maybe could give * text eol=lf a go?

** My apologies if I misunderstood anything, it's very early in the morning and I'm running on no sleep :D lol

@brendt
Copy link
Member

brendt commented Dec 9, 2024

Do you mean there are \r\n line endings in tempest which causes trouble?

@kevinfrom
Copy link
Contributor Author

@brendt yes exactly! @ericsizemore 's comment about gitattributes might be worth checking out. I can test this out when I'm home later.

@brendt
Copy link
Member

brendt commented Dec 9, 2024

I can test this out when I'm home later.

Thanks, and yes please do! Feel free to submit a PR to our .gitattributes :)

@aidan-casey
Copy link
Member

aidan-casey commented Dec 9, 2024

Great ideas!

For what it's worth, a lot of this stuff is what is happening in Laravel as well, so might be a place to look for reference.

@kevinfrom
Copy link
Contributor Author

For what it's worth, a lot of this stuff is what is happening in Laravel as well, so might be a place to look for reference.

Oh absolutely! I'll check out what Laravel does. Thanks!

@kevinfrom kevinfrom linked a pull request Dec 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants