Skip to content
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 Platform Support Issues with Amber Framework #1362

Open
Losses opened this issue Jun 12, 2024 · 6 comments
Open

Windows Platform Support Issues with Amber Framework #1362

Losses opened this issue Jun 12, 2024 · 6 comments

Comments

@Losses
Copy link

Losses commented Jun 12, 2024

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
Copy link
Member

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
Copy link
Author

Losses commented Jun 12, 2024

@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
Copy link
Contributor

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

Related: amberframework/micrate#87

@crimson-knight
Copy link
Member

@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
Copy link
Member

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

@Losses
Copy link
Author

Losses commented Jun 14, 2024

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

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants