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 + docs, closes #22, closes #25 #23

Merged
merged 14 commits into from
Sep 25, 2024
Merged

Conversation

greynewell
Copy link
Owner

@greynewell greynewell commented Sep 24, 2024

  • Create release.ps1 script
  • Update docs with Windows Support + Instructions
  • Badge
  • Build release version of llama-server in Bash scripts
  • Correct WebBrowserComponent related build errors
  • Successfully test local operation of the plugin on Windows

Summary by Sourcery

Add support for building and running the project on Windows by updating CMake configurations, adding PowerShell scripts for building and cleaning, and extending CI workflows to include Windows. Update documentation to reflect these changes and include Python as a new requirement.

New Features:

  • Add Windows support by introducing Windows-specific build commands and scripts.

Enhancements:

  • Update CMake configuration to handle both Windows and non-Windows platforms for building and copying resources.
  • Include Python 3.10 or later as a requirement for model downloading and processing.

CI:

  • Extend CI workflows to include Windows as a target platform, using the 'cl' compiler.

Documentation:

  • Update README with instructions for cloning submodules and include Python as a requirement in the documentation.

Copy link
Contributor

sourcery-ai bot commented Sep 24, 2024

Reviewer's Guide by Sourcery

This pull request adds Windows support to the project, including changes to the build system, CI pipeline, and documentation. The main changes involve modifying the CMakeLists.txt file to handle Windows-specific paths and commands, updating the GitHub Actions workflow to include Windows builds, and adding PowerShell scripts for Windows-specific build and clean operations.

File-Level Changes

Change Details Files
Add Windows-specific build commands and file paths in CMakeLists.txt
  • Introduce conditional logic to handle Windows and non-Windows builds
  • Update file paths and commands for Windows (e.g., .exe extensions, different directory structures)
  • Modify copy commands for llama-server and model weights to work on Windows
CMakeLists.txt
Update GitHub Actions workflow to include Windows builds
  • Add windows-latest to the matrix of operating systems
  • Include cl compiler for Windows builds
  • Add a separate step for Windows builds using PowerShell script
.github/workflows/cmake.yml
Add PowerShell scripts for Windows build and clean operations
  • Create debug.ps1 for Windows debug builds
  • Create clean.ps1 for cleaning up build artifacts on Windows
  • Create models.ps1 for downloading model files on Windows
scripts/build/debug.ps1
scripts/clean.ps1
scripts/models.ps1
Update documentation to reflect Windows support and new requirements
  • Add Python 3.10 or later as a requirement
  • Include instructions for cloning with submodules
  • Update compiler requirements to include MSVC 2017+
README.md
docs/requirements.md
Update llama.cpp submodule
  • Update llama.cpp submodule to a newer commit
llama.cpp
Modify debug.sh script
  • Add explicit compiler paths to the CMake command
scripts/build/debug.sh

Sequence Diagram

No sequence diagram generated.


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @greynewell - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider keeping GCC in the build matrix for Linux to ensure compatibility with both major compiler families.
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 1 issue found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

scripts/build/debug.ps1 Outdated Show resolved Hide resolved
scripts/build/debug.sh Outdated Show resolved Hide resolved
scripts/models.ps1 Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
greynewell and others added 4 commits September 24, 2024 14:08
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@greynewell
Copy link
Owner Author

Sweet, we at least have the same error on the client and server now:

D:\a\musegpt\musegpt\src\main.cpp(448,43): error C2039: 'withResourceProvider': is not a member of 'juce::WebBrowserComponent::Options' [D:\a\musegpt\musegpt\build\release\musegpt.vcxproj]
      D:\a\musegpt\musegpt\JUCE\modules\juce_gui_extra\misc\juce_WebBrowserComponent.h(100,20):
      see declaration of 'juce::WebBrowserComponent::Options'
  
  juce_gui_basics.cpp

@greynewell greynewell changed the title Add Windows support, closes #22 Add Windows support + docs, closes #22, closes #25 Sep 24, 2024
@greynewell
Copy link
Owner Author

The issue appears to be that the definition for withResourceProvider is excluded by an #ifndef on JUCE_WEB_BROWSER_RESOURCE_PROVIDER_AVAILABLE. If memory serves, that means I've made a mistake in my CMake scripts... could possibly need to specify the location of the WebView 2 runtime?

@greynewell
Copy link
Owner Author

Some success building and testing locally:
{73576E43-6595-451E-BD6A-5D53457150DA}

Created #29 to get this fully sorted locally.

@greynewell greynewell merged commit a5d917f into main Sep 25, 2024
3 checks passed
@greynewell greynewell deleted the windows-support branch September 25, 2024 02:01
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.

1 participant