Add cross-platform .NET build support and NuGet cache configuration#27
Add cross-platform .NET build support and NuGet cache configuration#27
Conversation
Summary of ChangesHello @Mosch0512, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the build system's flexibility by enabling cross-platform compilation for .NET components, particularly for WSL environments. It addresses specific challenges related to path handling and compiler detection when integrating Windows-based .NET tools within a Linux build context, and provides better control over NuGet caching. Additionally, it includes a fix for MinGW linker order and updates the '.gitignore' for better dependency management. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the build process by adding cross-platform support for the .NET components, which is a great enhancement. The changes correctly handle path conversions for WSL environments and introduce a configurable NuGet cache directory. The fix for the MinGW linker order is also a valuable correction. I've included a couple of suggestions to refactor some duplicated logic in the CMake script, which will improve its maintainability. Overall, this is a well-executed and important update.
400cf2c to
0e7e510
Compare
Move .NET ClientLibrary and ConstantsReplacer builds out of the MSVC-only block so they work with any compiler (including MinGW cross-builds from WSL). Key changes: - Detect dotnet.exe first (for WSL interop), fallback to dotnet - Convert Linux paths to Windows UNC paths (wslpath -w) when calling Windows dotnet.exe from WSL, since MSBuild treats '/' as a switch prefix - Guard wslpath calls with CMAKE_HOST_SYSTEM_NAME to avoid errors on native Windows - Add MU_NUGET_CACHE_DIR cache variable (defaults to <project>/.nuget) - Fix MinGW linker order: opengl32/dwmapi must follow imgui static lib - Add _deps/ to .gitignore for locally-built dependencies
- Add docs/build-guide.md: comprehensive guide covering all build scenarios (WSL+MinGW, CLion via Z: drive, CLion native Windows, VS presets) with step-by-step setup instructions and directory layouts - Update README.md: fix CMake minimum version (3.25), fix CLion working directory to use build output instead of src/bin
0e7e510 to
6ab29ab
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request significantly improves the build system by adding cross-platform support for .NET components, which is a great enhancement for developers on different systems, especially WSL. The changes are well-structured, and the addition of a detailed build guide is very helpful. I've identified a minor typo in the new documentation and a couple of opportunities in the CMake scripts to improve maintainability by reducing code duplication. Overall, this is a solid contribution.
- Add mu_native_path() macro to deduplicate WSL path conversion logic (used by both ClientLibrary and ConstantsReplacer targets) - Skip .NET build when Linux dotnet targets Windows (cross-OS Native AOT is not supported) — fixes CI workflow failure on GitHub Actions - Only link opengl32/dwmapi after imgui for non-MSVC compilers (MinGW needs correct link order, MSVC doesn't) - Fix "Visual Studio 2026" typo in build guide
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request significantly improves the build system by adding cross-platform support for .NET components, particularly for developers using WSL and MinGW. The changes are well-structured, moving the .NET build logic out of the MSVC-specific block and introducing clever mechanisms like wslpath integration to handle path differences between Linux and Windows. The addition of a configurable NuGet cache directory is also a welcome improvement for build consistency. The new docs/build-guide.md is an excellent and thorough piece of documentation that will surely help developers navigate the various build scenarios.
My review includes a couple of suggestions: one to fix a path in the new build guide, and another to make the wslpath handling in the CMake script more robust against potential failures. Overall, this is a high-quality contribution that enhances the project's developer experience.
… path - Add RESULT_VARIABLE check to mu_native_path macro so wslpath failures produce a clear FATAL_ERROR instead of silently passing Linux paths - Fix imgui submodule path in build guide (src/ThirdParty/imgui, not src/dependencies/imgui)
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces significant improvements to the build system by adding cross-platform .NET build support, particularly for MinGW cross-builds from WSL. The changes are well-thought-out, including the logic to detect the correct dotnet executable and handle path translations. The addition of the build-guide.md provides excellent documentation for the new, more complex build scenarios. I have one suggestion to further improve the maintainability of the new CMake logic. Overall, this is a high-quality contribution that greatly enhances the project's build flexibility.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request significantly enhances the project's build system by introducing robust cross-platform support for .NET ClientLibrary and ConstantsReplacer builds, moving them out of the MSVC-only block. Key improvements include intelligent detection of dotnet.exe (with WSL interop considerations), proper path translation for Windows UNC paths when building from WSL, and configurable NuGet cache location to mitigate issues with special characters in user profiles. The addition of docs/build-guide.md is an excellent contribution, providing comprehensive instructions and insights into the various build scenarios and their tradeoffs. The fix for MinGW linker order sensitivity for ImGui dependencies also improves cross-platform compatibility. Overall, these changes greatly improve the flexibility and maintainability of the build process.
|
/gemini summary |
Summary of ChangesThis pull request significantly enhances the project's build system by introducing robust cross-platform support for .NET components, particularly improving compatibility and performance within Windows Subsystem for Linux (WSL) environments. It streamlines the build process by intelligently handling path translations and NuGet caching, ensuring a more consistent and reliable development experience across different operating systems and IDEs. The changes also include crucial linker fixes for MinGW and comprehensive documentation to guide developers through various build configurations. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
|
Move .NET ClientLibrary and ConstantsReplacer builds out of the MSVC-only block so they work with any compiler (including MinGW cross-builds from WSL).
Key changes: