Skip to content
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

use index in offline mode when called from conda-build #395

Merged
merged 7 commits into from
Dec 6, 2023

Conversation

jaimergp
Copy link
Contributor

@jaimergp jaimergp commented Nov 22, 2023

Description

Fixes #386, together with conda/conda#13357.

We need to instantiate IndexHelper in offline mode for compatibility with conda-build. Otherwise the index can get out of sync during long build processes.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Nov 22, 2023
@jaimergp
Copy link
Contributor Author

Errors are due to conda/conda#13360

@jaimergp jaimergp marked this pull request as ready for review November 25, 2023 16:41
@jaimergp jaimergp closed this Nov 27, 2023
@jaimergp jaimergp reopened this Nov 27, 2023
@jaimergp
Copy link
Contributor Author

@conda/conda-core @conda/conda-libmamba-solver this is ready for review :) 🙏

@@ -409,3 +411,26 @@ def _process_query_result(

# for conda-build
_CachedLibMambaIndexHelper = lru_cache(maxsize=None)(LibMambaIndexHelper)


def _LibMambaIndexForCondaBuild(*args, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type change from class to function for the index helper is a little miffy, I'd rather see use a subclass and then override context.offline in the _CachedLibMambaIndexHelper.__init__ when calling super.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I like it.

@mbargull
Copy link
Member

mbargull commented Dec 5, 2023

Makes sense to me.
It would be good to have this in conda-build itself too (i.e., it should request a consistent index for spanning the whole build).


I'm not too familiar with the code base to give a proper review yet.
It would be good to test the usual corner cases like multi-output recipes.

@jaimergp
Copy link
Contributor Author

jaimergp commented Dec 5, 2023

It would be good to test the usual corner cases like multi-output recipes.

We have some simple tests for these conda-build cases:

../conda-libmamba-solver-src/tests/test_downstream.py::test_build_recipe[baddeps] PASSED [ 15%]
../conda-libmamba-solver-src/tests/test_downstream.py::test_build_recipe[jedi] PASSED [ 17%]
../conda-libmamba-solver-src/tests/test_downstream.py::test_build_recipe[multioutput] PASSED [ 18%]
../conda-libmamba-solver-src/tests/test_downstream.py::test_build_recipe[stackvana] PASSED [ 19%]

@jezdez jezdez merged commit 6d61b0f into main Dec 6, 2023
71 checks passed
@jezdez jezdez deleted the conda-build-offline branch December 6, 2023 07:49
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Dec 6, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

KeyError in some conda-build cases
4 participants