pit-ray / win-vind

You can operate Windows with key bindings like Vim.
https://pit-ray.github.io/win-vind/
MIT License
1.73k stars 44 forks source link

[Bug] Doesn't run on aarch64 #191

Open hwine opened 11 months ago

hwine commented 11 months ago

About Bug

Steps to reproduce

  1. install on arm64 windows 11
  2. note that app starts and shows in system tray
  3. non of the examples work
  4. right click on system tray item, no menu pops up, app terminates

Environments

Environments Delete the example and fill in your information.
Windows Edition 11 Pro
Windows Version 23H2 (Insider beta)
Windows Build 22631.2129
Architecture aarch64
win-vind Version 5.2.3
win-vind Install Type winget
pit-ray commented 11 months ago

For now, I have built win-vind by cross-compiling. Would it work well on your computer?

However, I don't have an arm64 computer, so I cannot test it to verify that it works. I don't like to upload untested applications to winget or Chocolatey, so to support the arm build, I think that we need a contributor who has an arm64 computer.

pit-ray commented 11 months ago

To compile win-vind for arm64, follow these steps.

  1. clone win-vind

    $ git clone https://github.com/pit-ray/win-vind.git
  2. Start command prompt

    $ cmd
  3. Build wxWidgets for arm64

    $ cd libs
    $ git clone https://github.com/wxWidgets/wxWidgets.git -b v3.1.5 -j %NUMBER_OF_PROCESSORS% --depth=1
    $ cd wxWidgets
    $ git submodule update --init -j %NUMBER_OF_PROCESSORS%
    $ cd build/msw
    $ call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
    $ nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 TARGET_CPU=ARM64 RUNTIME_LIBS=static
    $ cd ../../../
  4. Build win-vind

    $ cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release -DwxWidgets_LIB_DIR libs/wxWidgets/lib/vc_arm64_lib -G "Visual Studio 16 2019" -A Arm64 .
    $ cmake --build build_arm64 --config Release
hwine commented 11 months ago

Thanks for the build & instructions (I couldn't get the build to work with my lack-of-knowledge). I'll test after work tonight.

hwine commented 11 months ago

I tried running the installer you built, and that worked. However when I ran it (first time from non-admin powershell), I got:

image

I then tried:

Finally, I stumbled on this run (somehow) from both admin & non-admin shell:

C:\Program Files\win-vind> 'C:\Program Files\win-vind\win-vind.exe'
C:\Program Files\win-vind\win-vind.exe
C:\Program Files\win-vind> & 'C:\Program Files\win-vind\win-vind.exe'
C:\Program Files\win-vind>

This produced:

I have no idea why the "&" made a difference (or how it got there), so we may be dealing with PEBKAC here. Let me run the app on an x86_64 machine I have access to, and learn what to expect. I'll update this bug after that.

pit-ray commented 11 months ago

I'm sorry. It seems I gave you an incomplete installer. How about this build? setup_win-vind_5.2.3.zip

hwine commented 11 months ago

Sorry - same result. After trying on an x86_64 machine (where it worked great), I'm certain it's not PEBCAK. This weekend I should have time to build it myself and try that (which hopefully will flush out any cross compile glitch). Win11 on arm64 has some rough edges still -- MS is still having challenges with WSL. ☹️

hwine commented 11 months ago

fwiw, I'm running into issues getting a clean build on my machine, so I started #193. Everything is in extra scripts in tools/arm64*. As you'll see, I'm not familiar with building for windows using VS. 😉

pit-ray commented 11 months ago

@hwine Thanks for the pull request. I will check your script and comment.