From c7034c1f699de5cc76646192ff4069410077c89b Mon Sep 17 00:00:00 2001 From: leftibot Date: Sat, 2 May 2026 11:34:50 -0600 Subject: [PATCH 1/2] Fix #117: remove unused Conan install from dev container Conan was installed in `.devcontainer/Dockerfile` but never used; the project manages its dependencies via CPM (see Dependencies.cmake), so the `pip install conan` step and the `CONAN_SYSREQUIRES_*` environment variables were dead weight on every dev container build. Drop them, and add a CTest regression test that scans the Dockerfile to prevent Conan from being reintroduced. Co-Authored-By: Claude Opus 4.7 (1M context) --- .devcontainer/Dockerfile | 14 -------------- test/CMakeLists.txt | 6 ++++++ test/check_no_conan_in_devcontainer.cmake | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 test/check_no_conan_in_devcontainer.cmake diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e948180e..8aa7735a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -13,20 +13,6 @@ RUN apt-get update -qq && export DEBIAN_FRONTEND=noninteractive && \ make ninja-build git \ python3 python3-pip -# Install conan -RUN python3 -m pip install --upgrade pip setuptools && \ - python3 -m pip install conan && \ - conan --version - -# By default, anything you run in Docker is done as superuser. -# Conan runs some install commands as superuser, and will prepend `sudo` to -# these commands, unless `CONAN_SYSREQUIRES_SUDO=0` is in your env variables. -ENV CONAN_SYSREQUIRES_SUDO 0 -# Some packages request that Conan use the system package manager to install -# a few dependencies. This flag allows Conan to proceed with these installations; -# leaving this flag undefined can cause some installation failures. -ENV CONAN_SYSREQUIRES_MODE enabled - # User-settable versions: # This Dockerfile should support gcc-[7, 8, 9, 10, 11] and clang-[10, 11, 12, 13] # Earlier versions of clang will require significant modifications to the IWYU section diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8679286f..43e40c8f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,6 +24,12 @@ include(${Catch2_SOURCE_DIR}/extras/Catch.cmake) # Provide a simple smoke test to make sure that the CLI works and can display a --help message add_test(NAME cli.has_help COMMAND intro --help) +# Regression test for issue #117: ensure the dev container Dockerfile no longer +# installs Conan (the project's dependencies are managed by CPM). +add_test( + NAME devcontainer.no_conan + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/test/check_no_conan_in_devcontainer.cmake) + # Provide a test to verify that the version being reported from the application # matches the version given to CMake. This will be important once you package # your program. Real world shows that this is the kind of simple mistake that is easy diff --git a/test/check_no_conan_in_devcontainer.cmake b/test/check_no_conan_in_devcontainer.cmake new file mode 100644 index 00000000..e60f5a96 --- /dev/null +++ b/test/check_no_conan_in_devcontainer.cmake @@ -0,0 +1,19 @@ +# Regression test for issue #117: Conan was installed in the dev container but +# never used; the project manages dependencies via CPM. This script asserts that +# the dev container Dockerfile does not reference Conan. + +set(DOCKERFILE "${CMAKE_CURRENT_LIST_DIR}/../.devcontainer/Dockerfile") + +if(NOT EXISTS "${DOCKERFILE}") + message(FATAL_ERROR "Expected dev container Dockerfile at: ${DOCKERFILE}") +endif() + +file(READ "${DOCKERFILE}" DOCKERFILE_CONTENT) +string(TOLOWER "${DOCKERFILE_CONTENT}" DOCKERFILE_CONTENT_LOWER) + +if(DOCKERFILE_CONTENT_LOWER MATCHES "conan") + message( + FATAL_ERROR + "Issue #117: '.devcontainer/Dockerfile' must not reference Conan; " + "the project uses CPM for dependency management.") +endif() From c13d5053056bb224c6f659b64065cf7377fefacc Mon Sep 17 00:00:00 2001 From: leftibot Date: Sat, 2 May 2026 12:01:45 -0600 Subject: [PATCH 2/2] Address review: remove devcontainer Conan-removal regression test Requested by @lefticus in PR #152 review. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/CMakeLists.txt | 6 ------ test/check_no_conan_in_devcontainer.cmake | 19 ------------------- 2 files changed, 25 deletions(-) delete mode 100644 test/check_no_conan_in_devcontainer.cmake diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 43e40c8f..8679286f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,12 +24,6 @@ include(${Catch2_SOURCE_DIR}/extras/Catch.cmake) # Provide a simple smoke test to make sure that the CLI works and can display a --help message add_test(NAME cli.has_help COMMAND intro --help) -# Regression test for issue #117: ensure the dev container Dockerfile no longer -# installs Conan (the project's dependencies are managed by CPM). -add_test( - NAME devcontainer.no_conan - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/test/check_no_conan_in_devcontainer.cmake) - # Provide a test to verify that the version being reported from the application # matches the version given to CMake. This will be important once you package # your program. Real world shows that this is the kind of simple mistake that is easy diff --git a/test/check_no_conan_in_devcontainer.cmake b/test/check_no_conan_in_devcontainer.cmake deleted file mode 100644 index e60f5a96..00000000 --- a/test/check_no_conan_in_devcontainer.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# Regression test for issue #117: Conan was installed in the dev container but -# never used; the project manages dependencies via CPM. This script asserts that -# the dev container Dockerfile does not reference Conan. - -set(DOCKERFILE "${CMAKE_CURRENT_LIST_DIR}/../.devcontainer/Dockerfile") - -if(NOT EXISTS "${DOCKERFILE}") - message(FATAL_ERROR "Expected dev container Dockerfile at: ${DOCKERFILE}") -endif() - -file(READ "${DOCKERFILE}" DOCKERFILE_CONTENT) -string(TOLOWER "${DOCKERFILE_CONTENT}" DOCKERFILE_CONTENT_LOWER) - -if(DOCKERFILE_CONTENT_LOWER MATCHES "conan") - message( - FATAL_ERROR - "Issue #117: '.devcontainer/Dockerfile' must not reference Conan; " - "the project uses CPM for dependency management.") -endif()