From 10552702ad16eb265ea12c51b3b0f0eb0add2995 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 22 Oct 2025 10:23:13 -0700 Subject: [PATCH 1/3] Create a WASI-specific dev container configuration --- .devcontainer/WASI/devcontainer.json | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .devcontainer/WASI/devcontainer.json diff --git a/.devcontainer/WASI/devcontainer.json b/.devcontainer/WASI/devcontainer.json new file mode 100644 index 00000000000000..f52bcc361a46f5 --- /dev/null +++ b/.devcontainer/WASI/devcontainer.json @@ -0,0 +1,73 @@ +{ + "image": "ghcr.io/python/wasicontainer:latest", + "onCreateCommand": [ + // Install common tooling. + "dnf", + "install", + "-y", + // For umask fix below. + "/usr/bin/setfacl" + ], + "updateContentCommand": { + // Using the shell for `nproc` usage. + "python": "python3 Tools/wasm/wasi build -- --with-pydebug -C" + }, + "postCreateCommand": { + // https://github.com/orgs/community/discussions/26026 + "umask fix: workspace": ["sudo", "setfacl", "-bnR", "."], + "umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"] + }, + "customizations": { + "vscode": { + "extensions": [ + // Highlighting for Parser/Python.asdl. + "brettcannon.zephyr-asdl", + // Highlighting for configure.ac. + "maelvalais.autoconf", + // C auto-complete. + "ms-vscode.cpptools", + // Python auto-complete. + "ms-python.python" + ], + "settings": { + "C_Cpp.default.compilerPath": "/usr/bin/clang", + "C_Cpp.default.cStandard": "c11", + "C_Cpp.default.defines": [ + "CONFIG_64", + "Py_BUILD_CORE" + ], + "C_Cpp.default.includePath": [ + "${workspaceFolder}/*", + "${workspaceFolder}/Include/**" + ], + // https://github.com/microsoft/vscode-cpptools/issues/10732 + "C_Cpp.errorSquiggles": "disabled", + "editor.insertSpaces": true, + "editor.rulers": [ + 80 + ], + "editor.tabSize": 4, + "editor.trimAutoWhitespace": true, + "files.associations": { + "*.h": "c" + }, + "files.encoding": "utf8", + "files.eol": "\n", + "files.insertFinalNewline": true, + "files.trimTrailingWhitespace": true, + "python.analysis.diagnosticSeverityOverrides": { + // Complains about shadowing the stdlib w/ the stdlib. + "reportShadowedImports": "none", + // Doesn't like _frozen_importlib. + "reportMissingImports": "none" + }, + "python.analysis.extraPaths": [ + "Lib" + ], + "[restructuredtext]": { + "editor.tabSize": 3 + } + } + } + } +} From 0e7fce12b036a828634c16b7ac2baabff762623d Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 22 Oct 2025 10:27:27 -0700 Subject: [PATCH 2/3] Rename the directory --- .devcontainer/{WASI => wasi}/devcontainer.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .devcontainer/{WASI => wasi}/devcontainer.json (100%) diff --git a/.devcontainer/WASI/devcontainer.json b/.devcontainer/wasi/devcontainer.json similarity index 100% rename from .devcontainer/WASI/devcontainer.json rename to .devcontainer/wasi/devcontainer.json From 9df826def51c675817fb82ac2c8706a5c76dc3ce Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 22 Oct 2025 10:41:20 -0700 Subject: [PATCH 3/3] Use `--quiet` as the output in the terminal isn't presented nicely --- .devcontainer/wasi/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/wasi/devcontainer.json b/.devcontainer/wasi/devcontainer.json index f52bcc361a46f5..4266144ce47639 100644 --- a/.devcontainer/wasi/devcontainer.json +++ b/.devcontainer/wasi/devcontainer.json @@ -10,7 +10,7 @@ ], "updateContentCommand": { // Using the shell for `nproc` usage. - "python": "python3 Tools/wasm/wasi build -- --with-pydebug -C" + "python": "python3 Tools/wasm/wasi build --quiet -- --with-pydebug -C" }, "postCreateCommand": { // https://github.com/orgs/community/discussions/26026