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

Add Windows support #58

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

Gaweringo
Copy link
Contributor

This PR would make all commands which use rm -f and mkdir -p windows compatible by adding the get_commands() function to utils which swaps the unix commands with the cmd commands erase /s /q and mkdir.
The way to ignore errors is also different and is changed from || true to > nul 2> nul & cd. for cmd. Ignoring errors is also needed for mkdir in cmd, since there is no -p equivalent.

I could not test the asm changes fully yet, since it uses linux/unix syscalls from what I understand. Building and linking works, but the "Run program" does not succeed and exits with a large negative exit code.

Languages which had changes:

  • asm
  • c
  • cpp
  • cs
  • dart
  • go
  • java
  • kotlin
  • python
  • rust
  • swift
  • fortran

Bau which had changes:

  • cmake
  • meson

From my testing, everything should still work on Linux with these changes.

Let me know if I need to change something, or if this PR might go in the wrong direction / uses an undesired approach.

@Zeioth
Copy link
Owner

Zeioth commented Sep 24, 2024

Thank you for taking the time to send this PR @Gaweringo. I imagine some Windows users might prefer this approach over WSL, specially when trying the plugin for the first time.

Please give me this week to review it.

In the mean time if you want, you can check if the tests pass on windows running this command inside of Neovim:

-- Change the path to wathever the nvim <data> dir is on windows.
:luafile ~/.local/share/nvim/lazy/compiler.nvim/tests/tests.lua

@Gaweringo
Copy link
Contributor Author

Gaweringo commented Sep 24, 2024

I ran the test files for the languages I changed.

  • The Flutter Linux build fails (expected)
  • asm had some errors but now works, except for when the compiled program is run, as it does not exit with a 0 error code on Windows. So the status stays at RUNNING
  • The C# csc compilations error (remains in RUNNING state) at an assertion: * Assertion: should not be reached at ..\mono\metadata\marshal-ilgen.c:6239.
    • Removing the /debug argument results in a successful compilation

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

Successfully merging this pull request may close these issues.

2 participants