Since windows (yes, i know, it's terrible for PHP development) by default won't work with Makefile. I get this error after installation:
Executing script make cache-warmup [KO]
[KO]
Script make cache-warmup returned with error code 1
!! 'make' is not recognized as an internal or external command,
!! operable program or batch file.
!!
!!
Of course, temporary fix is to remove: "auto-scripts" in compsoer.json and running by hand Makefile written commands.
Make does exist for Windows, the problem does not come from make but from the commands that are run inside: test, rm, and even bin/console.
For this, you need to use Cygwin or integrate linux tools in your PATH when installing Git for Windows for example (just a checkbox during Git installation, with a warning).
Even still, shebang lines won't work, and I would recommend replacing bin/console with php bin/console in the makefile 馃檪
Edit: And in any case, starting from Windows 10 you can use WSL and natively have make installed in your linux subsystem :)
PHP_EOL on Windows is "\nr", but makefiles are Posix based "\n", will this not cause any problems?
Could Composer custom commands be used instead? ref: https://getcomposer.org/doc/articles/scripts.md#writing-custom-commands
Could have Flex simply write them to the composer.json file (although would get warning about lock being outdated I think?).
There is a request for Composer to support inheritance which might be useful for this: https://github.com/composer/composer/pull/4210
Using Composer has many disadvantages (like timeouts, non-support for ANSI escape codes, ...).
PHP_EOL on Windows is "\nr", but makefiles are Posix based "\n", will this not cause any problems?
It's "r\n", not "\nr" , but still, maybe Flex could detect the OS and change the line feed for the makefile?
@Pierstoval when creating the Makefile, it does. The issue then is that the Makefile is committed in your repo, and so will be shared between everyone. This makes it harder to handle line endings.
The nice way would be for Make itself to support Unix line endings in their Windows version. But I don't know whether it is the case.
I'm not sure, maybe we should take a look at the gnu make project 馃槙
I ported the Makefile to windows as make.bat to work with flex. Gist the only issue is that there is somewhere a extension check and the confirm does not work as expected. But finally it's working to execute the commands.
D:\xxx>make.bat serve
[ERROR] This command needs the pcntl extension to run.
You can either install it or use the "server:run" command instead.
Do you want to execute server:run immediately? [yN] []:
> N
[OK] Server listening on http://127.0.0.1:8000
// Quit the server with CONTROL-C.
@chapterjason That's nice to see you have worked to "port" this makefile. But actually, the best fallback is either to use WSL, or native Symfony console with Windows terminal..
Or just use https://github.com/dunglas/symfony-docker
It should work just fine on Windows.
Hello to install flex over Windows without problems, you must to install first these packages
http://gnuwin32.sourceforge.net/packages/coreutils.htm
http://gnuwin32.sourceforge.net/packages/make.htm
after SET in your windows enviromental vars something like "C:\Program Files (x86)\GnuWin32\bin" where this is your path of GnuWin bin directory installation
With this version of GNU make, I end up with this kind of error:
e:\dev\www\flex_tests\skeleton $ make
process_begin: CreateProcess(NULL, which bin/console, ...) failed.
make: *** [sf_console] Erreur -1073740791
Closing as Makefiles are gone. symfony/console is now a requirement in the base skeleton.
Most helpful comment
Closing as Makefiles are gone.
symfony/consoleis now a requirement in the base skeleton.