Use container-builder-shim 0.7.0, ensures use of Rosetta. (#858)

- Addresses slow cross-platform builds from #68.
- The shim wasn't doing everything needed to ensure the use of Rosetta for
  `container build`. The new shim adds an `--enable-qemu` option that
  controls whether `buildkit-qemu-emulator-x86_64 is available; when it is
  not available, buildkitd will attempt to build natively, meaning Rosetta
  will execute amd64 binaries.
This commit is contained in:
J Logan
2025-11-06 13:29:55 -08:00
committed by GitHub
parent 56f6d734f3
commit 384e3a12ff
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ import PackageDescription
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
let builderShimVersion = "0.6.3"
let builderShimVersion = "0.7.0"
let scVersion = "0.13.0"
let package = Package(
@@ -140,10 +140,12 @@ extension Application {
}
}
let shimArguments: [String] = [
let useRosetta = DefaultsStore.getBool(key: .buildRosetta) ?? true
let shimArguments = [
"--debug",
"--vsock",
]
useRosetta ? nil : "--enable-qemu",
].compactMap { $0 }
let id = "buildkit"
try ContainerClient.Utility.validEntityName(id)
@@ -202,7 +204,7 @@ extension Application {
),
]
// Enable Rosetta only if the user didn't ask to disable it
config.rosetta = DefaultsStore.getBool(key: .buildRosetta) ?? true
config.rosetta = useRosetta
let network = try await ClientNetwork.get(id: ClientNetwork.defaultNetworkName)
guard case .running(_, let networkStatus) = network else {