mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix --arch flag to fall back to emulation when native image unavailab… (#3108)
* fix --arch flag to fall back to emulation when native image unavailable, always infer hardware requirement for arch * better handling of arch filter * dont cancel in-progress commit workflows and abstract common setup * cli improvements fix group handling * fix cli publish * alpha.19 --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -132,7 +132,6 @@ export type SDKManifest = {
|
||||
* `pattern` refers to a regular expression that at least one device of the specified class must match
|
||||
* `patternDescription` is what will be displayed to the user about what kind of device is required
|
||||
* @property {number} ram - Minimum RAM requirement (in megabytes MB)
|
||||
* @property {string[]} arch - List of supported arches
|
||||
* @example
|
||||
* ```
|
||||
hardwareRequirements: {
|
||||
@@ -141,14 +140,12 @@ export type SDKManifest = {
|
||||
{ class: 'processor', pattern: 'i[3579]-10[0-9]{3}U CPU', patternDescription: 'A 10th Generation Intel i-Series processor' },
|
||||
],
|
||||
ram: 8192,
|
||||
arch: ['x86-64'],
|
||||
},
|
||||
* ```
|
||||
*/
|
||||
readonly hardwareRequirements?: {
|
||||
readonly device?: T.DeviceFilter[]
|
||||
readonly ram?: number | null
|
||||
readonly arch?: string[] | null
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,7 +67,7 @@ import {
|
||||
import { getOwnServiceInterfaces } from "../../base/lib/util/getServiceInterfaces"
|
||||
import { Volumes, createVolumes } from "./util/Volume"
|
||||
|
||||
export const OSVersion = testTypeVersion("0.4.0-alpha.18")
|
||||
export const OSVersion = testTypeVersion("0.4.0-alpha.19")
|
||||
|
||||
// prettier-ignore
|
||||
type AnyNeverCond<T extends any[], Then, Else> =
|
||||
|
||||
@@ -42,11 +42,11 @@ export function buildManifest<
|
||||
): Manifest & T.Manifest {
|
||||
const images = Object.entries(manifest.images).reduce(
|
||||
(images, [k, v]) => {
|
||||
v.arch = v.arch || ["aarch64", "x86_64"]
|
||||
v.arch = v.arch ?? ["aarch64", "x86_64", "riscv64"]
|
||||
if (v.emulateMissingAs === undefined)
|
||||
v.emulateMissingAs = (v.arch as string[]).includes("aarch64")
|
||||
? "aarch64"
|
||||
: v.arch[0] || null
|
||||
v.emulateMissingAs = (v.arch as string[]).includes("x86_64")
|
||||
? "x86_64"
|
||||
: (v.arch[0] ?? null)
|
||||
v.nvidiaContainer = !!v.nvidiaContainer
|
||||
images[k] = v as ImageConfig
|
||||
return images
|
||||
@@ -75,21 +75,18 @@ export function buildManifest<
|
||||
hardwareRequirements: {
|
||||
device: manifest.hardwareRequirements?.device || [],
|
||||
ram: manifest.hardwareRequirements?.ram || null,
|
||||
arch:
|
||||
manifest.hardwareRequirements?.arch === undefined
|
||||
? Object.values(images).reduce(
|
||||
(arch, inputSpec) => {
|
||||
if (inputSpec.emulateMissingAs) {
|
||||
return arch
|
||||
}
|
||||
if (arch === null) {
|
||||
return inputSpec.arch
|
||||
}
|
||||
return arch.filter((a) => inputSpec.arch.includes(a))
|
||||
},
|
||||
null as string[] | null,
|
||||
)
|
||||
: manifest.hardwareRequirements?.arch,
|
||||
arch: Object.values(images).reduce(
|
||||
(arch, inputSpec) => {
|
||||
if (inputSpec.emulateMissingAs) {
|
||||
return arch
|
||||
}
|
||||
if (arch === null) {
|
||||
return inputSpec.arch
|
||||
}
|
||||
return arch.filter((a) => inputSpec.arch.includes(a))
|
||||
},
|
||||
null as string[] | null,
|
||||
),
|
||||
},
|
||||
hardwareAcceleration: manifest.hardwareAcceleration ?? false,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user