GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix git hash calculation with Docker build by febrezo · Pull Request #1935 · InfiniTimeOrg/InfiniTime

Conversation

@febrezo

@febrezo febrezo commented Dec 24, 2023 •
edited by FintasticMan
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Fixes #1842

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Dec 24, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 374576B -16B
data 948B 0B
bss 63504B 0B
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FintasticMan

FintasticMan commented Dec 24, 2023

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FintasticMan FintasticMan added the bug Something isn't working label Jan 10, 2024
NeroBurner
NeroBurner approved these changes Sep 18, 2024
View reviewed changes

@NeroBurner NeroBurner left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a valid fix for dev containers as described here: https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NeroBurner NeroBurner added this to the 1.15.0 milestone Nov 15, 2024
JF002
JF002 approved these changes Nov 17, 2024
View reviewed changes
@JF002

JF002 commented Nov 17, 2024

Copy link
Copy Markdown
Collaborator

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.

Do you think we should block this PR until we figure that out, or can we merge it in the meantime?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@febrezo @FintasticMan
Fix git hash calculation with Docker build
46d6e35
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.
@FintasticMan
FintasticMan force-pushed the docker-build branch from c9761c9 to 46d6e35 Compare November 17, 2024 14:21
FintasticMan
FintasticMan approved these changes Nov 17, 2024
View reviewed changes

@FintasticMan FintasticMan left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to merge it in the meantime. I've just updated this to the latest main.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@FintasticMan
FintasticMan merged commit 6c7eb66 into InfiniTimeOrg:main Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JF002 JF002 JF002 approved these changes
@NeroBurner NeroBurner NeroBurner approved these changes
@FintasticMan FintasticMan FintasticMan approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

1.15.0

Development

Successfully merging this pull request may close these issues.

Short ref doesn't appear in CI builds

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@febrezo @FintasticMan @JF002 @NeroBurner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.