MinioSPK icon indicating copy to clipboard operation
MinioSPK copied to clipboard

fix(Makefile): disable git safe directory check when generating LDFLAGS

Open johnstcn opened this issue 1 year ago • 0 comments

Recent versions of Git added a feature to check ownership of the repository. This caused buildscripts/gen-ldflags.go to fail with exit status 128 due to the image being run as uid 0 and the minio repository mounted into the container being owned by a different UID.

This PR simply disables the safe directory check before running gen-ldflags.go.

Other possible fixes could include:

  • chowning the repo to uid 0, which would be obnoxious to say the least
  • adding a user to the image with ID matching the UID owning the minio repo

FWIW, go-gitea appears to have gone with the same approach (ref: https://github.com/go-gitea/gitea/blob/c86d033a3ec0514efcd9524d03dce1b6551e487f/snap/snapcraft.yaml#L53)

johnstcn avatar Feb 24 '24 20:02 johnstcn