-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix "Invalid template file" error on Windows #22275
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
Conversation
current implementation did cause Issues in a Windows environment
Hi @Flyingmana. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @Flyingmana, unfortunately we cannot accept this contribution as Windows is not a supported platform, please check #9492 (comment) for more details. Also, you can check #19471 (comment) for an easiest solution to deploy under Windows 10. |
Hi @Flyingmana, thank you for your contribution! |
@orlangur just because a fix is provided it doesn't mean that Windows is now a supported platform. If this fix improves Windows platform support and it doesn't cause any harm why not merge it? |
I didn't say a word about it.
It causes harm actually and then we receive some complains that something is not working in unsupported OS (while it is not supposed to be working). The only contribution which would be useful related to Windows is a proper check, similar to check for a proper PHP version, so that developers are not confused anymore. Such pull requests must be closed and not merged without any exception: The rule is simple: only contributions fixing real issues must be processed. If somebody is trying to use Magento 2 under Windows not the way I described earlier - then he is doing development wrong and this needs to be fixed. I'm kindly ask you to not reopen this improper PR without agreement in Slack. |
Hi @Flyingmana, thank you for your contribution! |
I don't think I could disagree with this response more. You can very clearly say "WINDOWS IS NOT A SUPPORTED PLATFORM" and reject bug reports for it (just like I'm sure already happens for many browsers and devices) without actively blocking contribution and improvements that don't negatively impact the rest of the software. I see the argument that code targeting an unsupported platform is bloat and possible maintenance or security problems down the line, but I don't see how that can justifiably be applied to this specific PR. You can say 'that's policy' and that may be, but that doesn't mean the policy is good. |
Hey @rhoerr, the main idea is to not encourage improper development environments and do not waste time on such contributions as without Windows CI builds there will always be some issues and more developers trying to use Magento without proper environment setup. This code is bloat, if somebody wants to maintain Windows compatibility for whatever reason it should be better done outside of Magento main repo as a separate module or even a fork like https://github.com/OpenMage/magento-lts. |
Not accepting this PR is a harmful decision. There are many developers who use windows. Often it is not their decision, but because of the constraints of their work environment. Making their life easier, even while Windows is not supported, should be a positive thing. |
@Vinai last time this question was raised we all agreed that https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ is a decent compromise (this is the link I referref initially in #22275 (comment)). I don't see any new inputs to revise this decision. What's the problem with using this approach? |
I assume we should keep this PR open while discussion is in active progress. It's best to escalate this discussion to another level and make sure everyone may participate in this decision. This might be a great resource to start with: https://github.com/magento/architecture |
@ishakhsuvarov there is no reason to keep it open considering all the previous discussions I already referred above. In such case you can reopen all old Windows-related issues and pull requests. |
I may not support this decision, but I understand and accept the reasons for this strict line against any windows centered Issues and contributions. But I want to say some words. I do most of my open source contributions as part of my free time. In my free time I use a setup which I feel comfortable with and which I do know good enough to solve Issues it causes myself. For a few years now this is Windows with a very basic setup. |
@Flyingmana , please, join our next architecture meeting next Wed, April 17 when we will discuss your case with Magento architects. Thank you for your involvement! |
@Flyingmana do you have Windows 10 in your hand? Maybe you would like https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ approach. My main concern here is that without an official Windows support (or strict OS check) we will always have unhappy developers complaining, some new incompatibilities introduced in each release as there is no appropriate testing done. I really didn't like a situation with HHVM in the past "Magento is more or less compatible with but there is no support for HHVM". Any of two - official Windows support or official statement regarding incompatibility - seems to be working better in my eyes. Especially important here is to document #19471 (comment) seamless path for developers using Windows. |
@orlangur Responding to you previous response to me, the difference is that this is not an issue report but a PR, and even more a small and unobtrusive one. It doesn’t introduce a maintenance burden, it only improves the experience of other devs. I believe out of empathy with other developers a good judgement call in this situation would be to accept the PR. |
Would a PR that remove all Windows related code from the current codebase (e.g
|
@real34 surely, there are some not so obvious places also with directory separator replacement. Those are remnants from times when Windows-related PRs were acceptable. Similar to HHVM-related code which is not relevant anymore, it would be nice to get rid of it (volunteers may even move it to a separate But first we need a proper error message displayed when somebody tries to install Magento under Windows. |
I am only commenting on that code change here, it might look a small and unobtrusive one. However, that code will require thorough testing given that method had some serious vulnerabilities in the past resulting in back to back RCE/LFIs :) |
If we can't merge this to the mainline due to maintenance burden, security implications etc I suggest we come up with a way of centralising developer efforts to make Magento work on Windows that stays outside the realm of released / supported code. Reason I am advocating for this is things like Suggestions which I believe could be a middle ground while also more clearly communicating what is supported:
|
@fooman, please read #22275 (comment).
This has nothing to do with hacks like this one for native Windows support. There are a lot of options like Vagrant, Docker or Linux Subsystem.
There is nothing even close to a reason to have such compatibility. What would be really helpful for those Windows developers not able to setup their local environment properly is up-to-date project like https://github.com/magento/magento2devbox-web. |
Closing this myself now. I dont see Docker (only available for Windows Pro) or WSL (still very experimental,incomplete,hacky,unstable) as proper replacement. But the Announcement of WSL2 and what it covers shows where Windows is going in the long run and that I will just need to wait a bit more to have a good working environment. |
Hi @Flyingmana, thank you for your contribution! |
@Flyingmana could you add a bit more on what's wrong with WSL as it is currently? Thanks for your attention to this PR. |
Let me see. There is on one hand a large number of Issues open which seem to often relate to every-day tasks Here is a PHP related one microsoft/WSL#3858
It has no GPU support, which on the first thought may be irrelevant. I heard from multiple people, the Filesystem access is still quite slow and problematic for working with Magento There is also this Blog posts, although some of the mentioned issues are related to Windows. I think most interesting are this 3 parts.
|
As of https://www.phoronix.com/scan.php?page=article&item=windows-10-wsl2&num=1 it seems, WSL2 is based on Hyper-V, which is as of https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v not available in Win 10 Home Update:
|
ensure both sides of the comparison use the same directory separator
previous implementation did cause Issues in a Windows environment
Issue: Windows was not able to load templates but did log a lot "Invalid template file..." lines
Manual testing scenarios (*)
Contribution checklist (*)