Skip to content

Commit

Permalink
Merge branch '148-add-devcontainer' of github.com:datasig-ac-uk/Rough…
Browse files Browse the repository at this point in the history
…Py into 148-add-devcontainer
  • Loading branch information
alexallmont committed Nov 20, 2024
2 parents 7bddece + 9c925b5 commit 89b1124
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ The `.devcontainer/` folder provides a consistent build and debug environment th

## Opening devcontainer locally

When you open the cloned RoughPy folder in VSCode, accept the popup to open in a Dev Container or run the editor command `Dev Containers: Reopen in Dev Container`.
When you open the cloned RoughPy folder in VSCode, it will detect the `.devcontainer/` folder. Accept the popup to open in a Dev Container or run the editor command `Dev Containers: Reopen in Dev Container`. If the container image needs to be rebuilt, it will take a few extra minutes.

VSCode will restart inside a container that will have mapped your checkout folder to `/workspaces/<dirname>`, so be mindful that editing files is affecting this folder on your machine.
VSCode will restart inside a container that mounts your checkout folder to `/workspaces/<dirname>`. Be mindful that editing files is affecting this folder on your machine.

The devcontainer `Dockerfile` sets up a root `/tools` folder that contains a `venv` with build dependencies pre-installed, and a clone of `vcpkg`; both of which are added to `$PATH`.

On the first run, the project will need to be configured in CMake and additional build dependencies will be fetched by vcpkg. You must wait for this to finish before you can build and run any tests. Progress can be tracked under 'CMake/Build' in the VSCode 'Output' panel.


## Building, testing and debugging

Run the editor command `CMake: Select Configure Preset` and select `Debug Develop` to compile with debug symbols. Then run `CMake: build`.
Expand Down
4 changes: 1 addition & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
"cmake.cmakePath": "/tools/venv/bin/cmake",
"cmake.configureArgs": [
"-DCMAKE_MAKE_PROGRAM=/tools/venv/bin/ninja",
"-DCMAKE_TOOLCHAIN_FILE=/tools/vcpkg/scripts/buildsystems/vcpkg.cmake",
"-DROUGHPY_BUILD_TESTS=ON",
"-DROUGHPY_BUILD_PYLIB_INPLACE=ON"
"-DCMAKE_TOOLCHAIN_FILE=/tools/vcpkg/scripts/buildsystems/vcpkg.cmake"
]
}
}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Unreleased
- Added VSCode `.devcontainer` settings for containerised developer environment for debugging tests. See `.devcontainer/README.md` for instructions (@alexallmont #148)

Version 0.1.2
- Documentation is now in sync with the main branch (@philipparubin PR #85)
- Fixed a fault when constructing with larger than expected array (Issue #70, @inakleinbottle PR #72)
Expand Down

0 comments on commit 89b1124

Please sign in to comment.