[GH-ISSUE #259] Build fail: "Could not compile resource file" - Windows 10 #189

Closed
opened 2026-02-28 14:31:14 +03:00 by kerem · 3 comments
Owner

Originally created by @geom3trik on GitHub (Jan 14, 2022).
Original GitHub issue: https://github.com/jpochyla/psst/issues/259

Describe the bug
The application failed to build on my Windows 10 machine with the following error:

error: failed to run custom build command for `psst-gui v0.1.0 (C:\Rust\psst\psst-gui)`

Caused by:
  package.metadata.winres does not exist

  --- stderr
  gcc: error: C:Rustpssttargetreleasebuildpsst-gui-7cf215d7ed9b0c72outresource.rc: No such file or directory
  gcc: fatal error: no input files
  compilation terminated.
  /usr/bin/windres: preprocessing failed.
  thread 'main' panicked at 'Could not attach exe icon: Custom { kind: Other, error: "Could not compile resource file" }', psst-gui\build.rs:6:23
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To Reproduce
Ran the following commands in the psst-gui directory:

git submodule update --recursive --init
cargo build --release

Expected behavior
Build success.

Screenshots
N/A

Environment

  • OS: Windows 10 Education
  • Version: 2004

Additional context
My default cargo toolchain is stable-gnu but I also tried stable-msvc and nightly-gnu.

Originally created by @geom3trik on GitHub (Jan 14, 2022). Original GitHub issue: https://github.com/jpochyla/psst/issues/259 **Describe the bug** The application failed to build on my Windows 10 machine with the following error: ``` error: failed to run custom build command for `psst-gui v0.1.0 (C:\Rust\psst\psst-gui)` Caused by: package.metadata.winres does not exist --- stderr gcc: error: C:Rustpssttargetreleasebuildpsst-gui-7cf215d7ed9b0c72outresource.rc: No such file or directory gcc: fatal error: no input files compilation terminated. /usr/bin/windres: preprocessing failed. thread 'main' panicked at 'Could not attach exe icon: Custom { kind: Other, error: "Could not compile resource file" }', psst-gui\build.rs:6:23 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` **To Reproduce** Ran the following commands in the `psst-gui` directory: ``` git submodule update --recursive --init cargo build --release ``` **Expected behavior** Build success. **Screenshots** N/A **Environment** - OS: Windows 10 Education - Version: 2004 **Additional context** My default cargo toolchain is stable-gnu but I also tried stable-msvc and nightly-gnu.
kerem 2026-02-28 14:31:14 +03:00
Author
Owner

@jpochyla commented on GitHub (Jan 25, 2022):

Do you know why the GH Action succeeds but the process fails on your machine?

<!-- gh-comment-id:1021646443 --> @jpochyla commented on GitHub (Jan 25, 2022): Do you know why the GH Action succeeds but the process fails on your machine?
Author
Owner

@geom3trik commented on GitHub (Jan 26, 2022):

I'm sorry I do not. I'm guessing that maybe I might be missing some library perhaps? Do you know if anything special is required for "attaching the icon" or "compiling the resource file"? I'll be honest I'm not entirely sure I understand what the error is saying, but looking at the code and at the files I can't find an icon file so I assume it's supposed to be generated or something?

<!-- gh-comment-id:1021986132 --> @geom3trik commented on GitHub (Jan 26, 2022): I'm sorry I do not. I'm guessing that maybe I might be missing some library perhaps? Do you know if anything special is required for "attaching the icon" or "compiling the resource file"? I'll be honest I'm not entirely sure I understand what the error is saying, but looking at the code and at the files I can't find an icon file so I assume it's supposed to be generated or something?
Author
Owner

@CSymes commented on GitHub (Feb 8, 2022):

Just had a quick look, it's because the psst-gui/assets/logo.ico file is missing. Peeking at the build pipeline, it is indeed getting generated at build-time, and creating that file locally allows me to build and run it (although it doesn't actually display on the application when running cargo run, but that's presumably another issue).

Seeing as the repo already includes many other raster icons, is there any reason not to just include logo.ico additionally?
Alternately, could generate it during the build (obviously this would add a dependency on imagemagick), or at the minimum, perhaps yield a more useful error indicating that the file needs to be generated prior to build.

<!-- gh-comment-id:1032472593 --> @CSymes commented on GitHub (Feb 8, 2022): Just had a quick look, it's because the psst-gui/assets/logo.ico file is missing. Peeking at [the build pipeline](https://github.com/jpochyla/psst/blob/master/.github/workflows/build.yml#L39), it is indeed getting generated at build-time, and creating that file locally allows me to build and run it (although it doesn't actually display on the application when running `cargo run`, but that's presumably another issue). Seeing as the repo already includes many other raster icons, is there any reason not to just include `logo.ico` additionally? Alternately, could generate it during the build (obviously this would add a dependency on imagemagick), or at the minimum, perhaps yield a more useful error indicating that the file needs to be generated prior to build.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#189
No description provided.