Skip to content

Building with --features ts-gen corrupts future builds without it #53

Closed
@brannondorsey

Description

@brannondorsey

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:

  1. git clone https://github.com/meshtastic/rust.git
  2. git submodule update --init
  3. cargo build (works)
  4. cargo build --features ts-gen
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions