flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
521 stars 35 forks source link

Tested fix for renaming build outputs with .fap extension. #36

Closed ASoldo closed 1 year ago

ASoldo commented 1 year ago

HI, I've read on previous issue (https://github.com/flipperzero-rs/flipperzero/issues/18#issuecomment-1340365442) about .fap files and location. I found a way to have build output renamed to .fap with Cargo.toml update. Here is the original post about this topic --> https://github.com/rust-lang/cargo/issues/1706#issuecomment-868959484

Here is my Cargo.toml

cargo-features = ["different-binary-name"]    # <-- this 
[package]
name = "hello-rust"
version = "0.1.0"
edition = "2021"
rust-version = "1.64.0"
autobins = false
autoexamples = false
autotests = false
autobenches = false

[[bin]]
name = "hello-rust"
filename = "hello-rust.fap"  # <-- this
bench = false
test = false

[dependencies]
flipperzero = { version = "0.6.0", path = "../../crates/flipperzero" }
flipperzero-sys = { version = "0.6.0", path = "../../crates/sys" }
flipperzero-rt = { version = "0.6.0", path = "../../crates/rt" }

And that is pretty much it, I have created a build and upload it to Flipper and works like a charm. Maybe you could update all other examples to include this.

dcoles commented 1 year ago

Very cool! That's a great find!

It seems like this is a nightly-only feature (different-binary-name) but we already require nightly for alloc_error_handler (flipperzero-alloc).

I'll make this change shortly.