-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Windows support MVP #690
Windows support MVP #690
Conversation
02bfcbe
to
8f162ba
Compare
spec/view_spec.cr
Outdated
{% if flag?(:windows) %} | ||
client_response.body.strip.should eq("<html>Hello world\r\n</html>") | ||
{% else %} | ||
client_response.body.strip.should eq("<html>Hello world\n</html>") | ||
{% end %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless the file is created on windows there should not be a difference in line endings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this behaviour on a clone of Kemal on Windows and this change is needed for specs to pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, yet it doesn't explain the difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might help adding https://github.com/athena-framework/athena/blob/master/.gitattributes to ensure line endings remain lf
. Ran into the same problem with athena and iirc this helped a lot since before due to my git settings it was converting everything on checkout which was incorrect.
This might also solve the earlier content-length
difference as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think there should not be any difference in the output format depending on whether the spec runs on Windows or Linux.
This discrepancy is most likely caused by hello.ecr
being checked out with CRLF line ending on Windows, when it should use LF. Configuring gitattributes should fix that (probably needs rules for *.cr
and *.ecr
).
|
It works with this change? What else needs to be updated? |
Oh, maybe that was all what was needed. There are some other discrepancies between Kemal and Crystal implementations btw - not Windows related though, AFAIR. |
8f162ba
to
b820a1d
Compare
CI support is missing to make sure the changes actually work. |
Yeah. Haven't done any Windows CI config before, any help / guidance welcome 🙏 |
Should really just be adding |
Thanks a lot @Blacksmoke16 🙏 CI is all green ✅ @Sija |
Probably dont need to run ameba and format checks on both mac and ubuntu. I'd prob trim the jobs down to:
|
89e9a21
to
c4aa7bb
Compare
c4aa7bb
to
a7c5eab
Compare
spec/view_spec.cr
Outdated
{% if flag?(:windows) %} | ||
client_response.body.strip.should eq("<html>Hello world\r\n</html>") | ||
{% else %} | ||
client_response.body.strip.should eq("<html>Hello world\n</html>") | ||
{% end %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think there should not be any difference in the output format depending on whether the spec runs on Windows or Linux.
This discrepancy is most likely caused by hello.ecr
being checked out with CRLF line ending on Windows, when it should use LF. Configuring gitattributes should fix that (probably needs rules for *.cr
and *.ecr
).
bc3148a
to
32a31f8
Compare
32a31f8
to
28c1b02
Compare
All green ✅ Thanks a lot @straight-shoota @Blacksmoke16 👍 |
This makes Kemal work natively on Windows 11. All specs pass and also Tested with my own Kemal project with 7K Crystal LOC Açık Türkiye