Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix osx build and git user conflict #541

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

gpoulios
Copy link

Solved Problem

When building under OSX the typical user group (staff) has a GID of 20 conflicting with some Ubuntu system group of the container. Additionally if the git users between the host and container don't match (repo cloned on host, used in container), git aborts with a fatal error.

Solution

  • Add '-o' option to groupadd to allow for multiple group names pointing to the same GID
  • Mark the sources directory as a 'safe.directory' for git inside the container

Alternatives

  • '-o' option: perhaps we could use the existing group name but I suppose that would add too much bloat in the dockerfile
  • git safe dir: perhaps we could COPY the host's user git config over to the container though I'm not sure of how portable that can be.

Test coverage

  • Tested only under OSX.

Under OSX, user group (staff) is in the low tens (20)
and conflicts with system groups of Ubuntu. '-o' allows
to create group with same GID but different name.
@gpoulios gpoulios requested a review from jlaitine October 31, 2023 13:42
Copy link

@jlaitine jlaitine left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge whenever you want; we have a self merge policy; author commits after the PR is approved by another developer

Copy link

@jlaitine jlaitine left a comment

Choose a reason for hiding this comment

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

Actually, could you still check why the CI is failing for this? Can be of course unrelated, but previous PR:s passed today...

Copy link

@jlaitine jlaitine left a comment

Choose a reason for hiding this comment

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

What ever was the problem with CI, it seems to be fixed by itself

@gpoulios
Copy link
Author

gpoulios commented Nov 1, 2023

Magic. It seemed random in the first place.

Merging this.

@gpoulios gpoulios merged commit 930c673 into tiiuae:main Nov 1, 2023
38 of 41 checks passed
@gpoulios gpoulios deleted the fix_osx_build_and_git_user_conflict branch November 1, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants