Skip to content

fix(855): Windows build (rebased/simplified 2025-06-23) #861

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

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

joshuamegnauth54
Copy link
Contributor

Closes: #855

The original issue mentions that several examples fail to build. They fail to build on Linux as well due to bit rot. I started fixing some of those issues until I realized that this is a larger project than I expected. 😆 So, this PR mainly fixes the Windows build.

@ti-integra
Copy link

ti-integra commented Apr 29, 2025

build error

error: invalid format string: expected `}`, found `$`
   --> src\widget\header_bar.rs:428:43
    |
428 |                         "../../res/icons/{$name}.svg"
    |                                          -^ expected `}` in format string
    |                                          |
    |                                          because of this opening brace
    

the error point to here

    #[cfg(not(target_os = "linux"))]
                let icon = {
                    widget::icon::from_svg_bytes(include_bytes!(format!(
                        "../../res/icons/{$name}.svg"
                    )))
                    .symbolic(true)
                    .apply(widget::button::icon)
                    .padding(8)
                };

using this also in windows

                let icon = {
                    widget::icon::from_name($name)
                        .apply(widget::button::icon)
                        .padding(8)
                };

was able build table-view and spin-button but without icons

image

@joshuamegnauth54
Copy link
Contributor Author

Sorry. I'm going to fix this today since I have time. 😁

@joshuamegnauth54 joshuamegnauth54 force-pushed the fix-855-windows-build branch 4 times, most recently from c88b61a to 72ae2da Compare April 30, 2025 05:08
@joshuamegnauth54 joshuamegnauth54 marked this pull request as ready for review April 30, 2025 05:10
@joshuamegnauth54
Copy link
Contributor Author

This works now if you would like to use it before it's merged. The fix is a one-liner for the library, but I'll tackle some of the examples in another PR since it's a larger project.

@tredeneo
Copy link

tredeneo commented May 1, 2025

I have upgrade to last commit and build table-view example without errors, with icons

image

@joshuamegnauth54 joshuamegnauth54 changed the title fix(855): Windows build fix(855): Windows build (rebased/simplified 2025-06-23) Jun 24, 2025
@joshuamegnauth54
Copy link
Contributor Author

joshuamegnauth54 commented Jun 24, 2025

I reverted the changes to the examples because they require more changes anyway. So, now this patch is very small and easier to merge.

The failing test is not due to this patch. Issue fixed upstream so tests pass after rebasing.

`include_bytes!` needs a string literal, so it can't be used in
conjunction with `concat!` yet.
@mmstick mmstick merged commit 46cbce0 into pop-os:master Jun 26, 2025
14 checks passed
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.

fail build on windows
4 participants