From 4cff6517130e79a60ea8e371a439b933c4d817ca Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 26 Mar 2026 11:28:16 +0000 Subject: [PATCH] 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. --- .devcontainer/devcontainer.json | 21 +++++++++++++++++++++ SuperBuild/cmake/External-Ceres.cmake | 2 +- configure.sh | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..7b3a78553 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {} + } + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pip3 install --user -r requirements.txt", + + // Configure tool-specific properties. + // "customizations": {}, + +} diff --git a/SuperBuild/cmake/External-Ceres.cmake b/SuperBuild/cmake/External-Ceres.cmake index 323deef15..6be312278 100644 --- a/SuperBuild/cmake/External-Ceres.cmake +++ b/SuperBuild/cmake/External-Ceres.cmake @@ -11,7 +11,7 @@ ExternalProject_Add(${_proj_name} URL http://ceres-solver.org/ceres-solver-2.0.0.tar.gz #--Update/Patch step---------- UPDATE_COMMAND "" - PATCH_COMMAND git apply ${CMAKE_MODULE_PATH}/ceres.patch + PATCH_COMMAND patch -p1 < ${CMAKE_MODULE_PATH}/ceres.patch #--Configure step------------- SOURCE_DIR ${SB_SOURCE_DIR}/${_proj_name} CMAKE_ARGS diff --git a/configure.sh b/configure.sh index e9b09acbd..69d3bd5f1 100755 --- a/configure.sh +++ b/configure.sh @@ -170,6 +170,10 @@ install() { -DPython_FIND_VIRTUALENV=ONLY \ && make -j$processes + # Reset terminal state + cd ${RUNPATH} + set +eo pipefail + installpython echo "Configuration Finished"