TurboPack / AsyncPro

Async Professional is a comprehensive communications toolkit for Embarcadero Delphi and C++Builder.
101 stars 51 forks source link

LF Line Endings in the .DPKs Cause File Corruption #39

Closed mbaelive closed 5 months ago

mbaelive commented 5 months ago

The .DPK for Delphi 12 has LF line endings. Delphi does not support LF line endings in the .DPK. This will cause Delphi to corrupt the .DPK with a mix of LF and CRLF line endings when the project options are edited. "Requires", "contains", and "end." will also be changed to "rrequires", "ocontains", and "d.".

This is also affecting the packages on GetIt.

See Delphi issue RSS-427 for more information: https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-427

To fix this issue the .DPKs must have CRLF line endings. You need to have a .gitattributes file in your repository to prevent git from converting line endings. A .gitattributes file which contains:

* -text

Will turn off end of line conversion for all files. What goes into the repo will be what comes out.

Git documentation: https://git-scm.com/docs/gitattributes GitHub documentation: https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

mbaelive commented 5 months ago

For an example of .gitattributes use see: https://github.com/Embarcadero/RADStudio12Demos

romankassebaum commented 5 months ago

Done. You can also use the project magician with the "Clean Line Feeds" option.

mbaelive commented 5 months ago

You should add these -text items to .gitattributes though and check them all in as CRLF line ended files to ensure correct behaviour in all scenarios (e.g. cloned by git with any git configuration, or downloaded as a zip file from GitHub, or downloaded as an individual file):

*.dpk -text *.dproj -text *.groupproj -text

The .dpk in particular must never have LF line endings in any scenario. Delphi expects the .dpk to have CRLF line endings and won't work right without it. CRLF line endings is for practical purposes a requirement of the .dpk file format.

romankassebaum commented 5 months ago

Done.

mbaelive commented 5 months ago

Thanks, that works.

mbaelive commented 4 months ago

With the 19th of April, 2024 update to the AsyncPro 2024.02 package, the package now installs properly via GetIt.