Skip to content

Commit 1bd6529

Browse files
committed
review
1 parent a9cfb4d commit 1bd6529

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ PACKAGE_OS_ARCHES := linux_amd64 linux_armv7 linux_arm64
8080
DOCKER_ARCHES := amd64 arm64 armv7
8181

8282
# All ${OS}_${ARCH} combos we build the desktop dylib for.
83-
DYLIB_ARCHES := darwin_amd64.dylib darwin_arm64.dylib
83+
DYLIB_ARCHES := darwin_amd64 darwin_arm64
8484

8585
# Computed variables based on the above.
8686
CODER_SLIM_BINARIES := $(addprefix build/coder-slim_$(VERSION)_,$(OS_ARCHES))
87-
CODER_DYLIBS := $(addprefix build/coder-vpn_$(VERSION)_,$(DYLIB_ARCHES))
87+
CODER_DYLIBS := $(foreach os_arch, $(DYLIB_ARCHES), build/coder-vpn_$(VERSION)_$(os_arch).dylib)
8888
CODER_FAT_BINARIES := $(addprefix build/coder_$(VERSION)_,$(OS_ARCHES))
8989
CODER_ALL_BINARIES := $(CODER_SLIM_BINARIES) $(CODER_FAT_BINARIES)
9090
CODER_TAR_GZ_ARCHIVES := $(foreach os_arch, $(ARCHIVE_TAR_GZ), build/coder_$(VERSION)_$(os_arch).tar.gz)
@@ -254,7 +254,7 @@ $(CODER_DYLIBS): go.mod go.sum $(GO_SRC_FILES)
254254
--dylib
255255

256256
cp "$@" "./site/out/bin/coder-vpn-$$os-$$arch.dylib"
257-
cp "*.h" "./site/out/bin/coder-vpn-$$os.h"
257+
cp ./build/*.h "./site/out/bin/coder-vpn-$$os.h"
258258
else
259259
echo "Skipping dylib build on non-Darwin OS"
260260
fi

scripts/build_go.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,15 @@ if [[ "$agpl" == 1 ]]; then
177177
fi
178178

179179
cgo=0
180-
sdk=""
181180
if [[ "$dylib" == 1 ]]; then
182181
if [[ "$os" != "darwin" ]]; then
183182
error "dylib builds are not supported on $os"
184183
fi
185184
cgo=1
186185
cmd_path="./vpn/dylib/lib.go"
187186
build_args+=("-buildmode=c-shared")
188-
sdk="$(xcrun --sdk macosx --show-sdk-path)"
187+
SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
188+
export SDKROOT
189189
bin_ident="com.coder.vpn"
190190
fi
191191

@@ -195,7 +195,7 @@ if [[ "$boringcrypto" == 1 ]]; then
195195
goexp="boringcrypto"
196196
fi
197197

198-
GOEXPERIMENT="$goexp" CGO_ENABLED="$cgo" GOOS="$os" GOARCH="$arch" GOARM="$arm_version" SDKROOT="$sdk" \
198+
GOEXPERIMENT="$goexp" CGO_ENABLED="$cgo" GOOS="$os" GOARCH="$arch" GOARM="$arm_version" \
199199
go build \
200200
"${build_args[@]}" \
201201
"$cmd_path" 1>&2

scripts/sign_darwin.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
# On success, the input file will be signed using the Apple Developer
99
# certificate.
1010
#
11+
# For the Coder CLI, the binary_identifier should be "com.coder.cli".
12+
# For the CoderVPN `.dylib`, the binary_identifier should be "com.coder.vpn".
13+
#
1114
# You can check if a binary is signed by running the following command on a Mac:
1215
# codesign -dvv path/to/binary
1316
#

0 commit comments

Comments
 (0)