From 78d8377705959dfac65aeef33055b074dc9097f3 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 10:14:14 +0200 Subject: [PATCH 1/8] ci: Add `win-arm64` workflows Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 20 +++++++++++++------- .github/workflows/tests.yml | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 9a872c71cf..cbe65a835f 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -167,14 +167,20 @@ jobs: name: micromamba-${{ matrix.platform }}-${{ matrix.arch }} path: ${{ github.workspace }}/artifacts/micromamba micromamba-static-win: - name: "win-64" - runs-on: windows-latest + name: "win-${{ matrix.arch }}" + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - { os: windows-latest, arch: "64" } + - { os: windows-11-arm, arch: arm64 } steps: - uses: actions/checkout@v7 - uses: hendrikmuhs/ccache-action@main with: variant: sccache - key: sccache-${{ github.job }}-win-64 + key: sccache-${{ github.job }}-win-${{ matrix.arch }} - name: Set up MSVC uses: ilammy/msvc-dev-cmd@v1 - uses: mamba-org/setup-micromamba@v3 @@ -236,7 +242,7 @@ jobs: run: sccache --show-stats - name: Archive-build artifact if: failure() - run: tar -czf ${{ github.workspace }}/micromamba-build-failed-win-64.tar.gz ${{ github.workspace }}/build/ + run: tar -czf ${{ github.workspace }}/micromamba-build-failed-win-${{ matrix.arch }}.tar.gz ${{ github.workspace }}/build/ - name: Test basic commands run: | @@ -250,10 +256,10 @@ jobs: uses: actions/upload-artifact@v7 if: failure() with: - name: micromamba-build-failed-win-64 - path: ${{ github.workspace }}/micromamba-build-failed-win-64.tar.gz + name: micromamba-build-failed-win-${{ matrix.arch }} + path: ${{ github.workspace }}/micromamba-build-failed-win-${{ matrix.arch }}.tar.gz retention-days: 7 - uses: actions/upload-artifact@v7 with: - name: micromamba-win-64 + name: micromamba-win-${{ matrix.arch }} path: ${{ github.workspace }}/build/micromamba/micromamba.exe diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 589a37c2b1..6f4f9c2e41 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,9 +36,9 @@ jobs: name: Windows strategy: matrix: - os: [windows-latest] + os: [windows-latest, windows-11-arm] build_type: [release] - fail-fast: true + fail-fast: false uses: ./.github/workflows/windows_impl.yml with: os: ${{ matrix.os }} From 7bbfddecf445b66c82dbf49b89acc66f2011bc60 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 12:28:33 +0200 Subject: [PATCH 2/8] Use `mamba-org/setup-micromamba@v3.1.0` Signed-off-by: Julien Jerphanion --- .github/workflows/coverage.yml | 2 +- .github/workflows/linters.yml | 2 +- .github/workflows/static_build.yml | 4 ++-- .github/workflows/unix_impl.yml | 10 +++++----- .github/workflows/windows_impl.yml | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 37ba316937..621926e709 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,7 +44,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./dev/environment-dev.yml environment-name: build_env diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ed8676b5ea..4619e2e82f 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -36,7 +36,7 @@ jobs: df -h - uses: actions/checkout@v7 - name: Install pre-commit and identify - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-name: linters create-args: pre-commit identify diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index cbe65a835f..655a260daf 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -97,7 +97,7 @@ jobs: mv mamba/ micromamba-feedstock/source # Prevent irrelevant file permission error git -C micromamba-feedstock/ config --local --add safe.directory '*' - - uses: mamba-org/setup-micromamba@v3 + - uses: mamba-org/setup-micromamba@v3.1.0 with: environment-name: mambabuild create-args: python boa @@ -183,7 +183,7 @@ jobs: key: sccache-${{ github.job }}-win-${{ matrix.arch }} - name: Set up MSVC uses: ilammy/msvc-dev-cmd@v1 - - uses: mamba-org/setup-micromamba@v3 + - uses: mamba-org/setup-micromamba@v3.1.0 with: environment-name: mambabuild init-shell: bash cmd.exe diff --git a/.github/workflows/unix_impl.yml b/.github/workflows/unix_impl.yml index 1f88de78a9..6db6ddb3c1 100644 --- a/.github/workflows/unix_impl.yml +++ b/.github/workflows/unix_impl.yml @@ -47,7 +47,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./dev/environment-dev.yml environment-name: build_env @@ -121,7 +121,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env @@ -181,7 +181,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env @@ -240,7 +240,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env @@ -320,7 +320,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env diff --git a/.github/workflows/windows_impl.yml b/.github/workflows/windows_impl.yml index fc73a8aebb..7e006873c3 100644 --- a/.github/workflows/windows_impl.yml +++ b/.github/workflows/windows_impl.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./dev/environment-dev.yml environment-name: build_env @@ -77,7 +77,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env @@ -116,7 +116,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env @@ -148,7 +148,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3 + uses: mamba-org/setup-micromamba@v3.1.0 with: environment-file: ./build/environment.lock environment-name: build_env From 336f88339fdfd1d3b865f6f70710df7578c5a876 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 14:40:18 +0200 Subject: [PATCH 3/8] Handle many missing top-level packages Signed-off-by: Julien Jerphanion --- libmamba/src/solver/problems_graph.cpp | 97 +++++++++++++++---- .../tests/src/solver/test_problems_graph.cpp | 41 ++++++++ 2 files changed, 117 insertions(+), 21 deletions(-) diff --git a/libmamba/src/solver/problems_graph.cpp b/libmamba/src/solver/problems_graph.cpp index 6a3d6789cc..688dda18e8 100644 --- a/libmamba/src/solver/problems_graph.cpp +++ b/libmamba/src/solver/problems_graph.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -378,6 +377,28 @@ namespace mamba::solver return std::visit([](const auto& n) -> std::string_view { return name_or(n, ""); }, node); } + /** + * The name of a CompressedProblemsGraph::node_t. + */ + auto compressed_node_name(const CompressedProblemsGraph::node_t& node) -> std::string_view + { + return std::visit( + [](const auto& n) -> std::string_view + { + using Node = std::decay_t; + if constexpr (std::is_same_v) + { + return ""; + } + else + { + return n.name(); + } + }, + node + ); + } + /** * The criteria for deciding whether to merge two nodes together. */ @@ -533,7 +554,16 @@ namespace mamba::solver { new_graph.add_edge(new_from, new_to, CompressedProblemsGraph::edge_t()); } - new_graph.edge(new_from, new_to).insert(old_graph.edge(old_from, old_to)); + // NamedList requires a single package name. Different dependency names can + // map to the same (from, to) pair after node merges (e.g. via provides); + // keep the first name and drop incompatible MatchSpecs rather than aborting + // problem reporting. + auto& new_edge = new_graph.edge(new_from, new_to); + const auto& old_edge = old_graph.edge(old_from, old_to); + if (new_edge.empty() || (invoke_name(old_edge) == new_edge.name())) + { + new_edge.insert(old_edge); + } }; old_graph.for_each_edge_id(add_new_edge); } @@ -649,22 +679,17 @@ namespace mamba::solver { if (first < last) { + const auto first_name = std::string(invoke_name(*first)); for (auto it = first; it < last; ++it) { - if (invoke_name(*it) != invoke_name(*first)) + // Keep a single package name per list. Divergent names can appear after + // aggressive graph merges; dropping them preserves explainability. + if (invoke_name(*it) == first_name) { - throw std::invalid_argument( - util::concat( - "iterator contains different names (", - invoke_name(*first), - ", ", - invoke_name(*it) - ) - ); + Base::insert(*it); } } } - Base::insert(first, last); } template @@ -799,12 +824,12 @@ namespace mamba::solver template void CompressedProblemsGraph::NamedList::insert_impl(T_&& e) { + // NamedList is a same-name collection. When explaining complex unsolvable + // environments, incompatible names can show up after node/edge merges; skip + // them instead of aborting the error message with an exception. if ((size() > 0) && (invoke_name(e) != name())) { - throw std::invalid_argument( - "Name of new element (" + invoke_name(e) + ") does not match name of list (" - + name() + ')' - ); + return; } Base::insert(std::forward(e)); } @@ -1115,9 +1140,11 @@ namespace mamba::solver } // All children are the same type of visited or leaves, no grand-children, - // and same status. + // same status, and same package name. // We dynamically delete all children and mark the whole node as such. - auto all_same_split_children = [](TreeNodeIter first, TreeNodeIter last) -> bool + // Name equality is required because NamedList / problem messaging assumes a + // single package name per node; providers of the same dependency can differ. + auto all_same_split_children = [&](TreeNodeIter first, TreeNodeIter last) -> bool { if (last <= first) { @@ -1125,7 +1152,17 @@ namespace mamba::solver } auto same = [&first](const TreeNode& tn) { return (tn.type == first->type) && (tn.status == first->status); }; - return std::all_of(first, last, same); + if (!std::all_of(first, last, same)) + { + return false; + } + const auto first_name = compressed_node_name(m_pbs.graph().node(children_ids.front())); + return std::all_of( + children_ids.begin(), + children_ids.end(), + [&](node_id id) + { return compressed_node_name(m_pbs.graph().node(id)) == first_name; } + ); }; const TreeNodeIter children_end = out; if ((n_children >= 1) && all_same_split_children(children_begin, children_end)) @@ -1624,7 +1661,15 @@ namespace mamba::solver for (auto id : ids) { const auto& node = std::get(m_pbs.graph().node(id)); - out.insert(node.begin(), node.end()); + // NamedList is single-name; when a split groups providers of different names, + // only keep entries that match the first name so messaging can still proceed. + for (const auto& pkg : node) + { + if (out.empty() || (invoke_name(pkg) == out.name())) + { + out.insert(pkg); + } + } } return out; } @@ -1670,8 +1715,18 @@ namespace mamba::solver { for (auto t : to) { + if (!m_pbs.graph().has_edge(f, t)) + { + continue; + } const auto& e = m_pbs.graph().edge(f, t); - out.insert(e.begin(), e.end()); + for (const auto& ms : e) + { + if (out.empty() || (invoke_name(ms) == out.name())) + { + out.insert(ms); + } + } } } return out; diff --git a/libmamba/tests/src/solver/test_problems_graph.cpp b/libmamba/tests/src/solver/test_problems_graph.cpp index 6a933d1716..51a81c0cfa 100644 --- a/libmamba/tests/src/solver/test_problems_graph.cpp +++ b/libmamba/tests/src/solver/test_problems_graph.cpp @@ -272,6 +272,46 @@ namespace return create_pubgrub_hard_(ctx, channel_context, true); } + /** + * Many missing top-level packages plus some with broken transitive deps. + * + * Regression for problem-tree messaging aborting with + * "Name of new element (...) does not match name of list (...)" when explaining + * large unsatisfiable environments (e.g. win-arm64 missing conda-forge coverage). + */ + auto create_many_missing_top_level(Context&, ChannelContext& channel_context) + { + return std::pair( + create_pkgs_database( + channel_context, + std::array{ + mkpkg("mitmproxy", "1.0.0", { "aioquic=1.2.0" }), + mkpkg("sphinx-book-theme", "1.0.0", { "sphinx", "theme-dep-missing" }), + mkpkg("sphinx", "1.0.0", { "requests" }), + mkpkg("sphinx-copybutton", "1.0.0", { "sphinx" }), + mkpkg("requests", "1.0.0", { "urllib3", "brotli-python" }), + mkpkg("pre-commit", "1.0.0", { "python" }), + mkpkg("python", "3.12.0"), + } + ), + Request{ + {}, + { + Request::Install{ "doxygen"_ms }, + Request::Install{ "catch2"_ms }, + Request::Install{ "cmake"_ms }, + Request::Install{ "cxx-compiler"_ms }, + Request::Install{ "menuinst"_ms }, + Request::Install{ "pywin32"_ms }, + Request::Install{ "sphinx-book-theme"_ms }, + Request::Install{ "sphinx-copybutton"_ms }, + Request::Install{ "pre-commit"_ms }, + Request::Install{ "mitmproxy"_ms }, + }, + } + ); + } + /** * Create a conflict due to a pin. */ @@ -641,6 +681,7 @@ TEST_CASE("Create problem graph", "[mamba::solver]") std::pair{ "PubGrub example", &create_pubgrub }, std::pair{ "Harder PubGrub example", &create_pubgrub_hard }, std::pair{ "PubGrub example with missing packages", &create_pubgrub_missing }, + std::pair{ "Many missing top-level packages", &create_many_missing_top_level }, std::pair{ "Pin conflict", &create_pin_conflict }, std::pair{ "PyTorch CPU", &create_pytorch_cpu }, std::pair{ "PyTorch Cuda", &create_pytorch_cuda }, From e551bf613f74b115ede15c91d4ef293541690c39 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 14:44:53 +0200 Subject: [PATCH 4/8] Use MSVC toolchain for `arm64` Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 655a260daf..a5ed591cfa 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -183,6 +183,10 @@ jobs: key: sccache-${{ github.job }}-win-${{ matrix.arch }} - name: Set up MSVC uses: ilammy/msvc-dev-cmd@v1 + with: + # Native ARM64 on windows-11-arm; x64 elsewhere. Default is x64 and + # linking ARM64 conda libs with an x64 linker fails with LNK4272. + arch: ${{ matrix.arch == 'arm64' && 'arm64' || 'x64' }} - uses: mamba-org/setup-micromamba@v3.1.0 with: environment-name: mambabuild From 6da8d2a1bf4d8f70f13e40f435d9fce96b233d78 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 15:00:26 +0200 Subject: [PATCH 5/8] Skip micromamba PE dependencies for win-arm64 Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index a5ed591cfa..93a9e815e2 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -236,10 +236,13 @@ jobs: if %errorlevel% neq 0 exit /b %errorlevel% .\build\micromamba\micromamba.exe --help if %errorlevel% neq 0 exit /b %errorlevel% + # binutils is not yet distributed for win-arm64 on conda-forge. - name: Install mingw objdump + if: matrix.arch != 'arm64' shell: bash -l {0} run: micromamba install -n mambabuild -y -c conda-forge binutils - name: Check micromamba PE dependencies + if: matrix.arch != 'arm64' shell: bash -l {0} run: bash dev/check_micromamba_windows_dlls.sh build/micromamba/micromamba.exe - name: build cache statistics From e41ce6c4a2cae723dda6c353356f65600d3b1970 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 24 Jul 2026 15:04:31 +0200 Subject: [PATCH 6/8] Install python 3.14 in basic test commands Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 93a9e815e2..b34f4bb830 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -256,7 +256,7 @@ jobs: mkdir test_prefix ${{ github.workspace }}/build/micromamba/micromamba.exe --version ${{ github.workspace }}/build/micromamba/micromamba.exe --help - ${{ github.workspace }}/build/micromamba/micromamba.exe env create -y -n testenv -r ./test_prefix "python<3.13" + ${{ github.workspace }}/build/micromamba/micromamba.exe env create -y -n testenv -r ./test_prefix "python=3.14" ${{ github.workspace }}/build/micromamba/micromamba.exe list -n testenv -r ./test_prefix --log-level 1 - name: Upload build artifacts From 4a9dea0275430c4063c5480b108e76c4e85843f3 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Mon, 27 Jul 2026 17:37:18 +0200 Subject: [PATCH 7/8] Only add workflows for static builds for now Signed-off-by: Julien Jerphanion --- .github/workflows/coverage.yml | 2 +- .github/workflows/linters.yml | 2 +- .github/workflows/tests.yml | 4 +- .github/workflows/unix_impl.yml | 10 +- .github/workflows/windows_impl.yml | 8 +- libmamba/src/solver/problems_graph.cpp | 97 ++++--------------- .../tests/src/solver/test_problems_graph.cpp | 41 -------- 7 files changed, 34 insertions(+), 130 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 621926e709..37ba316937 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,7 +44,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./dev/environment-dev.yml environment-name: build_env diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 4619e2e82f..ed8676b5ea 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -36,7 +36,7 @@ jobs: df -h - uses: actions/checkout@v7 - name: Install pre-commit and identify - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-name: linters create-args: pre-commit identify diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f4f9c2e41..589a37c2b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,9 +36,9 @@ jobs: name: Windows strategy: matrix: - os: [windows-latest, windows-11-arm] + os: [windows-latest] build_type: [release] - fail-fast: false + fail-fast: true uses: ./.github/workflows/windows_impl.yml with: os: ${{ matrix.os }} diff --git a/.github/workflows/unix_impl.yml b/.github/workflows/unix_impl.yml index 6db6ddb3c1..1f88de78a9 100644 --- a/.github/workflows/unix_impl.yml +++ b/.github/workflows/unix_impl.yml @@ -47,7 +47,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./dev/environment-dev.yml environment-name: build_env @@ -121,7 +121,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env @@ -181,7 +181,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env @@ -240,7 +240,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env @@ -320,7 +320,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env diff --git a/.github/workflows/windows_impl.yml b/.github/workflows/windows_impl.yml index 7e006873c3..fc73a8aebb 100644 --- a/.github/workflows/windows_impl.yml +++ b/.github/workflows/windows_impl.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout mamba repository uses: actions/checkout@v7 - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./dev/environment-dev.yml environment-name: build_env @@ -77,7 +77,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env @@ -116,7 +116,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env @@ -148,7 +148,7 @@ jobs: path: build/ key_suffix: ${{ inputs.os }}-${{ inputs.build_type }} - name: Create build environment - uses: mamba-org/setup-micromamba@v3.1.0 + uses: mamba-org/setup-micromamba@v3 with: environment-file: ./build/environment.lock environment-name: build_env diff --git a/libmamba/src/solver/problems_graph.cpp b/libmamba/src/solver/problems_graph.cpp index 688dda18e8..6a3d6789cc 100644 --- a/libmamba/src/solver/problems_graph.cpp +++ b/libmamba/src/solver/problems_graph.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -377,28 +378,6 @@ namespace mamba::solver return std::visit([](const auto& n) -> std::string_view { return name_or(n, ""); }, node); } - /** - * The name of a CompressedProblemsGraph::node_t. - */ - auto compressed_node_name(const CompressedProblemsGraph::node_t& node) -> std::string_view - { - return std::visit( - [](const auto& n) -> std::string_view - { - using Node = std::decay_t; - if constexpr (std::is_same_v) - { - return ""; - } - else - { - return n.name(); - } - }, - node - ); - } - /** * The criteria for deciding whether to merge two nodes together. */ @@ -554,16 +533,7 @@ namespace mamba::solver { new_graph.add_edge(new_from, new_to, CompressedProblemsGraph::edge_t()); } - // NamedList requires a single package name. Different dependency names can - // map to the same (from, to) pair after node merges (e.g. via provides); - // keep the first name and drop incompatible MatchSpecs rather than aborting - // problem reporting. - auto& new_edge = new_graph.edge(new_from, new_to); - const auto& old_edge = old_graph.edge(old_from, old_to); - if (new_edge.empty() || (invoke_name(old_edge) == new_edge.name())) - { - new_edge.insert(old_edge); - } + new_graph.edge(new_from, new_to).insert(old_graph.edge(old_from, old_to)); }; old_graph.for_each_edge_id(add_new_edge); } @@ -679,17 +649,22 @@ namespace mamba::solver { if (first < last) { - const auto first_name = std::string(invoke_name(*first)); for (auto it = first; it < last; ++it) { - // Keep a single package name per list. Divergent names can appear after - // aggressive graph merges; dropping them preserves explainability. - if (invoke_name(*it) == first_name) + if (invoke_name(*it) != invoke_name(*first)) { - Base::insert(*it); + throw std::invalid_argument( + util::concat( + "iterator contains different names (", + invoke_name(*first), + ", ", + invoke_name(*it) + ) + ); } } } + Base::insert(first, last); } template @@ -824,12 +799,12 @@ namespace mamba::solver template void CompressedProblemsGraph::NamedList::insert_impl(T_&& e) { - // NamedList is a same-name collection. When explaining complex unsolvable - // environments, incompatible names can show up after node/edge merges; skip - // them instead of aborting the error message with an exception. if ((size() > 0) && (invoke_name(e) != name())) { - return; + throw std::invalid_argument( + "Name of new element (" + invoke_name(e) + ") does not match name of list (" + + name() + ')' + ); } Base::insert(std::forward(e)); } @@ -1140,11 +1115,9 @@ namespace mamba::solver } // All children are the same type of visited or leaves, no grand-children, - // same status, and same package name. + // and same status. // We dynamically delete all children and mark the whole node as such. - // Name equality is required because NamedList / problem messaging assumes a - // single package name per node; providers of the same dependency can differ. - auto all_same_split_children = [&](TreeNodeIter first, TreeNodeIter last) -> bool + auto all_same_split_children = [](TreeNodeIter first, TreeNodeIter last) -> bool { if (last <= first) { @@ -1152,17 +1125,7 @@ namespace mamba::solver } auto same = [&first](const TreeNode& tn) { return (tn.type == first->type) && (tn.status == first->status); }; - if (!std::all_of(first, last, same)) - { - return false; - } - const auto first_name = compressed_node_name(m_pbs.graph().node(children_ids.front())); - return std::all_of( - children_ids.begin(), - children_ids.end(), - [&](node_id id) - { return compressed_node_name(m_pbs.graph().node(id)) == first_name; } - ); + return std::all_of(first, last, same); }; const TreeNodeIter children_end = out; if ((n_children >= 1) && all_same_split_children(children_begin, children_end)) @@ -1661,15 +1624,7 @@ namespace mamba::solver for (auto id : ids) { const auto& node = std::get(m_pbs.graph().node(id)); - // NamedList is single-name; when a split groups providers of different names, - // only keep entries that match the first name so messaging can still proceed. - for (const auto& pkg : node) - { - if (out.empty() || (invoke_name(pkg) == out.name())) - { - out.insert(pkg); - } - } + out.insert(node.begin(), node.end()); } return out; } @@ -1715,18 +1670,8 @@ namespace mamba::solver { for (auto t : to) { - if (!m_pbs.graph().has_edge(f, t)) - { - continue; - } const auto& e = m_pbs.graph().edge(f, t); - for (const auto& ms : e) - { - if (out.empty() || (invoke_name(ms) == out.name())) - { - out.insert(ms); - } - } + out.insert(e.begin(), e.end()); } } return out; diff --git a/libmamba/tests/src/solver/test_problems_graph.cpp b/libmamba/tests/src/solver/test_problems_graph.cpp index 51a81c0cfa..6a933d1716 100644 --- a/libmamba/tests/src/solver/test_problems_graph.cpp +++ b/libmamba/tests/src/solver/test_problems_graph.cpp @@ -272,46 +272,6 @@ namespace return create_pubgrub_hard_(ctx, channel_context, true); } - /** - * Many missing top-level packages plus some with broken transitive deps. - * - * Regression for problem-tree messaging aborting with - * "Name of new element (...) does not match name of list (...)" when explaining - * large unsatisfiable environments (e.g. win-arm64 missing conda-forge coverage). - */ - auto create_many_missing_top_level(Context&, ChannelContext& channel_context) - { - return std::pair( - create_pkgs_database( - channel_context, - std::array{ - mkpkg("mitmproxy", "1.0.0", { "aioquic=1.2.0" }), - mkpkg("sphinx-book-theme", "1.0.0", { "sphinx", "theme-dep-missing" }), - mkpkg("sphinx", "1.0.0", { "requests" }), - mkpkg("sphinx-copybutton", "1.0.0", { "sphinx" }), - mkpkg("requests", "1.0.0", { "urllib3", "brotli-python" }), - mkpkg("pre-commit", "1.0.0", { "python" }), - mkpkg("python", "3.12.0"), - } - ), - Request{ - {}, - { - Request::Install{ "doxygen"_ms }, - Request::Install{ "catch2"_ms }, - Request::Install{ "cmake"_ms }, - Request::Install{ "cxx-compiler"_ms }, - Request::Install{ "menuinst"_ms }, - Request::Install{ "pywin32"_ms }, - Request::Install{ "sphinx-book-theme"_ms }, - Request::Install{ "sphinx-copybutton"_ms }, - Request::Install{ "pre-commit"_ms }, - Request::Install{ "mitmproxy"_ms }, - }, - } - ); - } - /** * Create a conflict due to a pin. */ @@ -681,7 +641,6 @@ TEST_CASE("Create problem graph", "[mamba::solver]") std::pair{ "PubGrub example", &create_pubgrub }, std::pair{ "Harder PubGrub example", &create_pubgrub_hard }, std::pair{ "PubGrub example with missing packages", &create_pubgrub_missing }, - std::pair{ "Many missing top-level packages", &create_many_missing_top_level }, std::pair{ "Pin conflict", &create_pin_conflict }, std::pair{ "PyTorch CPU", &create_pytorch_cpu }, std::pair{ "PyTorch Cuda", &create_pytorch_cuda }, From 95cdc634982e9cef83339860c48c4448e73ed664 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Tue, 28 Jul 2026 17:22:07 +0200 Subject: [PATCH 8/8] Use `mamba-org/setup-micromamba@v3` --- .github/workflows/static_build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index b34f4bb830..b15f71796e 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -97,7 +97,7 @@ jobs: mv mamba/ micromamba-feedstock/source # Prevent irrelevant file permission error git -C micromamba-feedstock/ config --local --add safe.directory '*' - - uses: mamba-org/setup-micromamba@v3.1.0 + - uses: mamba-org/setup-micromamba@v3 with: environment-name: mambabuild create-args: python boa @@ -187,7 +187,7 @@ jobs: # Native ARM64 on windows-11-arm; x64 elsewhere. Default is x64 and # linking ARM64 conda libs with an x64 linker fails with LNK4272. arch: ${{ matrix.arch == 'arm64' && 'arm64' || 'x64' }} - - uses: mamba-org/setup-micromamba@v3.1.0 + - uses: mamba-org/setup-micromamba@v3 with: environment-name: mambabuild init-shell: bash cmd.exe