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

handle run_constrained and constraints in run_exports #31

Merged
merged 2 commits into from
May 8, 2024

Conversation

minrk
Copy link
Contributor

@minrk minrk commented May 8, 2024

follow-up to #30, this actually implements applications of constraints to the solve

@@ -1069,12 +1087,21 @@ def _is_recipe_solvable_on_platform(
if m.noarch or m.noarch_python:
run_req = list(set(run_req) | host_rx["noarch"])
else:
run_req = list(set(run_req) | host_rx["weak"])
run_req = list(set(run_req) | host_rx["weak"] | host_rx["strong"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this line is a bug fix. Thanks for catching!

@beckermr beckermr enabled auto-merge May 8, 2024 13:00
@beckermr beckermr disabled auto-merge May 8, 2024 13:31
@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

@jaimergp do you understand the solver errors here? I don't get the error that arrow-cpp does not exist.

@jaimergp
Copy link
Collaborator

jaimergp commented May 8, 2024

Hm, I haven't used that method. What about add_pin? Would that work?

@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

I don't see why that makes sense. Care to explain more?

and check that constraints don't get installed
Copy link
Contributor

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

Adding pins as I understand them won't work. Sometimes people use run constraints to versions of packages that do not exist. I assume the solver will try to install the pins and this will create false negatives.

@minrk
Copy link
Contributor Author

minrk commented May 8, 2024

I opened mamba-org/mamba#3293 because add_constraint seems to add the package to the install specs. I think add_pin works, and I added a test to ensure that constraints don't get added to the solution. Maybe I misunderstood what add_constraint means.

@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

Ohhhhh wow. I think add_pin <-> add_constraint need to have their names swapped. If add_pin does not install, then we're fine.

@beckermr beckermr dismissed their stale review May 8, 2024 17:41

i'm hopefully wrong.

@minrk
Copy link
Contributor Author

minrk commented May 8, 2024

@beckermr I don't know if it's a terminology problem or what, but that's what I expected, too. But it's not how it behaves, despite explicitly stating it should, I think. add_constraint adds the package to the install list, while add_pin only constrains the version and works whether it's installed or not. add_pin required installed_repo to be set, which I also don't understand, but 🤷 it seems to have the effect I expected constraint to have.

@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

If this passes, I think we'll want a tighter pin on libmambapy in the feedstock so that if this bug gets fixed, things still work.

@minrk
Copy link
Contributor Author

minrk commented May 8, 2024

2.0 is in beta already which appears to significantly change the Python API, so <2 might be enough.

@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

We'll need to patch old release of this anyways then.

@minrk
Copy link
Contributor Author

minrk commented May 8, 2024

I added a few tests that run in a matter of seconds for me, but CI runtime has more than doubled in this PR. I don't know if that's a fluke or a consequence of the pinning changes.

@beckermr
Copy link
Contributor

beckermr commented May 8, 2024

It is probably related, but TBH we don't get a choice on these things. The solver takes how long the solver takes. I am going to merge and we can add options to turn this off later if we need it.

@beckermr beckermr merged commit 71b18b1 into regro:main May 8, 2024
2 checks passed
@minrk minrk deleted the constrains branch May 9, 2024 07:06
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.

3 participants