anthem-audio / anthem

A modern, multi-workflow digital audio workstation.
https://anthem.audio/
GNU General Public License v3.0
33 stars 3 forks source link

Setup on Windows #26

Closed SecondFlight closed 1 year ago

SecondFlight commented 2 years ago

Here are steps I used to build Anthem on a fresh Windows VM. Most of the issues I had should be solved, but I've left the steps I used to solve them in case they're helpful.

  1. Get the Windows 11 evaluation VM from https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/
  2. Update Visual Studio Community 2022 via the Visual Studio installer
  3. Add "Desktop Development with C++" via the Visual Studio installer
  4. Install Git
  5. Install VS Code with the Flutter and rust-analyzer extensions
  6. Install Rust toolchain via rustup-init.exe
  7. Install the Flutter SDK
  8. Install LLVM via winget install llvm
  9. Clone https://github.com/SecondFlight/anthem.git (the changes here have since been merged into /anthem-audio/anthem)
  10. Run flutter pub get (This step was added later after an issue occurred - see below)
  11. Run steps in scripts/setup.ps1
    1. cargo install cbindgen
    2. dart pub global activate ffigen
    3. cargo install flutter_rust_bridge_codegen
  12. Run scripts/build_engine.ps1
  13. Run scripts/bindgen.ps1
    1. This failed due to an error:
      1. Could not find a file named "pubspec.yaml" in "C:\Users\User\Documents\Code\flutter.pub-cache\hosted\pub.dartlang.org_fe_analyzer_shared-39.0.0".
    2. Try running flutter pub get, then retry the script
    3. This worked.
  14. Run scripts/watch.ps1
  15. Run flutter run
    1. This failed. There are two issues, both of which can be verified in VS Code:
      1. The watch command isn't outputting files
        1. This can be fixed:
          1. Kill the watch script
          2. flutter pub run build-runner clean, then
          3. flutter pub run build-runner build --delete-conflicting-outputs
          4. Then, there may still be files that are missing codegen imports. My current hack to fix this is to run ./scripts/watch.ps1 again, then open each file that has this issue, press space, save, then backspace, then save.
      2. The bindgen script output a file that wasn't correct
        1. This was a package version issue. I've fixed it and pushed to my branch
    2. After fixing the error above, the command still failed.
      1. There's a git error, which has a suggestion for how to fix it: git config --global --add safe.directory C:/Users/User/Documents/Code/anthem/build/windows/_deps/corrosion-src
    3. The build failed again, this time due to errors from bitsdojo.
      1. Tried running flutter pub upgrade for good measure.
      2. This fixed the issue.
SecondFlight commented 2 years ago

I forgot to put it in the list, but I had to set the Powershell execution policy to Unrestricted - see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.2

SecondFlight commented 1 year ago

This process is now a lot simpler after removing Rust from the project. Readme update incoming soon with instructions.