-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a new channel results in too many package updates #242
Conversation
This PR only adds a test that reproduces the behavior reported in the issue. For debugging purposes, one can also do this:
These are the logs for the 2nd step with libmamba 1.4.1 and 1.4.9:
I'll take a look and see if I can find the cause in the logs, and hopefully provide a fix. cc @costrouc, in case you have some time, could you also look into this? |
Debugging this issue with the example you provided @jaimergp. conda install -n test --override-channels -c conda-forge -c defaults libzlib --solver=libmamba --dry-run When I look at the tasks passed to libmamba ('USERINSTALLED', 2560) ['pkgs/main/linux-64::python==3.11.4=h955ad1f_0', 'pkgs/main/linux-64::conda==23.5.2=py311h06a4308_0', 'pkgs/main/linux-64::ca-certificates==2023.05.30=h06a4308_0', 'pkgs/main/linux-64::certifi==2023.5.7=py311h06a4308_0', 'pkgs/main/linux-64::openssl==3.0.9=h7f8727e_0']
('UPDATE | ESSENTIAL', 131840) ['pkgs/main/linux-64::python==3.11.4=h955ad1f_0', 'pkgs/main/linux-64::conda==23.5.2=py311h06a4308_0', 'ca-certificates', 'certifi', 'openssl']
('UPDATE', 768) ['pkgs/main/linux-64::zstandard==0.19.0=py311h5eee18b_0', 'pkgs/main/linux-64::zlib==1.2.13=h5eee18b_0', 'pkgs/main/linux-64::_openmp_mutex==5.1=1_gnu', 'pkgs/main/linux-64::conda-package-streaming==0.8.0=py311h06a4308_0', 'pkgs/main/linux-64::cryptography==39.0.1=py311h9ce1e76_2', 'pkgs/main/linux-64::requests==2.29.0=py311h06a4308_0', 'pkgs/main/linux-64::ruamel.yaml==0.17.21=py311h5eee18b_0', 'pkgs/main/linux-64::wheel==0.38.4=py311h06a4308_0', 'pkgs/main/linux-64::libstdcxx-ng==11.2.0=h1234567_1', 'pkgs/main/linux-64::_libgcc_mutex==0.1=main', 'pkgs/main/noarch::pycparser==2.21=pyhd3eb1b0_0', 'pkgs/main/linux-64::boltons==23.0.0=py311h06a4308_0', 'pkgs/main/linux-64::cffi==1.15.1=py311h5eee18b_3', 'pkgs/main/linux-64::pysocks==1.7.1=py311h06a4308_0', 'pkgs/main/linux-64::idna==3.4=py311h06a4308_0', 'pkgs/main/linux-64::toolz==0.12.0=py311h06a4308_0', 'pkgs/main/linux-64::readline==8.2=h5eee18b_0', 'pkgs/main/linux-64::setuptools==67.8.0=py311h06a4308_0', 'pkgs/main/linux-64::libffi==3.4.4=h6a678d5_0', 'pkgs/main/linux-64::ncurses==6.4=h6a678d5_0', 'pkgs/main/linux-64::xz==5.4.2=h5eee18b_0', 'pkgs/main/linux-64::sqlite==3.41.2=h5eee18b_0', 'pkgs/main/noarch::jsonpointer==2.1=pyhd3eb1b0_0', 'pkgs/main/linux-64::libgcc-ng==11.2.0=h1234567_1', 'pkgs/main/noarch::tzdata==2023c=h04d1e81_0', 'pkgs/main/noarch::jsonpatch==1.32=pyhd3eb1b0_0', 'pkgs/main/linux-64::libuuid==1.41.5=h5eee18b_0', 'pkgs/main/linux-64::tqdm==4.65.0=py311h92b7b1e_0', 'pkgs/main/linux-64::libgomp==11.2.0=h1234567_1', 'pkgs/main/linux-64::tk==8.6.12=h1ccaba5_0', 'pkgs/main/linux-64::packaging==23.0=py311h06a4308_0', 'pkgs/main/noarch::charset-normalizer==2.0.4=pyhd3eb1b0_0', 'pkgs/main/linux-64::urllib3==1.26.16=py311h06a4308_0', 'pkgs/main/linux-64::pluggy==1.0.0=py311h06a4308_1', 'pkgs/main/linux-64::brotlipy==0.7.0=py311h5eee18b_1002', 'pkgs/main/linux-64::ld_impl_linux-64==2.38=h1181459_1', 'pkgs/main/linux-64::pycosat==0.6.4=py311h5eee18b_0', 'pkgs/main/linux-64::pyopenssl==23.0.0=py311h06a4308_0', 'pkgs/main/linux-64::bzip2==1.0.8=h7b6447c_0', 'pkgs/main/linux-64::conda-package-handling==2.1.0=py311h06a4308_0', 'pkgs/main/linux-64::pip==23.1.2=py311h06a4308_0']
('INSTALL', 256) ['libzlib'] This is too much. I see your commit above @jaimergp which talks about this issue as well with the I inserted a breakpoint here. And then modified the solve for libmamba deleting del tasks[('UPDATE', 768)]
del tasks[('UPDATE | ESSENTIAL', 131840)] I got similar but not exactly the same solve classic
libsolve
The classic solver still opted for updating the |
When I delete
It feels like conda-libmamba-solver with the tasks being set is causing all the libraries that are dependencies of |
Inspecting the mamba install command and the libsolve inputs that are used
I've checked conda-libmamba-solver if I override the tasks with the following below and I get the same result.
|
Yea, we are finding mostly the same stuff. Making this new test pass is a matter of "doing less" as you have seen, but then some other integration tests fail. Interestingly, using libmamba 1.4.9 (conda-forge tests), we manage to pass almost everything, but still not perfect. We might need to revisit then "broken by libmamba 1.4.2" tests then. The problem is that we were using targeted UPDATE tasks as a way of pinning but then those get downgraded to non-pinning updates after a conflict and hence the "update --all"-like behaviour, I think. |
# This is "just" an essential job, so it gets higher priority in the solver | ||
# conflict resolution. We do this because these are "protected" packages | ||
# (history, aggressive updates) that we should try not messing with if | ||
# conflicts appear | ||
key = ("UPDATE | ESSENTIAL", api.SOLVER_UPDATE | api.SOLVER_ESSENTIAL) | ||
key = f"{key[0]} | ESSENTIAL", key[1] | api.SOLVER_ESSENTIAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line changes
('UPDATE | ESSENTIAL', ...) ['ca-certificates', 'certifi', 'openssl']
to
('INSTALL | ESSENTIAL', 131328) ['ca-certificates', 'certifi', 'openssl']
mamba does
('UPDATE ', ...) ['ca-certificates', 'certifi', 'openssl']
It seems like either way we get the same result.
I'm seeing failures across the board on os's windows/linux/osx. Additionally I'm seeing some new failures in CI from recent new tests in conda e.g. |
We only need to worry about the conda-forge failures, since defaults only provides libmamba 1.4.1 and that one is known to segfault with some error reporting.
|
I've been investigating Using
vs. new PR
with fails with error I've been spending some time investigating which tasks have an effect on the solve. |
I've made several attempts at modifying the tasks to see what works
So from what I am seeing the So I think this has to do with not catching the new error message possibly? I'm going to attempt to catch the error message |
Stopping at the point when the solve fails https://github.com/conda/conda-libmamba-solver/blob/aggressive-channel-update/tests/test_modified_upstream.py?rgh-link-date=2023-08-10T03%3A57%3A59Z#L778. The state is $ self.solver.problems_to_str()
'Encountered problems while solving:\n - nothing provides requested python >3.7.0 - package conda-build-3.12.1-py37_0 requires python >=3.7,<3.8.0a0, but none of the providers can be installed'
$ out_state.conflicts
{}
$ self._parse_problems(self.solver.problems_to_str())
*** ValueError: Unknown message: - nothing provides requested python >3.7.0 - package conda-build-3.12.1-py37_0 requires python >=3.7,<3.8.0a0, but none of the providers can be installed When checking the error that $ self.solver.problems.to_str()
'Encountered problems while solving:\n - nothing provides requested channel-4/linux-64::conda-build ==3.12.1 py37_0 - nothing provides requested python >3.7.0' I've tested that if this branch got the message With results in ``self._parse_problems(self.solver.problems_to_str()) |
Okay on to something. In the If I add a newline and change it to For all these tests I am using:
This commit bit of code was touched 3 months ago https://github.com/mamba-org/mamba/blame/be105ee79de0073a13357b9bca7d3e6f965d3c52/libmamba/src/core/solver.cpp#L453 in mamba-org/mamba#2544. And it looks to me not to include newlines. Yeup inspecting the diff there is a missing newline https://github.com/mamba-org/mamba/pull/2544/files#diff-6a1aa709238cca66bca724329d07cd1a9da34068b774c70416245c929aed963dL609-R469. So I think this is the breakage for this specific test. |
Wow, nice find @costrouc! I guess we can strip the header manually and move on from there at parse time. |
Ah wait, that's not the header, but the error message instead. Now we might need to split by Edit: Opened mamba-org/mamba#2743 |
Can confirm that mamba-org/mamba#2743 solves tests/test_modified_upstream.py::test_conda_downgrade |
Tests Identified in #242 (comment). I will check them off as I verify they work with the latest on mamba-org/mamba#main and conda/conda#main.
From checking the I am focusing on |
Spent time today debugging the faliing test
{('USERINSTALLED', 2560): ['channel-4/linux-64::conda==4.5.10=py27_0', 'channel-4/linux-64::python==2.7.15=h1571d57_0', 'channel-4/linux-64::ca-certificates==2018.03.07=0', 'channel-4/linux-64::openssl==1.0.2p=h14c3975_0', 'channel-4/linux-64::certifi==2018.8.13=py27_0'],
('INSTALL | ESSENTIAL', 131328): ['conda', 'python=3', 'ca-certificates', 'openssl', 'certifi'],
('DISFAVOR', 3328): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests'],
('ALLOWUNINSTALL', 2816): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests'],
('INSTALL', 256): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests']}
{('USERINSTALLED', 2560): ['channel-4/linux-64::conda==4.5.10=py27_0', 'channel-4/linux-64::python==2.7.15=h1571d57_0', 'channel-4/linux-64::ca-certificates==2018.03.07=0', 'channel-4/linux-64::openssl==1.0.2p=h14c3975_0', 'channel-4/linux-64::certifi==2018.8.13=py27_0'],
('UPDATE | ESSENTIAL', 131840): ['conda', 'python=3', 'ca-certificates', 'openssl', 'certifi'],
('DISFAVOR', 3328): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests'],
('ALLOWUNINSTALL', 2816): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests'],
('UPDATE', 768): ['conda-env', 'libgcc-ng', 'libstdcxx-ng', 'libffi', 'ncurses', 'tk', 'yaml', 'zlib', 'libedit', 'readline', 'sqlite', 'asn1crypto', 'chardet', 'cryptography-vectors', 'enum34', 'futures', 'idna', 'ipaddress', 'pycosat', 'pycparser', 'pysocks', 'ruamel_yaml', 'six', 'cffi', 'cryptography', 'pyopenssl', 'urllib3', 'requests']} The removal of this line caused the regression https://github.com/conda/conda-libmamba-solver/pull/242/files#diff-e6794455e7cacff948cf95915e290bc1f742360246a7a96f809b7627bbc379c4L460. Coincidentally this is one of those tests where Added in bda6219 |
@jaimergp after making that change it regressed and broke several other tests. Is there a better place this UPDATE key should be updated? |
Thanks @costrouc, I'll take a look. If it gets too brittle, I am inclined to start a new logic that doesn't follow conda's internal logic as much, but does cover the expectations of the users. We'll see. |
mamba 1.5.0 released an hour ago 👀 Let's see if we get some fixes. |
This will be probably superseded by #270 |
Description
Will close #240
Checklist - did you ...
news
directory (using the template) for the next release's release notes?