Description
Describe the bug
Once you've built with --features ts-gen
, as is the default used by rust-analyzer in VSCode, future builds without this feature fail. This is because the git tracked src/generated/meshtastic.rs
file is modified to require the specta crate, but this dependency is not included with default builds.
To Reproduce
Steps to reproduce:
git clone https://github.com/meshtastic/rust.git
git submodule update --init
cargo build
(works)cargo build --features ts-gen
cargo build
(doesn't work anymore)
Expected behavior
Builds should be idempotent, no matter what features were enabled.
Additional context
This behavior is particularly frustrating for VSCode users, as the first cargo build
they try and run will fail if the VSCode editor has already been opened on the project, and a ts-gen
build may have been created by the rust-analyzer automatically.
I think the proper fix is to modify build.rs
so that src/generated/meshtastic.rs
doesn't get permanently modified after the build.