Small dev container refactor#489
Conversation
|
@microsoft-github-policy-service agree company="Microsoft" |
There was a problem hiding this comment.
Pull request overview
This PR refactors the VS Code devcontainer setup to reduce per-container startup work by moving “static” environment provisioning into the image build, and to support a two-step development workflow (build/install C++ first, then build/install the Python package against it). This aligns with the devcontainer improvements requested in issue #485.
Changes:
- Replace the per-create
venv.shbootstrap with a Dockerfile-built Python venv plus dev dependencies, and a newpost_create.shthat builds/installs C++ then installs the Python package. - Add Dev Container Features for Node.js and Rust (replacing nvm/rustup logic previously in
venv.sh). - Commit
devcontainer-lock.jsonto pin feature versions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| INSTALL.md | Adds a “Develop” step describing the new two-phase C++ + Python devcontainer workflow. |
| .devcontainer/scripts/venv.sh | Removes the old per-create script that created the venv and installed tools/deps. |
| .devcontainer/scripts/post_create.sh | New post-create script to build/install C++ and then install the Python package. |
| .devcontainer/Dockerfile | Creates a venv during image build and pre-installs dev dependencies. |
| .devcontainer/devcontainer.json | Switches postCreateCommand to the new script; adds Node/Rust features. |
| .devcontainer/devcontainer-lock.json | Pins devcontainer feature versions/digests for reproducibility. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
| # Build C++ and install to /usr/local | ||
| cmake -S cpp -B cpp/build -G Ninja | ||
| cmake --build cpp/build | ||
| sudo cmake --install cpp/build |
There was a problem hiding this comment.
Just noticed this - this will install to a global location. This will preclude local builds of the code
There was a problem hiding this comment.
thanks for the note. switched to a non-sudo install.
|
@wavefunction91 sorry for the delay, testing the full build took a while. Apart from the non-sudo c++ qdk-chemistry install, few other small changes: I added the I also set
|
fixes #485
1st commit addresses point 1 (moving static installs to the image build).
For point 2, I set up the separate C++ and python installation that seems to work well for me. But I do understand that different users might want to set up their environment in different ways, so I could also revert this change (and use the single
pip installcommand).devcontainer-lock.jsonalso seems to be committed conventionally, added that as well.