Skip to content

Windows build fails: Invalid icon.ico format and Unix-only imports #83

@BTC-Bob

Description

@BTC-Bob

Windows build fails: Invalid icon.ico format and Unix-only imports

Environment

  • OS: Windows 11
  • Rust version: 1.88.0
  • Tauri CLI version: 2.5.0
  • Bun version: 1.2.17
  • Build tools: Microsoft C++ Build Tools (Visual Studio Build Tools 2022)

Description

When attempting to build Claudia on Windows, the build process fails with two distinct issues that prevent successful compilation and packaging.

Issue 1: Invalid ICO file format

Error message:

error RC2175: resource file \\?\C:\Projects\claudia\src-tauri\icons\icon.ico is not in 3.00 format

Root cause:

The icon.ico file in the repository is either corrupted or not in the proper Windows ICO format that the Windows Resource Compiler expects.

Details:

  • File location: src-tauri/icons/icon.ico
  • Current file size: 6,261 bytes
  • The Windows Resource Compiler requires ICO files to be in "3.00 format"
  • Other icon files (PNG, ICNS) are present and valid

Issue 2: Unix-only import on Windows

Error message:

error[E0432]: unresolved import `crate::sandbox::executor::create_sandboxed_command`
   --> src\commands\claude.rs:984:26
    |
984 |     use crate::sandbox::{executor::create_sandboxed_command, profile::ProfileBuilder};
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `create_sandboxed_command` in `sandbox::executor`

Root cause:

The function create_sandboxed_command is gated with #[cfg(unix)] at line 399 in src/sandbox/executor.rs, making it unavailable on Windows.

Steps to Reproduce

  1. Clone the repository:

    git clone https://github.com/getAsterisk/claudia.git
    cd claudia
  2. Install dependencies:

    bun install
  3. Attempt to build:

    bun run tauri build

Expected Behavior

The application should build successfully on Windows, creating MSI and NSIS installers.

Actual Behavior

Build fails with the errors mentioned above.

Workaround/Solutions Applied

For Issue 1 (Icon):

  1. Used online ICO converter (icoconverter.com) to convert icon.png to proper Windows ICO format
  2. Generated ICO with multiple resolutions (16x16, 32x32, 48x48, 64x64) at 32-bit color depth
  3. Replaced the corrupted icon.ico with the properly formatted version
  4. File size of working ICO: 32,038 bytes

For Issue 2 (Unix import):

  1. Edited src-tauri/src/commands/claude.rs line 984
  2. Removed the Unix-only import:
    // Before:
    use crate::sandbox::{executor::create_sandboxed_command, profile::ProfileBuilder};
    
    // After:
    use crate::sandbox::{profile::ProfileBuilder};

Additional Context

The build process also showed that icon_template.ico exists but is 0 bytes, suggesting the icon generation process might have failed previously.

After applying both fixes, the build completed successfully, producing:

  • Claudia_0.1.0_x64_en-US.msi
  • Claudia_0.1.0_x64-setup.exe

Suggested Permanent Fixes

  1. Icon Issue:

    • Include a properly formatted Windows ICO file in the repository
    • Add a GitHub Action to validate ICO files on commit
    • Document the ICO format requirements in the build documentation
  2. Unix Import Issue:

    • Add conditional compilation for Windows in claude.rs:
    #[cfg(unix)]
    use crate::sandbox::executor::create_sandboxed_command;
    use crate::sandbox::profile::ProfileBuilder;
    • Or provide a Windows-compatible implementation of sandboxing

System Information

Windows 11 Pro
Version: 23H2
Build: 22631.3958
Architecture: x64

Logs

Full build logs available upon request.


I'm happy to:

  • Provide the working icon.ico file
  • Submit a PR with these fixes
  • Test any proposed solutions on Windows

Thank you for creating this excellent tool! Despite these build issues, Claudia works wonderfully once compiled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions