InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Fix git hash calculation with Docker build

Open febrezo opened this issue 1 year ago • 2 comments

Fix error when compiling the Pinetime using the Docker image. If done with Docker, the container does not trust the /sources folder, leading to a blank response of the command that grabs the git commit git rev-parse --short HEAD.

fatal: detected dubious ownership in repository at '/sources'
To add an exception for this directory, call:

        git config --global --add safe.directory /sources
PROJECT_GIT_COMMIT_HASH_SUCCESS? 128

BUILD CONFIGURATION
-------------------
    * Mode : Release
    * Version : 1.3.0
    * Toolchain : /opt/gcc-arm-none-eabi-10.3-2021.10
    * GitRef(S) :
    * NRF52 SDK : /opt/nRF5_SDK_15.3.0_59ac345
    * Target device : PINETIME
    * Build DFU (using adafruit-nrfutil) : Enabled
    * Build resources : Enabled

If the git config --global --add safe.directory /sources is added to the Dockerfile, the problem is solved and the hash is added correctly.

febrezo avatar Dec 24 '23 18:12 febrezo

Build size and comparison to main:

Section Size Difference
text 369544B -16B
data 940B 0B
bss 63516B 0B

github-actions[bot] avatar Dec 24 '23 18:12 github-actions[bot]

This is likely the cause for #1842. If possible I would prefer us to figure out why the ownership is dubious and fix that before just adding marking the source dir as safe.

FintasticMan avatar Dec 24 '23 19:12 FintasticMan