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

feat: solve strategies #660

Merged
merged 7 commits into from
May 16, 2024
Merged

feat: solve strategies #660

merged 7 commits into from
May 16, 2024

Conversation

baszalmstra
Copy link
Collaborator

@baszalmstra baszalmstra commented May 14, 2024

Implements solver strategies:

  • Highest (default): Solve all packages to the highest compatible version.
  • LowestVersion: Solve all packages to the lowest compatible version. This only looks at the version. This ensures that build number ordering and downprioritization remain functional.
  • LowestVersionDirect: Solve for the lowest compatible version, similar to LowestVersion, but only for direct dependencies. Transitive dependencies are still sorted using the Highest strategy.

This is only implemented when using resolvo. When using a non-default strategy with libsolv you will get an Unsupported error.

This is also implemented into the binary:

> cargo run -- create --dry-run 'python>2' --platform linux-64 --strategy highest
+ _libgcc_mutex 0.1 conda_forge
+ libgomp 13.2.0 h77fa898_7
+ _openmp_mutex 4.5 2_gnu
+ libgcc-ng 13.2.0 h77fa898_7
+ xz 5.2.6 h166bdaf_0
+ tzdata 2024a h0c530f3_0
+ libzlib 1.2.13 hd590300_5
+ tk 8.6.13 noxft_h4845f30_101
+ ncurses 6.5 h59595ed_0
+ readline 8.2 h8228510_1
+ ca-certificates 2024.2.2 hbcca054_0
+ openssl 3.3.0 hd590300_0
+ libxcrypt 4.4.36 hd590300_1
+ libuuid 2.38.1 h0b41bf4_0
+ libsqlite 3.45.3 h2797004_0
+ libnsl 2.0.1 hd590300_0
+ libffi 3.4.2 h7f98852_5
+ libexpat 2.6.2 h59595ed_0
+ ld_impl_linux-64 2.40 h55db66e_0
+ bzip2 1.0.8 hd590300_5
+ python 3.12.3 hab00c5b_0_cpython
> cargo run -- create --dry-run 'python>2' --platform linux-64 --strategy lowest
+ zlib 1.2.8 3
+ tk 8.5.19 2
+ sqlite 3.13.0 1
+ ncurses 5.9 10
+ readline 6.2 0
+ ca-certificates 2016.2.28 0
+ openssl 1.0.2h 3
+ python 2.6.9 0
> cargo run -- create --dry-run 'python>2' --platform linux-64 --strategy lowest-direct
+ _libgcc_mutex 0.1 conda_forge
+ libgomp 13.2.0 h77fa898_7
+ _openmp_mutex 4.5 2_gnu
+ libgcc-ng 13.2.0 h77fa898_7
+ libzlib 1.2.13 hd590300_5
+ zlib 1.2.13 hd590300_5
+ tk 8.5.19 2
+ sqlite 3.13.0 1
+ ncurses 5.9 10
+ readline 6.2 0
+ ca-certificates 2024.2.2 hbcca054_0
+ openssl 1.0.2u h516909a_0
+ python 2.6.9 0

Note that Im using python>2 because there is also a python 1.0.1 on conda-forge.

Fixes #330

@baszalmstra baszalmstra requested a review from wolfv May 14, 2024 09:55
@baszalmstra baszalmstra marked this pull request as ready for review May 14, 2024 12:29
@wolfv
Copy link
Contributor

wolfv commented May 16, 2024

Looks great!

@wolfv wolfv merged commit 0e24e50 into conda:main May 16, 2024
15 checks passed
This was referenced May 14, 2024
This was referenced May 23, 2024
baszalmstra added a commit that referenced this pull request May 27, 2024
## 🤖 New release
* `rattler`: 0.25.0 -> 0.26.0
* `rattler_conda_types`: 0.23.1 -> 0.24.0
* `rattler_package_streaming`: 0.20.10 -> 0.21.0
* `rattler_networking`: 0.20.7 -> 0.20.8
* `rattler_lock`: 0.22.7 -> 0.22.8
* `rattler_repodata_gateway`: 0.20.1 -> 0.20.2
* `rattler_solve`: 0.22.0 -> 0.23.0
* `rattler_index`: 0.19.12 -> 0.19.13
* `rattler_shell`: 0.20.4 -> 0.20.5
* `rattler_virtual_packages`: 0.19.11 -> 0.19.12

<details><summary><i><b>Changelog</b></i></summary><p>

## `rattler`
<blockquote>

##
[0.26.0](rattler-v0.25.0...rattler-v0.26.0)
- 2024-05-27

### Fixed
- improve progress bar duration display
([#680](#680))

### Other
- introducing the installer
([#664](#664))
- create directories up front
([#533](#533))
</blockquote>

## `rattler_conda_types`
<blockquote>

##
[0.24.0](rattler_conda_types-v0.23.1...rattler_conda_types-v0.24.0)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
- add solve strategies
([#660](#660))

### Fixed
- make topological sorting support fully cyclic dependencies
([#678](#678))
</blockquote>

## `rattler_package_streaming`
<blockquote>

##
[0.21.0](rattler_package_streaming-v0.20.10...rattler_package_streaming-v0.21.0)
- 2024-05-27

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_networking`
<blockquote>

##
[0.20.8](rattler_networking-v0.20.7...rattler_networking-v0.20.8)
- 2024-05-27

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_lock`
<blockquote>

##
[0.22.8](rattler_lock-v0.22.7...rattler_lock-v0.22.8)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
</blockquote>

## `rattler_repodata_gateway`
<blockquote>

##
[0.20.2](rattler_repodata_gateway-v0.20.1...rattler_repodata_gateway-v0.20.2)
- 2024-05-27

### Fixed
- result grouped by subdir instead of channel
([#666](#666))

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_solve`
<blockquote>

##
[0.23.0](rattler_solve-v0.22.0...rattler_solve-v0.23.0)
- 2024-05-27

### Added
- removed Ord and more
([#673](#673))
- always store purls as a key in lock file
([#669](#669))
- add solve strategies
([#660](#660))

### Fixed
- result grouped by subdir instead of channel
([#666](#666))

### Other
- introducing the installer
([#664](#664))
</blockquote>

## `rattler_index`
<blockquote>

##
[0.19.13](rattler_index-v0.19.12...rattler_index-v0.19.13)
- 2024-05-27

### Added
- always store purls as a key in lock file
([#669](#669))
</blockquote>

## `rattler_shell`
<blockquote>

##
[0.20.5](rattler_shell-v0.20.4...rattler_shell-v0.20.5)
- 2024-05-27

### Other
- updated the following local packages: rattler_conda_types
</blockquote>

## `rattler_virtual_packages`
<blockquote>

##
[0.19.12](rattler_virtual_packages-v0.19.11...rattler_virtual_packages-v0.19.12)
- 2024-05-27

### Other
- updated the following local packages: rattler_conda_types
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
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.

Solve for the "lowest" versions of specs
3 participants