Skip to content

Remove source_hash.txtes from git #3334

@emilk

Description

@emilk

We have a lot of merge conflicts for source_hash.txt, and it is annoying.

We have decided to remove it from git, and only keep it locally.

We still want it to be easy for users to just check out our repository and run cargo build without having to install all the extra tools needed by codegen (flatc, clang-format, black, …). So, we've decided that running codegen automatically is now opt-in.

One easy way to do this is that re_types/build.rs checks for source_hash.txt: if it is missing, it quits. If there is a source_hash.txt, it checks that it is up-to-date, and if not runs codegen. So for users checking out the repository, everything just works. The first time you change an .fbs file you need to also run cargo codegen. It will generate a source_hash.txt for you, and from there on codegen will be triggered automatically by build.rs.

For this we need:

  • The CI needs to run codegen and check that the output is the same as what is checked in (i.e.: run codegen and check that git is still clean)
  • cargo codegen updates source_hash.txt
  • build.rs nope-out if source_hash.txt is missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions