-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
GH-102973: add a dev container #102975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
GH-102973: add a dev container #102975
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b3b399c
Create a dev container
brettcannon b030aa3
Add WASI to the container file
brettcannon 56f990e
Ignore `nis` for WASI
brettcannon 95898c6
Add Zephyr extension
brettcannon 6f47138
Add VS Code settings
brettcannon f6a543a
Move 4-space tab size to be a general setting
brettcannon 86bdfbb
Add git to the `Dockerfile`
brettcannon 5b646f4
Add the Live Preview extension
brettcannon a4b113d
Merge branch 'dev-container' of https://github.com/brettcannon/cpytho…
brettcannon 5cb4547
Add ports used by the Live Preview extension
brettcannon ad6b72a
Let Live Preview trigger the notification for the ports
brettcannon 97de684
Add autoconf syntax highlighting
brettcannon 5fdd0be
Add the C extension
brettcannon ec514ce
Add settings for the Python extension
brettcannon a7437ae
Tweak a comment
brettcannon 73c9bec
Turn off C error squiggles
brettcannon 473d434
Add comments for why an extension is included
brettcannon a42cc51
Install `which`, `zsh`, and `fish` in the dev container
brettcannon bd54202
Merge branch 'main' into dev-container
brettcannon 4d8d082
Add a news entry
brettcannon ab50a16
Add blurb to the container
brettcannon 8805339
Fix a comment typo
brettcannon 5884f0d
Merge branch 'main' into dev-container
brettcannon 64bd77d
Don't build docs and have `dnf` clean up after itself
brettcannon cc8ac24
Drop `pipx` for `python3-blurb`
brettcannon a7d6545
Merge branch 'main' into dev-container
brettcannon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM docker.io/library/fedora:37 | ||
|
||
ENV CC=clang | ||
|
||
ENV WASI_SDK_VERSION=19 | ||
ENV WASI_SDK_PATH=/opt/wasi-sdk | ||
|
||
ENV WASMTIME_HOME=/opt/wasmtime | ||
ENV WASMTIME_VERSION=7.0.0 | ||
ENV WASMTIME_CPU_ARCH=x86_64 | ||
|
||
RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \ | ||
dnf -y --nodocs builddep python3 && \ | ||
dnf -y clean all | ||
|
||
RUN mkdir ${WASI_SDK_PATH} && \ | ||
curl --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-linux.tar.gz | \ | ||
tar --strip-components 1 --directory ${WASI_SDK_PATH} --extract --gunzip | ||
|
||
RUN mkdir --parents ${WASMTIME_HOME} && \ | ||
curl --location "https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-${WASMTIME_CPU_ARCH}-linux.tar.xz" | \ | ||
xz --decompress | \ | ||
tar --strip-components 1 --directory ${WASMTIME_HOME} -x && \ | ||
ln -s ${WASMTIME_HOME}/wasmtime /usr/local/bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
"onCreateCommand": [ | ||
// Install common tooling. | ||
"dnf", | ||
"install", | ||
"-y", | ||
"which", | ||
"zsh", | ||
"fish" | ||
], | ||
"updateContentCommand": { | ||
// Using the shell for `nproc` usage. | ||
"python": "./configure --config-cache --with-pydebug && make -s -j `nproc`", | ||
"docs": [ | ||
"make", | ||
"--directory", | ||
"Doc", | ||
"venv", | ||
"html" | ||
] | ||
}, | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
// Highlighting for Parser/Python.asdl. | ||
"brettcannon.zephyr-asdl", | ||
// Highlighting for configure.ac. | ||
"maelvalais.autoconf", | ||
// C auto-complete. | ||
"ms-vscode.cpptools", | ||
// To view built docs. | ||
"ms-vscode.live-server" | ||
// https://github.com/microsoft/vscode-python/issues/18073 | ||
// "ms-python.python" | ||
], | ||
"settings": { | ||
"C_Cpp.default.cStandard": "c11", | ||
"C_Cpp.default.defines": [ | ||
"Py_BUILD_CORE" | ||
], | ||
// 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" | ||
], | ||
"python.defaultInterpreterPath": "./python", | ||
"[restructuredtext]": { | ||
"editor.tabSize": 3 | ||
} | ||
} | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Build/2023-03-23-20-58-56.gh-issue-102973.EaJUrw.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Add a dev container (along with accompanying Dockerfile) for development | ||
purposes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize I am late to the party, but you might save space by installing git-core instead of git, which should avoid Perl (unless something else brings it in).
(
dnf builddep python3
will bring in git-core as well, because we use git to apply patches, but that is probably not explicit enough.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invoking dnf with
--setopt=install_weak_deps=False
will also save space. Let me try sending a PR and see if it works.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#103283