amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 204 forks source link

Windows Platform Support Issues with Amber Framework #1362

Open Losses opened 4 weeks ago

Losses commented 4 weeks ago

Description: I am experiencing issues when trying to use the Amber Framework on the Windows platform. Although Crystal can now be compiled on Windows, Amber Framework still faces some challenges. The official build instructions require users to use make for compilation, but make is not natively available on Windows.

When attempting to compile using the crystal build src/amber.cr command directly, the resulting executable does not produce any output. This makes it difficult to use Amber on Windows and hampers development efforts.

Steps to Reproduce:

  1. Set up Crystal on a Windows machine.
  2. Clone the Amber Framework repository.
  3. Attempt to compile using crystal build src/amber.cr.
  4. Run the generated executable.

image

Expected Behavior: The executable should run and produce the expected output, similar to how it functions on Unix-based systems.

Actual Behavior: The executable runs but does not produce any output.

Suggested Improvements:

  1. Provide more detailed documentation specifically for Windows users, including any prerequisites and workarounds.
  2. Consider alternative build instructions that do not rely on make, or provide a Windows-compatible equivalent.
  3. Investigate and resolve the issue causing the executable to produce no output on Windows.

Thank you for your attention to this matter. Your assistance in improving Windows support for the Amber Framework would be greatly appreciated.

crimson-knight commented 4 weeks ago

Well Amber hasn't been tested on Windows, so I'm actually surprised you got the binary to compile at all.

  1. The correct binary to compile for the cli tool is in src/amber/cli.cr try compiling that one and see if things run.
  2. I'm probably not going to put any effort into supporting Windows directly unless a project I'm working on demands it. I've only had maybe 2 requests in the last few years for it. However, from what I can remember, people using WSL2 have successfully run Amber on Windows instead of directly on Windows.
Losses commented 4 weeks ago

@crimson-knight

Thank you for the quick response.

Actually, the compilation process has indeed been challenging, with a significant issue arising during dependency installation due to the absence of sqlite3.lib. To resolve this, a manual compilation of sqlite3.lib was necessary, followed by placement in the lib folder within the Crystal executable directory.

During the compilation of cli.cr, the following error was encountered:

In lib\teeplate\src\lib\file_tree.cr:8:10

 8 | {{ run(__DIR__ + "/file_tree/macros/directory", dir.id) }}
        ^--
Error: error executing macro 'run': 

image

Could you please provide any additional suggestions or insights that might help resolve the macro execution error? Your expertise in this matter would be greatly appreciated.

Blacksmoke16 commented 4 weeks ago

with a significant issue arising during dependency installation due to the absence of sqlite3.lib

Related: https://github.com/amberframework/micrate/issues/87

crimson-knight commented 3 weeks ago

@Losses the last message there has me stumped. Macro's a notoriously obscure with the error message. I think you've hit the same point where most people switch to WSL2 or Docker to run Amber on Windows.

drujensen commented 3 weeks ago

You will need to replace the forward slashes with back slashes on Windows.

Losses commented 3 weeks ago

@drujensen Hi! Thank you for the quick response, I have tried your solution but it seems not working

image