Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
Bottle format 3: drop the stale sync-off pair an old Steam recipe left in the bottle environment
Gauthier Piarrettee70693b7aec3
diff --git a/Sources/HighballKit/Bottle.swift b/Sources/HighballKit/Bottle.swiftindex 75ac29d..86f8704 100644--- a/Sources/HighballKit/Bottle.swift+++ b/Sources/HighballKit/Bottle.swift@@ -195,7 +195,10 @@ public enum ArgumentLine {/// Persisted as `<bottle>/bottle.json` (older bottles: `gin.json`, still read as a fallback).public struct BottleSettings: Codable, Sendable {/// 2: dxvkAsync no longer defaults on. Bottles written at 1 are migrated off once on load.- public var formatVersion: Int = 2+ public var formatVersion: Int = 3+ /// Set by the decoder when it migrated the settings; BottleStore.list() persists such bottles+ /// so the migration runs once. Not encoded.+ public internal(set) var needsSave = falsepublic var name: Stringpublic var engineID: Stringpublic var renderer: Renderer = .dxmt@@ -296,6 +299,20 @@ public struct BottleSettings: Codable, Sendable {if formatVersion < 2 {dxvkAsync = falseformatVersion = 2+ needsSave = true+ }+ // Before 0.7.x the Steam recipe wrote WINEMSYNC=0/WINEESYNC=0 into the bottle-wide+ // environment; since 2d3fd64 they belong to the Steam pin's own launch and the bottle+ // runs msync for games. Bottles set up before that kept the two lines, which silently+ // turned msync off for every game while the Synchronization picker said msync (found on+ // the maintainer's own bottle, 2026-09-04). Drop exactly that stale pair once.+ if formatVersion < 3 {+ if environment["WINEMSYNC"] == "0", environment["WINEESYNC"] == "0" {+ environment.removeValue(forKey: "WINEMSYNC")+ environment.removeValue(forKey: "WINEESYNC")+ }+ formatVersion = 3+ needsSave = true}}diff --git a/Sources/HighballKit/BottleStore.swift b/Sources/HighballKit/BottleStore.swiftindex 3bafe6c..d224a5d 100644--- a/Sources/HighballKit/BottleStore.swift+++ b/Sources/HighballKit/BottleStore.swift@@ -12,14 +12,14 @@ public struct BottleStore: Sendable {// The folder is the bottle's identity (get/delete resolve by folder). A copied// folder keeps the old internal name, which crashed the app and confused lookups// (issue #13) — reconcile so "play copy" is simply a bottle called "play copy".- if b.settings.name != url.lastPathComponent {+ if b.settings.name != url.lastPathComponent || b.settings.needsSave {b.settings.name = url.lastPathComponent// Reconcile in memory always, but persist only into a real directory: saving// through a symlinked entry rewrites a bottle.json outside bottles/ as a side// effect of merely listing. Skipping such entries entirely would be worse —// a bottle deliberately linked to another disk would vanish from the list.var st = stat()- if lstat(url.path, &st) == 0, (st.st_mode & S_IFMT) == S_IFDIR { try? b.save() }+ if lstat(url.path, &st) == 0, (st.st_mode & S_IFMT) == S_IFDIR { try? b.save(); b.settings.needsSave = false }}return b}diff --git a/Tests/HighballKitTests/RegressionTests.swift b/Tests/HighballKitTests/RegressionTests.swiftindex fe2f33b..61a3234 100644--- a/Tests/HighballKitTests/RegressionTests.swift+++ b/Tests/HighballKitTests/RegressionTests.swift@@ -11,7 +11,7 @@ final class RegressionTests: XCTestCase {let json = #"{"name":"b","engineID":"e","dxvkAsync":true,"formatVersion":1}"#let s = try JSONDecoder.highball.decode(BottleSettings.self, from: Data(json.utf8))XCTAssertFalse(s.dxvkAsync, "a bottle written before format 2 must be switched off")- XCTAssertEqual(s.formatVersion, 2, "and stamped, so the migration never runs twice")+ XCTAssertEqual(s.formatVersion, 3, "and stamped, so the migration never runs twice")}/// But a user who turns it back on afterwards keeps it: the stamp is what makes it one-shot.@@ -898,6 +898,27 @@ extension RegressionTests {XCTAssertEqual(EngineStore.offeredEngines(installed: [r1], known: [], current: r1.id).count, 1, "current engine present: no extra row")}+ // A bottle set up by an old Steam recipe carries WINEMSYNC=0/WINEESYNC=0 in its bottle-wide+ // environment, which silently turned msync off for every game. Format 3 drops exactly that+ // pair once; a deliberate WINEMSYNC=1 or a single variable is left alone.+ func testFormat3DropsTheStaleSyncPair() throws {+ func decode(_ env: String, version: Int) throws -> BottleSettings {+ let json = #"{"formatVersion":\#(version),"name":"g","engineID":"e","environment":\#(env)}"#+ return try JSONDecoder().decode(BottleSettings.self, from: Data(json.utf8))+ }+ let stale = try decode(#"{"WINEMSYNC":"0","WINEESYNC":"0","MVK_SHADOW_IMPORT":"1"}"#, version: 2)+ XCTAssertEqual(stale.environment, ["MVK_SHADOW_IMPORT": "1"])+ XCTAssertEqual(stale.formatVersion, 3)+ XCTAssertTrue(stale.needsSave)+ let deliberate = try decode(#"{"WINEMSYNC":"1","WINEESYNC":"0"}"#, version: 2)+ XCTAssertEqual(deliberate.environment, ["WINEMSYNC": "1", "WINEESYNC": "0"], "not the stale pair: untouched")+ let single = try decode(#"{"WINEMSYNC":"0"}"#, version: 2)+ XCTAssertEqual(single.environment, ["WINEMSYNC": "0"])+ let current = try decode(#"{"WINEMSYNC":"0","WINEESYNC":"0"}"#, version: 3)+ XCTAssertEqual(current.environment.count, 2, "already format 3: the user's own lines stay")+ XCTAssertFalse(current.needsSave)+ }+func testDefaultEnginePrefersBundledManifestID() throws {func engine(_ id: String) throws -> InstalledEngine {let json = #"{"id":"\#(id)","displayName":"e","arch":"x86_64","minMacOS":"14.0","components":{}}"#