Skip to content

Added support in battle-server-manager and launcher to macOS#508

Draft
luskaner wants to merge 12 commits into1.15from
453-add-macos-support-for-launcher-and-battle-server-manager
Draft

Added support in battle-server-manager and launcher to macOS#508
luskaner wants to merge 12 commits into1.15from
453-add-macos-support-for-launcher-and-battle-server-manager

Conversation

@luskaner
Copy link
Copy Markdown
Owner

@luskaner luskaner commented May 3, 2026

No description provided.

@luskaner luskaner self-assigned this May 3, 2026
@luskaner luskaner requested a review from Copilot May 3, 2026 23:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the release/build tooling and runtime platform support to include macOS (darwin) for the launcher and battle-server-manager, including new darwin-specific implementations for certificate/hosts/DNS handling and CrossOver/Wine execution paths.

Changes:

  • Expand GoReleaser target matrices to include macOS for launcher and battle-server-manager artifacts.
  • Add/adjust darwin implementations for certificate trust management, DNS flushing, and executor selection (CrossOver/Wine-first behavior on macOS).
  • Refactor several Unix/Linux-only paths to be “unix-like” where appropriate and split Linux vs darwin behaviors.

Reviewed changes

Copilot reviewed 46 out of 46 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/scripts/internal/goreleaser/project.go Adjusts config-helper Windows build outputs and inclusion into non-Windows archives
tools/scripts/internal/goreleaser/constants.go Removes “except macOS” targets and relies on unified Targets64
tools/scripts/internal/goreleaser/config.go Switches launcher/battle-server-manager archives/binaries to build for macOS too
launcher/resources/config.game.toml Updates comments to distinguish Unix-like platforms vs Linux-only Steam
launcher/internal/server/certStore/certStore_windows.go Removes Windows-only noop implementation (moved to shared file)
launcher/internal/server/certStore/certStore_other.go Provides windows+darwin noop ReloadSystemCertificates for build compatibility
launcher/internal/server/certStore/certStore_linux.go Moves unsafe system root reload logic to Linux-only
launcher/internal/game/executor/executor_windows.go Removes old launcher-local executor implementation
launcher/internal/game/executor/executor_unix.go Removes old launcher-local executor implementation
launcher/internal/game/executor/executor_linux.go Removes old launcher-local executor implementation
launcher/internal/game/executor/executor.go Removes old launcher-local executor implementation
launcher/internal/cmdUtils/isolateUserData_unix.go Adds shared unix (non-windows) Wine/CrossOver isolation-path logic
launcher/internal/cmdUtils/isolateUserData_linux.go Delegates Wine/CrossOver isolation-path resolution to unix helper
launcher/internal/cmdUtils/isolateUserData_darwin.go Adds darwin IsolationPath implementation
launcher/internal/cmd/root.go Updates CLI help/validation strings and client-executable behavior by OS
launcher-config-admin/internal/hosts/hosts_darwin.go Adds darwin DNS flush implementation (dscacheutil + mDNSResponder)
launcher-common/userData/backup_windows.go Removes Windows-specific backup base path helper
launcher-common/userData/backup_unix.go Removes Unix-specific backup base path helper
launcher-common/configRevert.go Changes RemoveUserCert behavior to apply to non-Linux OSes
launcher-common/cert/cert_darwin.go Adds macOS keychain trust/untrust/enumeration via security tool
launcher-common/cert/cert.go Refactors PEM parsing into ReadFromData helper
common/game/wine/steam/steam_unix.go Switches config-helper path resolution to new arch-aware executable naming
common/game/wine/steam/crossover/crossover_unix.go Adds multi-base-dir probing for CrossOver bottles
common/game/wine/steam/crossover/crossover_linux.go Defines Linux CrossOver bottle baseDirs
common/game/wine/steam/crossover/crossover_darwin.go Defines macOS CrossOver bottle baseDirs
common/game/steam/steam_unix.go Removes generic unix Steam implementation
common/game/steam/steam_supported.go Limits Steam support to windows+linux builds
common/game/steam/steam_linux.go Moves Linux UserProfilePath implementation here
common/game/steam/steam.go Removes Steam.NewGame from always-built file
common/game/executor/wine/crossover/crossover_unix.go Adds shared non-windows CrossOver executor
common/game/executor/wine/crossover/crossover_linux.go Keeps Linux-specific file search paths (logic moved to unix)
common/game/executor/wine/crossover/crossover_darwin.go Adds macOS CrossOver wine binary search paths
common/game/executor/steam/wine/crossover/crossover_unix.go Adds build tag for non-windows
common/game/executor/steam/steam_other.go Adds non-darwin Steam executor implementation
common/game/executor/steam/steam_darwin.go Adds darwin placeholder Steam Do() implementation
common/game/executor/steam/steam.go Moves Do()/NewExec behind platform-specific files
common/game/executor/executor_darwin.go Adds darwin MakeExec that prefers CrossOver/Wine and supports custom path
common/game/executor/base/base_unix.go Removes generic unix StartUri implementation
common/game/executor/base/base_linux.go Adds Linux StartUri implementation (xdg-open)
common/game/appx/appx_other.go Removes non-windows appx stub file
common/executor/exec/executor_linux.go Removes redundant build tag (file name already constrains to linux)
common/executor/exec/executor_darwin.go Adds darwin osascript argument helpers for terminal/admin flows
common/executables/executables.go Changes executable naming to include GOARCH via ArchFileName
battle-server-manager/internal/cmdUtils/executor/executor_darwin.go Adds darwin auto-path resolution preferring CrossOver then Wine
Taskfile.debug.yml Switches debug Taskfile include selection to windows vs unix
Taskfile.debug.unix.yml Adds darwin platforms; splits out Linux-only server capability prep
Comments suppressed due to low confidence (2)

