Skip to content

feat: windows build#697

Open
noahpodgurski wants to merge 21 commits intotronbyt:mainfrom
noahpodgurski:add-windows-build
Open

feat: windows build#697
noahpodgurski wants to merge 21 commits intotronbyt:mainfrom
noahpodgurski:add-windows-build

Conversation

@noahpodgurski
Copy link
Contributor

@noahpodgurski noahpodgurski commented Jan 23, 2026

Standalone windows builder

  • Simply run ./build.ps1
  • Run tronbyt-server.exe

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @noahpodgurski, 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 introduces comprehensive support for building and running the application on Windows. It streamlines the build process through a dedicated PowerShell script and modifies the application's boot logic to intelligently manage data and database file locations for standalone Windows binaries, significantly improving the out-of-the-box experience for Windows users.

Highlights

  • Windows Build Script: A new PowerShell script (build.ps1) has been added to automate the entire build process for Windows, including dependency checks, environment setup, and compilation of all necessary executables (boot.exe, tronbyt-server.exe, migrate.exe).
  • Standalone Windows Executable Support: The cmd/boot/main.go entrypoint has been modified to automatically configure DATA_DIR and DB_DSN environment variables for standalone Windows executables. This ensures that data and database files are correctly located relative to the executable and that the necessary data directory is automatically created.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a Windows build process using a PowerShell script and adapts the application's boot sequence for standalone Windows execution. The changes are well-structured and address the goal of creating a portable Windows version. My review includes suggestions to improve the robustness of the build script by adding dependency checks and to enhance error handling in the Go code to prevent unexpected behavior regarding data storage locations. All original comments have been retained as they do not contradict the provided rules.

@tavdog
Copy link
Member

tavdog commented Jan 28, 2026

i wonder why the tests are failing.

@tavdog
Copy link
Member

tavdog commented Feb 2, 2026

one of the tests

Root cause

The test sets s.systemAppsCache.Path to "system-apps/apps/clock" (forward slashes). handleAddAppPost calls s.getAppMetadata(appPath) with appPath "system-apps/apps/clock/clock.star" and getAppMetadata uses filepath.Dir(appPath) and compares that value directly to the cached Path string.
On Windows, filepath uses OS path separators (backslashes). The cached Path still has forward slashes, so the string comparison fails (e.g. "system-apps\apps\clock" != "system-apps/apps/clock"). That means the metadata lookup returns nil and the code falls back to the default recommendedInterval = 15. On Unix the separators match and the metadata is found (recommendedInterval = 5), so the test passes there.

@tavdog
Copy link
Member

tavdog commented Feb 6, 2026

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a Windows build script and adapts the Go code for Windows compatibility, including well-executed build tags for Unix-specific logic and robust cross-platform path handling using filepath.ToSlash and securejoin. However, a potential Denial of Service vulnerability was identified in the unzip function due to the lack of resource limits during decompression (Zip Bomb protection). Additionally, cmd/boot/main.go still contains syscall.Exec, which is not available on Windows and will cause build failures. Further improvements are suggested for the new build.ps1 script to enhance its robustness and clarity.

Comment on lines +22 to +23
$COMMIT = git rev-parse --short HEAD
$VERSION = git describe --tags --always --dirty
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current method of getting version information from git is not fully robust. If git commands fail (for example, in a newly initialized repository with no commits), the variables will be empty, resulting in missing version information in the compiled binary. It would be better to handle these potential errors and explicitly fall back to the default values.

    $COMMIT = $(git rev-parse --short HEAD)
    if ($LASTEXITCODE -ne 0) {
        Write-Warning "Failed to get git commit hash. Using default 'unknown'."
        $COMMIT = "unknown"
    }
    $VERSION = $(git describe --tags --always --dirty)
    if ($LASTEXITCODE -ne 0) {
        Write-Warning "Failed to get git version. Using default 'dev'."
        $VERSION = "dev"
    }

Comment on lines +31 to +32
$env:CGO_ENABLED = "1"

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The environment variable $env:CGO_ENABLED is set on line 31, but it was already set on line 10. This second assignment is redundant. These lines can be removed to improve the script's clarity and maintainability.

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.

3 participants