Skip to content

Fix phpize.bat EOL to be CRLF#21445

Open
mvorisek wants to merge 2 commits intophp:PHP-8.4from
mvorisek:fix_win_bat_eol
Open

Fix phpize.bat EOL to be CRLF#21445
mvorisek wants to merge 2 commits intophp:PHP-8.4from
mvorisek:fix_win_bat_eol

Conversation

@mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Mar 14, 2026

The EOL of all Windows .bat files must be CRLF.

All other .bat files are using CRLF already.

@mvorisek mvorisek changed the title Fix phpize.bat EOL Fix phpize.bat EOL to be CRLF Mar 14, 2026
@petk
Copy link
Member

petk commented Mar 15, 2026

I haven't noticed any issues with LF line ending on Windows. This happens somewhere?

And wouldn't it be better from the maintenance perspective to set these in the .gitattributes using the -text attribute somehow? And also .editorconfig would be useful to have this configured if this is needed. Windows' CRLF anomaly is something to deprecate on the long run I believe.

@petk
Copy link
Member

petk commented Mar 15, 2026

I've now also checked the zip archive with its files and how the Windows release is packaged. Yes, there is a mix of both CRLF and LF in few files there because the Git repository is checked out with LF line endings but the win32/build/confutils.js (the generate_phpize() function) assembles the phpize script with both line endings. So, there is quite a mess here for the time being. If LF line endings cause a build failure somewhere, let me know, please. In this case I would suggest to sync the phpize script assembling code a bit instead. However, I would avoid doing this for now if it's possible to ignore this issue a bit. With CMake-based build system files on Windows are correctly assembled no matter what EOL style Git checks out. There such generated files are all CRLF inside a single file. And from my understanding, even LF style should work ok mostly everywhere already.

I've found only one issue so far for the .bat files - labels when using goto.

@mvorisek
Copy link
Contributor Author

I haven't noticed any issues with LF line ending on Windows. This happens somewhere?

IDK, we had very strange issues with LF and cmd.exe runtime in the past, so in my company we require CRLF and this is how I spotted the different EOL.

And wouldn't it be better from the maintenance perspective to set these in the .gitattributes using the -text attribute somehow? And also .editorconfig would be useful to have this configured if this is needed. Windows' CRLF anomaly is something to deprecate on the long run I believe.

100% agree, added.

I've now also checked the zip archive with its files and how the Windows release is packaged. Yes, there is a mix of both CRLF and LF in few files there because the Git repository is checked out with LF line endings but the win32/build/confutils.js (the generate_phpize() function) assembles the phpize script with both line endings. So, there is quite a mess here for the time being. If LF line endings cause a build failure somewhere, let me know, please. In this case I would suggest to sync the phpize script assembling code a bit instead. However, I would avoid doing this for now if it's possible to ignore this issue a bit.

I have no evidence this is an issue, so let's merge this PR as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants