flipperzero-firmware icon indicating copy to clipboard operation
flipperzero-firmware copied to clipboard

Enable building without Git

Open adisbladis opened this issue 3 years ago • 2 comments

What's new

I want to build my Flipper firmware inside the Nix build sandbox.

In this case the .git directory has been discarded by Nix for reproducibility reasons which currently causes the build to fail since it cannot extract version information.

This can also be useful when building from source dumps such as automatically created Git archives.

The fallback when the Git repository is not available is to allow setting this information via environment variables.

Verification

  • Verification will be contained in upcoming PR with Nix expressions.

Checklist (For Reviewer)

  • [ ] PR has description of feature/bug or link to Confluence/Jira task
  • [ ] Description contains actions to verify feature/bugfix
  • [ ] I've built this code, uploaded it to the device and verified feature/bugfix

adisbladis avatar Jul 20 '22 11:07 adisbladis

Thanks for initiating an effort for bringing reproducible builds to Flipper's firmware. That's a neat feature.

However, the changes you are proposing are not sufficient for everything to work without Git - we are also invoking it in fbt_assets.py for fetching current tag on protobuf submodule, which is necessary for our RPC. And there's a get_fast_git_version_id in site_scons/fbt/version.py we're using internally for build system's tasks.

We're going to add full source tree exports, containing Git versioning info within them, and fix build pipeline to fall back to these versions when Git is not available. But that would require more changes to fbt for it to create such exports and to be able to extract version info from them.

hedger avatar Jul 20 '22 12:07 hedger

If you're willing to contribute to reworking the build system in the way described, you're welcome.

hedger avatar Jul 20 '22 12:07 hedger

Please talk with @hedger if you'd like to continue on nix port. He'll explain limitations on our side.

skotopes avatar Oct 08 '22 18:10 skotopes