Repository navigation
Warn when the conda environment has drifted from the pins - #64
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the dx2 side of fast-feedback-service #169. Since #60 every
package in
environment.ymlis pinned exactly and the Conda updateworkflow moves the pins once a month, so a
git pullcan leave a localenvironment 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::v11symbols andlibfmt.so.12, which say nothing aboutthe environment being out of date.
This PR adds the same configure-time check, which compares the
environment the build uses against
environment.ymland warns withevery package that does not match, along with the command to update it:
conda records every installed package as
conda-meta/<name>-<version>-<build>.json, so the check is a glob perpin 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
cmake/Modules/CheckCondaPins.cmake, ported fromfast-feedback-service. The pin file and the environment's
conda-meta/historyare configure dependencies, so a pull that movesa pin, or an update to the environment, reruns the check on the next
ninjawithout a manual reconfigure.environment.ymlon both platforms, so every pin applies on both andthere is no derived file to suggest.
only runs when dx2 is the top-level project and not when it is pulled
in with
add_subdirectory. A compiler from outside a condaenvironment skips the check entirely.