Skip to content

Commit 4cff651

Browse files
committed
Minimum dev container setup
This includes two fixes to allow the configure.sh script to work. - Use `patch` instead of `git apply` to apply the Ceres patch as this proved more consistently reliable. - Reset the terminal state before the `installpython` step as it assumes the working directory is `/code` which isn't true outside of the docker build. The devcontainer is deliberately kept minimal and can be extended as needed. So far this reliably can build ODM but I haven't attempted to run it yet.
1 parent 5f05b98 commit 4cff651

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04",
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
"features": {
9+
"ghcr.io/devcontainers/features/common-utils:2": {}
10+
}
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Use 'postCreateCommand' to run commands after the container is created.
16+
// "postCreateCommand": "pip3 install --user -r requirements.txt",
17+
18+
// Configure tool-specific properties.
19+
// "customizations": {},
20+
21+
}

SuperBuild/cmake/External-Ceres.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ExternalProject_Add(${_proj_name}
1111
URL http://ceres-solver.org/ceres-solver-2.0.0.tar.gz
1212
#--Update/Patch step----------
1313
UPDATE_COMMAND ""
14-
PATCH_COMMAND git apply ${CMAKE_MODULE_PATH}/ceres.patch
14+
PATCH_COMMAND patch -p1 < ${CMAKE_MODULE_PATH}/ceres.patch
1515
#--Configure step-------------
1616
SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name}
1717
CMAKE_ARGS

configure.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ install() {
170170
-DPython_FIND_VIRTUALENV=ONLY \
171171
&& make -j$processes
172172

173+
# Reset terminal state
174+
cd ${RUNPATH}
175+
set +eo pipefail
176+
173177
installpython
174178

175179
echo "Configuration Finished"

0 commit comments

Comments
 (0)