mirror of
https://github.com/fleetdm/fleet
synced 2026-05-22 16:39:01 +00:00
This was required to test https://github.com/fleetdm/fleet/pull/30864 on Apple Silicon. I've created https://github.com/fleetdm/fleet/issues/31092 for tracking purposes. Fixes: - Build univeral binary extension on macOS to test on VMs without Rosetta. - Add support for linux and Windows arm64. Which is also needed to test Linux and Windows on UTM on Apple Silicon. - Add Linux arm64 & Windows arm64 to the test scripts. --- - [X] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [X] Added/updated automated tests - [X] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [X] Make sure fleetd is compatible with the latest released version of Fleet (see [Must rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md)). - [x] Orbit runs on macOS, Linux and Windows. Check if the orbit feature/bugfix should only apply to one platform (`runtime.GOOS`). - [x] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [x] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).
33 lines
2.6 KiB
Bash
Executable file
33 lines
2.6 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
mkdir -p $SCRIPT_DIR/macos $SCRIPT_DIR/windows $SCRIPT_DIR/linux $SCRIPT_DIR/linux-arm64 $SCRIPT_DIR/windows-arm64
|
|
|
|
# 1. build hello_world table extensions
|
|
|
|
GOOS=darwin GOARCH=amd64 go build -o $SCRIPT_DIR/macos/hello_world_macos_amd64.ext $SCRIPT_DIR
|
|
GOOS=darwin GOARCH=arm64 go build -o $SCRIPT_DIR/macos/hello_world_macos_arm64.ext $SCRIPT_DIR
|
|
lipo -create $SCRIPT_DIR/macos/hello_world_macos_amd64.ext $SCRIPT_DIR/macos/hello_world_macos_arm64.ext -output $SCRIPT_DIR/macos/hello_world_macos.ext
|
|
rm $SCRIPT_DIR/macos/hello_world_macos_amd64.ext $SCRIPT_DIR/macos/hello_world_macos_arm64.ext
|
|
|
|
GOOS=windows GOARCH=amd64 go build -o $SCRIPT_DIR/windows/hello_world_windows.ext.exe $SCRIPT_DIR
|
|
GOOS=windows GOARCH=arm64 go build -o $SCRIPT_DIR/windows-arm64/hello_world_windows_arm64.ext.exe $SCRIPT_DIR
|
|
|
|
GOOS=linux GOARCH=amd64 go build -o $SCRIPT_DIR/linux/hello_world_linux.ext $SCRIPT_DIR
|
|
GOOS=linux GOARCH=arm64 go build -o $SCRIPT_DIR/linux-arm64/hello_world_linux_arm64.ext $SCRIPT_DIR
|
|
|
|
# 2. build hello_mars table extensions
|
|
|
|
GOOS=darwin GOARCH=amd64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/macos/hello_mars_macos_amd64.ext $SCRIPT_DIR
|
|
GOOS=darwin GOARCH=arm64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/macos/hello_mars_macos_arm64.ext $SCRIPT_DIR
|
|
lipo -create $SCRIPT_DIR/macos/hello_mars_macos_amd64.ext $SCRIPT_DIR/macos/hello_mars_macos_arm64.ext -output $SCRIPT_DIR/macos/hello_mars_macos.ext
|
|
rm $SCRIPT_DIR/macos/hello_mars_macos_amd64.ext $SCRIPT_DIR/macos/hello_mars_macos_arm64.ext
|
|
|
|
GOOS=windows GOARCH=amd64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/windows/hello_mars_windows.ext.exe $SCRIPT_DIR
|
|
GOOS=windows GOARCH=arm64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/windows-arm64/hello_mars_windows_arm64.ext.exe $SCRIPT_DIR
|
|
|
|
GOOS=linux GOARCH=amd64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/linux/hello_mars_linux.ext $SCRIPT_DIR
|
|
GOOS=linux GOARCH=arm64 go build -ldflags '-X "main.extensionName=test_extensions.hello_mars" -X "main.tableName=hello_mars" -X "main.columnValue=mars"' -o $SCRIPT_DIR/linux-arm64/hello_mars_linux_arm64.ext $SCRIPT_DIR
|