Skip to content

Commit

Permalink
Fix version.dtsi is reset after local firmware build (KinesisCorporat…
Browse files Browse the repository at this point in the history
…ion#385)

In KinesisCorporation#376 a new step was introduced for local builds to undo changes
to the version.dtsi file after a build in order to reduce noise to the repo.

Unfortunately the way used to execute the step causes the version.dtsi
file to be reset too early and therefore causes an incorrect version
number to be used for the version macro when run locally. This went
unfortunately undiscovered as the checked in version.dtsi was the same
on the day the change in KinesisCorporation#376 was tested and was not noticed until
I build a new change to my keymap locally a few days ago.

The git command introduced in KinesisCorporation#376 is wrapped into a shell function.

However what was missed is that commands run by the shell function are run when
the function calls are expanded by make. This causes the version.dtsi file to be reset
before the firmware build process is even started which resultes in the version.dtsi
currently checked in to the repo to be used for local builds instead of the
newly generated file when make starts.

This change updates how the git command to reset the version.dtsi
is being called. It is no longer called within a shell function to ensure it
does run in the order it is defined after the firmware build is complete.

Builds run through GitHub actions are not impacted and always used the correct version.dtsi

For more information and context see:
  - https://www.gnu.org/software/make/manual/html_node/Shell-Function.html
  - https://www.gnu.org/software/make/manual/html_node/Reading-Makefiles.html
  • Loading branch information
huber-th authored Feb 20, 2024
1 parent b4165d6 commit dd3da03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Here's all notable changes and commits to both the configuration repo and the ba
Many thanks to all those who have submitted issues and pull requests to make this firmware better!
## Config repo

18/2/2024 - Fix version.dtsi reset after build when running local builds [#385](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/385)

12/2/2024 - Update GitHub build workflow to use the latest actions [#376](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/376)

2/2/2024 - Makefile enhancements (build left side firmware only, separate clean targets for firmware and docker, reset of version.dtsi after build) [#363](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/363)
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ all:
-e COMMIT=$(COMMIT) \
-e BUILD_RIGHT=true \
zmk
$(shell git checkout config/version.dtsi)
git checkout config/version.dtsi

left:
$(shell bin/get_version.sh >> /dev/null)
Expand All @@ -34,7 +34,7 @@ left:
-e COMMIT=$(COMMIT) \
-e BUILD_RIGHT=false \
zmk
$(shell git checkout config/version.dtsi)
git checkout config/version.dtsi

clean_firmware:
rm -f firmware/*.uf2
Expand Down

0 comments on commit dd3da03

Please sign in to comment.