launcher/internal/cmd/root.go:80

  • The canTrustCertificate help text adds the "user" option when GOOS != linux, implying Windows/macOS support. However, later validation removes "user" from the allowed set on GOOS != linux, so users can be told about an option that is then rejected. Align these conditions so help text and validation match.
    common/executables/executables.go:47
  • NativeFileName now always appends runtime.GOARCH (e.g. server_amd64). That breaks FindPath callers which expect the on-disk layout produced by the release archives (e.g. goreleaser builds the server binary as server under a server/ directory, not server_amd64/server_amd64). Either update the packaging/layout consistently for all binaries, or keep NativeFileName returning the non-arch-suffixed name and introduce a separate helper for the few cases (like config-helper under Wine) that need arch-specific filenames.
func NativeFileName(bin bool, executable string) string {
	return ArchFileName(bin, executable, nil)
}

func ArchFileName(bin bool, executable string, transfileName func(name string) string) string {
	if transfileName == nil {
		transfileName = fileName
	}
	filename := transfileName(fmt.Sprintf("%s_%s", executable, runtime.GOARCH))
	if !bin {
		filename = filepath.Join("bin", filename)
	}
	return filename

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread common/game/executor/steam/steam_darwin.go
Comment thread launcher-common/cert/cert.go
Comment thread launcher/internal/cmd/root.go
Comment thread launcher/internal/cmd/root.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread launcher-common/cert/cert.go
Comment thread common/executables/executables.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

Taskfile.debug.unix.yml:12

  • prepare-launcher calls build-config-helper-*, but those tasks still build config-helper.exe (no GOARCH suffix). In this PR the runtime lookup switched to an arch-specific helper name (e.g. config-helper_amd64.exe / config-helper_arm64.exe), so the debug build output produced by this workflow will no longer be found at runtime. Update the debug tasks to build/copy the arch-suffixed filename (and adjust generates accordingly), or add a fallback in the lookup code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread common/game/wine/steam/steam_unix.go
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

Taskfile.debug.unix.yml:44

  • build-config-helper now builds build/launcher/bin/config-helper_{{.GOARCH}}.exe, but the generates path and the subsequent cp still reference config-helper.exe. This makes the checksum tracking and copy step incorrect and will likely fail on both linux and darwin. Update generates and the cp source path to match the arch-suffixed filename (and ensure the destination name matches what runtime code expects).
    Taskfile.debug.unix.yml:12
  • prepare-launcher is now enabled for darwin, but it unconditionally runs task: prepare-server even though prepare-server is restricted to platforms: [ linux ]. On macOS this can cause task prepare-launcher to fail due to invoking a linux-only task. Consider gating the call (only run it on linux) or inlining the linux-only setcap command under a linux condition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to +13
func terminalArgs() []string {
script := `
on run argv
tell application "Terminal"
activate
do script (item 1 of argv)
end tell
end run
`
return osascriptArgs(script)
}
@luskaner luskaner requested a review from Copilot May 5, 2026 16:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 52 out of 52 changed files in this pull request and generated 5 comments.

Comments suppressed due to low confidence (1)

Taskfile.debug.unix.yml:44

  • build-config-helper now produces arch-suffixed outputs (config-helper_{{.GOARCH}}.exe), but generates and the subsequent cp still reference build/launcher/bin/config-helper.exe. This makes the checksum tracking incorrect and will fail to copy the built helper into build/battle-server-manager/bin on both linux/darwin. Update generates and cp to use the arch-suffixed filename (or copy both arch variants if that’s the intent).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread launcher-common/hosts/line.go
Comment thread launcher-common/hosts/parser.go Outdated
Comment on lines +50 to +57
func UntrustCertificates(userStore bool) (certs []*x509.Certificate, err error) {
var existing []*x509.Certificate
existing, err = EnumCertificates(userStore)
if err != nil {
return
}
if len(existing) == 0 {
return
Comment on lines +63 to +68
certs = make([]*x509.Certificate, 0, len(existing))
for _, cert := range existing {
fingerprint := sha256.Sum256(cert.Raw)
fingerprintHex := strings.ToUpper(hex.EncodeToString(fingerprint[:]))
_, err = runCommand(asAdmin, "delete-certificate", "-Z", fingerprintHex, keychain)
if err != nil {
Comment thread launcher-common/hosts/parser.go Outdated
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