Skip to content

Warn when the conda environment has drifted from the pins - #64

Merged
dimitrivlachos merged 1 commit into
mainfrom
conda-pin-check
Nov 13, 2026
Merged

dimitrivlachos merged 1 commit into
mainfrom
conda-pin-check

Conversation

@dimitrivlachos

Copy link
Copy Markdown
Collaborator

This is the dx2 side of fast-feedback-service #169. Since #60 every
package in environment.yml is pinned exactly and the Conda update
workflow moves the pins once a month, so a git pull can leave a local
environment behind without anyone noticing. The build then fails in
ways that do not name the cause; on fast-feedback-service an
environment still on fmt 11.2 against the 12.1 pin gave link errors
between fmt::v11 symbols and libfmt.so.12, which say nothing about
the environment being out of date.

This PR adds the same configure-time check, which compares the
environment the build uses against environment.yml and warns with
every package that does not match, along with the command to update it:

CMake Warning at cmake/Modules/CheckCondaPins.cmake:69 (message):
  The conda environment at .../ENV does not match the pins in
  environment.yml:

    fmt 12.2.0, pinned 11.2.0

  Update it with:

    mamba env update -p .../ENV -f .../environment.yml

conda records every installed package as
conda-meta/<name>-<version>-<build>.json, so the check is a glob per
pin in plain CMake, with no Python and no conda call. The environment
is the one holding the C++ compiler, since that is where the headers
come from. It is only a warning, so building against a different
environment on purpose still works.

Changes

  • Added cmake/Modules/CheckCondaPins.cmake, ported from
    fast-feedback-service. The pin file and the environment's
    conda-meta/history are configure dependencies, so a pull that moves
    a pin, or an update to the environment, reruns the check on the next
    ninja without a manual reconfigure.
  • Dropped the macOS handling the original carries. dx2 solves the one
    environment.yml on both platforms, so every pin applies on both and
    there is no derived file to suggest.
  • Included it alongside the other build-configuration modules, so it
    only runs when dx2 is the top-level project and not when it is pulled
    in with add_subdirectory. A compiler from outside a conda
    environment skips the check entirely.

@dimitrivlachos
dimitrivlachos enabled auto-merge (squash) November 13, 2026 17:15
@dimitrivlachos
dimitrivlachos merged commit 4ed2a25 into main Nov 13, 2026
5 checks passed
@dimitrivlachos
dimitrivlachos deleted the conda-pin-check branch November 13, 2026 17:21
@dimitrivlachos dimitrivlachos self-assigned this Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant