Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions data/0.18.0/versionBundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,35 @@
"cmake": "v3.29.9",
"picotool": "2.1.0",
"toolchain": "13_3_Rel1",
"riscvToolchain": "RISCV_RPI_2_0_0_5"
"riscvToolchain": "RISCV_RPI_2_0_0_5",
"modifiers": {
"darwin_x64": {
"toolchain": "13_2_Rel1"
}
}
},
"2.1.1": {
"ninja": "v1.12.1",
"cmake": "v3.31.5",
"picotool": "2.1.1",
"toolchain": "14_2_Rel1",
"riscvToolchain": "RISCV_RPI_2_0_0_5"
"riscvToolchain": "RISCV_RPI_2_0_0_5",
"modifiers": {
"darwin_x64": {
"toolchain": "13_2_Rel1"
}
}
},
"2.2.0": {
"ninja": "v1.12.1",
"cmake": "v3.31.5",
"picotool": "2.2.0-a4",
"toolchain": "14_2_Rel1",
"riscvToolchain": "RISCV_ZCB_RPI_2_1_1_3"
"riscvToolchain": "RISCV_ZCB_RPI_2_1_1_3",
"modifiers": {
"darwin_x64": {
"toolchain": "13_2_Rel1"
}
}
}
}
46 changes: 25 additions & 21 deletions src/utils/versionBundles.mts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,12 @@ const versionBundlesUrl =
`${CURRENT_DATA_VERSION}/versionBundles.json`;

export interface VersionBundle {
python: {
version: string;
macos: string;
windowsAmd64: string;
};
ninja: string;
cmake: string;
picotool: string;
toolchain: string;
riscvToolchain: string;
modifiers: { [triple: string] : {[tool: string]: string}};
}

export interface VersionBundles {
Expand Down Expand Up @@ -103,24 +99,32 @@ export default class VersionBundlesLoader {
await this.loadBundles();
}

return (this.bundles ?? {})[version];
}
const chosenBundle = (this.bundles ?? {})[version];

public async getPythonWindowsAmd64Url(
pythonVersion: string
): Promise<VersionBundle | undefined> {
if (this.bundles === undefined) {
await this.loadBundles();
}
if (this.bundles === undefined) {
return undefined;
}
if (chosenBundle !== undefined) {
const modifiers = chosenBundle?.modifiers;
if (modifiers !== undefined) {
const platformDouble = `${process.platform}_${process.arch}`;
if (modifiers[platformDouble] !== undefined) {
chosenBundle.cmake =
modifiers[platformDouble]["cmake"] ?? chosenBundle.cmake

chosenBundle.ninja =
modifiers[platformDouble]["ninja"] ?? chosenBundle.ninja

chosenBundle.picotool =
modifiers[platformDouble]["picotool"] ?? chosenBundle.picotool

const bundle = Object.values(this.bundles).find(
bundle => bundle.python.version === pythonVersion
);
chosenBundle.toolchain =
modifiers[platformDouble]["toolchain"] ?? chosenBundle.toolchain

chosenBundle.riscvToolchain =
modifiers[platformDouble]["riscvToolchain"] ??
chosenBundle.riscvToolchain
}
}
}

//return bundle?.python.windowsAmd64;
return bundle;
return chosenBundle;
}
}
Loading