Skip to content

Commit

Permalink
Implemented machine scoped python handling
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 23, 2024
1 parent f2fa8eb commit 90548a9
Show file tree
Hide file tree
Showing 16 changed files with 2,500 additions and 357 deletions.
1,318 changes: 1,318 additions & 0 deletions data/0.17.0/examples.json

Large diffs are not rendered by default.

699 changes: 699 additions & 0 deletions data/0.17.0/github-cache.json

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions data/0.17.0/supportedToolchains.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[13_3_Rel1]
win32_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi.zip
darwin_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-darwin-arm64-arm-none-eabi.tar.xz
darwin_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-darwin-x86_64-arm-none-eabi.tar.xz
linux_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
linux_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-aarch64-arm-none-eabi.tar.xz
[13_2_Rel1]
win32_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip
darwin_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-arm64-arm-none-eabi.tar.xz
darwin_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz
linux_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
linux_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-aarch64-arm-none-eabi.tar.xz
[RISCV_RPI_2_0_0_2]
win32_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-2/riscv-toolchain-14-x64-win.zip
darwin_arm64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-2/riscv-toolchain-14-arm64-mac.zip
darwin_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-2/riscv-toolchain-14-x64-mac.zip
linux_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-2/riscv-toolchain-14-x86_64-lin.tar.gz
linux_arm64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-2/riscv-toolchain-14-aarch64-lin.tar.gz
[RISCV_RPI_2_0_0_1]
win32_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-1/riscv-toolchain-14-x64-win.zip
darwin_arm64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-1/riscv-toolchain-14-arm64-mac.zip
darwin_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-1/riscv-toolchain-14-x64-mac.zip
linux_x64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-1/riscv-toolchain-14-x86_64-lin.tar.gz
linux_arm64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-1/riscv-toolchain-14-aarch64-lin.tar.gz
[RISCV_13_3]
win32_x64 = https://buildbot.embecosm.com/job/riscv32-gcc-win64-release/24/artifact/riscv32-embecosm-win64-gcc13.2.0.zip
darwin_arm64 = https://buildbot.embecosm.com/job/riscv32-gcc-macos-arm64-release/10/artifact/riscv32-embecosm-macos-gcc13.3.0.zip
darwin_x64 = https://buildbot.embecosm.com/job/riscv32-gcc-macos-release/21/artifact/riscv32-embecosm-macos-gcc13.3.0.zip
linux_x64 = https://buildbot.embecosm.com/job/riscv32-gcc-ubuntu2204-release/12/artifact/riscv32-embecosm-ubuntu2204-gcc13.3.0.tar.gz
[RISCV_COREV_MAY_24]
win32_x64 = https://buildbot.embecosm.com/job/corev-gcc-win64/50/artifact/corev-openhw-gcc-win64-20240602.zip
darwin_arm64 = https://buildbot.embecosm.com/job/corev-gcc-macos-arm64/8/artifact/corev-openhw-gcc-macos-20240530.zip
darwin_x64 = https://buildbot.embecosm.com/job/corev-gcc-macos/48/artifact/corev-openhw-gcc-macos-20240530.zip
linux_x64 = https://buildbot.embecosm.com/job/corev-gcc-ubuntu2204/47/artifact/corev-openhw-gcc-ubuntu2204-20240530.tar.gz
[RISCV_RPI]
linux_arm64 = https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.0.0-0/riscv-toolchain-14-aarch64-lin.tar.gz
[12_3_Rel1]
win32_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-mingw-w64-i686-arm-none-eabi.zip
darwin_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-darwin-arm64-arm-none-eabi.tar.xz
darwin_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-darwin-x86_64-arm-none-eabi.tar.xz
linux_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz
linux_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-aarch64-arm-none-eabi.tar.xz
[12_2_Rel1]
win32_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-mingw-w64-i686-arm-none-eabi.zip
darwin_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-darwin-arm64-arm-none-eabi.tar.xz
darwin_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-darwin-x86_64-arm-none-eabi.tar.xz
linux_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
linux_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-aarch64-arm-none-eabi.tar.xz
[11_3_Rel1]
win32_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi.zip
darwin_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-darwin-arm64-arm-none-eabi.tar.xz
darwin_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-darwin-x86_64-arm-none-eabi.tar.xz
linux_x64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz
linux_arm64 = https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/11.3.rel1/binrel/arm-gnu-toolchain-11.3.rel1-aarch64-arm-none-eabi.tar.xz
23 changes: 23 additions & 0 deletions data/0.17.0/versionBundles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"1.5.0": {
"ninja": "v1.12.1",
"cmake": "v3.28.6",
"picotool": "2.0.0",
"toolchain": "12_3_Rel1",
"riscvToolchain": "NONE"
},
"1.5.1": {
"ninja": "v1.12.1",
"cmake": "v3.28.6",
"picotool": "2.0.0",
"toolchain": "13_2_Rel1",
"riscvToolchain": "NONE"
},
"2.0.0": {
"ninja": "v1.12.1",
"cmake": "v3.28.6",
"picotool": "2.0.0",
"toolchain": "13_2_Rel1",
"riscvToolchain": "RISCV_RPI_2_0_0_2"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
"raspberry-pi-pico.python3Path": {
"type": "string",
"default": "",
"scope": "machine",
"description": "Path to the Python executable [no spaces]"
},
"raspberry-pi-pico.ninjaPath": {
Expand Down
22 changes: 17 additions & 5 deletions src/extension.mts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import {
downloadAndInstallTools,
downloadAndInstallPicotool,
downloadAndInstallOpenOCD,
downloadEmbedPython,
} from "./utils/download.mjs";
import { SDK_REPOSITORY_URL } from "./utils/githubREST.mjs";
import { getSupportedToolchains } from "./utils/toolchainUtil.mjs";
Expand All @@ -68,15 +67,14 @@ import OpenSdkDocumentationCommand from "./commands/openSdkDocumentation.mjs";
import ConfigureCmakeCommand from "./commands/configureCmake.mjs";
import ImportProjectCommand from "./commands/importProject.mjs";
import { homedir } from "os";
import VersionBundlesLoader from "./utils/versionBundles.mjs";
import { pyenvInstallPython, setupPyenv } from "./utils/pyenvUtil.mjs";
import NewExampleProjectCommand from "./commands/newExampleProject.mjs";
import SwitchBoardCommand from "./commands/switchBoard.mjs";
import UninstallPicoSDKCommand from "./commands/uninstallPicoSDK.mjs";
import FlashProjectSWDCommand from "./commands/flashProjectSwd.mjs";
// eslint-disable-next-line max-len
import { NewMicroPythonProjectPanel } from "./webview/newMicroPythonProjectPanel.mjs";
import type { Got, Progress as GotProgress } from "got";
import type { Progress as GotProgress } from "got";
import findPython, { showPythonNotFoundError } from "./utils/pythonHelper.mjs";

export async function activate(context: ExtensionContext): Promise<void> {
Logger.info(LoggerSource.extension, "Extension activation triggered");
Expand Down Expand Up @@ -633,6 +631,20 @@ export async function activate(context: ExtensionContext): Promise<void> {
}
}

const pythonPath = await findPython();
if (!pythonPath) {
Logger.error(LoggerSource.extension, "Failed to find Python3 executable.");
await commands.executeCommand(
"setContext",
ContextKeys.isPicoProject,
false
);
showPythonNotFoundError();

return;
}

/*
const pythonPath = settings.getString(SettingsKey.python3Path);
if (pythonPath && pythonPath.includes("/.pico-sdk/python")) {
// check if python path exists
Expand Down Expand Up @@ -732,7 +744,7 @@ export async function activate(context: ExtensionContext): Promise<void> {
return;
}
}
}
}*/

ui.showStatusBarItems();
ui.updateSDKVersion(selectedToolchainAndSDKVersions[0]);
Expand Down
1 change: 1 addition & 0 deletions src/logger.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum LoggerSource {
extension = "extension",
cmake = "cmakeUtil",
downloadHelper = "downloadHelper",
pythonHelper = "pythonHelper",
}

/**
Expand Down
Loading

0 comments on commit 90548a9

Please sign in to comment.