Skip to content

Distribution fixes for MacOS #172

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

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix compile
  • Loading branch information
rjtokenring committed Nov 6, 2024
commit a697df6318e1f28f522a53d355616a1ca0f5d244
31 changes: 27 additions & 4 deletions DistTasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ tasks:
- task: Linux_ARMv7
- task: Linux_ARM64
- task: macOS_64bit
- task: macOS_ARM64

Windows_32bit:
desc: Builds Windows 32 bit binaries
Expand Down Expand Up @@ -168,7 +169,7 @@ tasks:

vars:
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_6"
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false"
BUILD_PLATFORM: "linux/armv6"
CONTAINER_TAG: "{{.GO_VERSION}}-armel-debian12"
PACKAGE_PLATFORM: "Linux_ARMv6"
Expand Down Expand Up @@ -197,7 +198,7 @@ tasks:
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz"

macOS_64bit:
desc: Builds Mac OS X 64 bit binaries
desc: Builds Mac OS X x86_64 bit binaries
dir: "{{.DIST_DIR}}"
cmds:
- |
Expand All @@ -212,7 +213,7 @@ tasks:

vars:
PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_amd64"
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}"
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false"
BUILD_PLATFORM: "darwin/amd64"
# We are experiencing the following error with macOS_64bit build:
#
Expand All @@ -227,6 +228,28 @@ tasks:
#
# To compile it we need an SDK >=10.12 so we use the debian10 based container that
# has the SDK 10.14 installed.
CONTAINER_TAG: "{{.GO_VERSION}}-darwin"
CONTAINER_TAG: "{{.GO_VERSION}}-darwin-debian10"
PACKAGE_PLATFORM: "macOS_64bit"
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz"

macOS_ARM64:
desc: Builds Mac OS X ARM64 binaries
dir: "{{.DIST_DIR}}"
cmds:
- |
docker run -v `pwd`/..:/home/build -w /home/build \
-e CGO_ENABLED=1 \
{{.CONTAINER}}:{{.CONTAINER_TAG}} \
--build-cmd "{{.BUILD_COMMAND}}" \
-p "{{.BUILD_PLATFORM}}"

tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}}
sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}}

vars:
PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_arm64"
BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false"
BUILD_PLATFORM: "darwin/arm64"
CONTAINER_TAG: "{{.GO_VERSION}}-darwin-arm64-debian10"
PACKAGE_PLATFORM: "macOS_ARM64"
PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz"