7sDream / fontfor

Find fonts which can show a specified character and preview them in terminal or browser.
GNU General Public License v3.0
160 stars 7 forks source link

Build failure caused by `#[deny(warnings)]` #70

Closed pluiedev closed 4 months ago

pluiedev commented 4 months ago

Pretty self-explanatory:

    Checking fontfor v0.4.2 (/home/leah/coding/fontfor)
error: fields `left` and `top` are never read
  --> src/rasterizer/bitmap.rs:23:9
   |
22 | pub struct Metrics {
   |            ------- fields in this struct
23 |     pub left: usize,
   |         ^^^^
24 |     pub top: usize,
   |         ^^^
   |
note: the lint level is defined here
  --> src/main.rs:20:9
   |
20 | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

error: could not compile `fontfor` (bin "fontfor") due to 1 previous error

Please consider setting up some sort of CI system if you'd like to use #[deny(warnings)], so that this kind of problem gets caught before it gets into someone else's CI (in my case, NixOS's Hydra, which produces a build log like this).

7sDream commented 4 months ago

Will fix this and add a normal build step in daily CI.

But because of this tool is almostly done and not active enough, Github daily CI will automatic stop running after serval month.

So I guss I can just remove this lint in code and enable it only in CI step.

Thanks for the report anyway.

7sDream commented 4 months ago

@pluiedev Can you give some infomation about which version of Rust you are using?

I just tried compile on my Windows/Linux machine with latest stable Rust and it seems there is no warning be reported.

And the reborn CI seems also has no complaints about this code.

pluiedev commented 4 months ago

@pluiedev Can you give some infomation about which version of Rust you are using?

I just tried compile on my Windows/Linux machine with latest stable Rust and it seems there is no warning be reported.

And the reborn CI seems also has no complaints about this code.

I'm using 1.80.0 nightly, 2024-05-01, and I can still reproduce the issue on my own computer.

7sDream commented 4 months ago

Nightly is just not a compiler version I want to support, cuz its behavior can change from day to day. But I added beta channel in daily lint CI, hope this can capture errors before stable release comes out.

And only deny warnings in CI is a nice change anyway, so it's done. Maybe you can try compile again in master branch.

BTW, the compile failed in the build log you linked is caused by #69, and already fixed in 0.4.2. So update source code version in nixpkg may also fix it.

pluiedev commented 4 months ago

It compiles on latest commit now, thanks! Will update to 0.4.3 directly once that is out

7sDream commented 4 months ago

Just released 0.4.3, FYI