Skip to content

Commit

Permalink
feat: license, ci, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Sep 25, 2023
1 parent a6b855c commit 2470edf
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore(ci)"
58 changes: 58 additions & 0 deletions .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
branches: [ $default-branch ]
pull_request:

name: Rust

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_LOG: info
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
CARGO_TERM_COLOR: always

jobs:
check-rustdoc-links:
name: Check intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo rustdoc --all-features -- -D warnings -W unreachable-pub

format_and_lint:
name: Format and Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy, rustfmt
- name: Run rustfmt
uses: actions-rust-lang/rustfmt@v1
- name: Run clippy
run: cargo clippy

build:
name: ubuntu-latest
runs-on: ubuntu-latest
needs: [ format_and_lint ]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Build
run: cargo build
- name: Run tests
run: cargo test -- --nocapture
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.idea/

.vscode/

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

**/.DS_Store
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing 😍

We would love to have you contribute!
For a good list of things you could help us with, take a look at our [*good first issues*](https://github.com/mamba-org/resolvo/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22).
If you want to go deeper though, any [open issue](https://github.com/mamba-org/resolvo/issues) is up for grabs.
Just let us know what you start on something.

For questions, requests or a casual chat, we are very active on our discord server.
You can [join our discord server via this link][chat-url].



19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "rattler_libsolv_rs"
version.workspace = true
edition.workspace = true
authors = ["Adolfo Ochagavía <github@adolfo.ochagavia.nl>"]
description = "SAT solving library for dependency resolution"
categories.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
readme.workspace = true
version = "0.1.0"
authors = ["Adolfo Ochagavía <github@adolfo.ochagavia.nl>", "Bas Zalmstra <zalmstra.bas@gmail.com>", "Tim de Jager <tdejager89@gmail.com>" ]
description = "Fast package resolver written in Rust (CDCL based SAT solving)"
keywords = ["dependency", "solver", "version"]
categories = ["algorithms"]
homepage = "https://github.com/mamba-org/resolvo"
repository = "https://github.com/mamba-org/resolvo"
license = "BSD-3-Clause"
edition = "2021"
readme = "README.md"

[dependencies]
itertools = "0.11.0"
Expand Down
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2023, prefix.dev GmbH

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Resolvo: Fast package resolver written in Rust

![License][license-badge]
[![Build Status][build-badge]][build]
[![Project Chat][chat-badge]][chat-url]

[license-badge]: https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square
[build-badge]: https://img.shields.io/github/actions/workflow/status/mamba-org/resolvo/rust-compile.yml?style=flat-square&branch=main
[build]: https://github.com/mamba-org/resolvo/actions
[chat-badge]: https://img.shields.io/discord/1082332781146800168.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2&style=flat-square
[chat-url]: https://discord.gg/kKV8ZxyzY4
[docs-main-badge]: https://img.shields.io/badge/docs-main-yellow.svg?style=flat-square
[docs-main]: https://docs.rs/resolvo

Resolvo implements a fast package resolution algorithm based on CDCL SAT solving.
If resolvo is unable to find a solution it outputs a human readable error message:

```
The following packages are incompatible
|-- bluesky-widgets >=0, <100 can be installed with any of the following options:
|-- bluesky-widgets 42 would require
|-- suitcase-utils >=0, <54, which can be installed with any of the following options:
|-- suitcase-utils 53
|-- suitcase-utils >=54, <100 cannot be installed because there are no viable options:
|-- suitcase-utils 54, which conflicts with the versions reported above.
```

Resolve provides a generic interface which allows integrating the solver with a variety of package managers. For instance resolvo is used in [rattler](https://github.com/mamba-org/rattler) and [pixi](https://github.com/prefix-dev/pixi) to solve packages from the conda ecosystem.

Originally resolvo started out as a port/fork of [libsolv](https://github.com/openSUSE/libsolv) but it has since then diverged substantially. However, the same CDCL algorithm based on MiniSats [An Extensible SAT-solver](http://minisat.se/downloads/MiniSat.pdf) is still used underneath. Major differences compared to libsolv are:

* Resolvo does not come with built-in support for several packaging ecosystems but instead provides a generic interface to allow it to be used in different scenarios.
* Resolvo has support for incremental/lazy solving. This allows users to quickly find solutions in ecosystems where retrieving package metadata is expensive.
* Resolvo is considerably faster than libsolv in large complex cases.
* Resolvo can easily be used in multithreaded environments.
* Resolvo provides human readable error messages out-of-the-box.
* However, Libsolv is more extensive and supports more complex queries.

## Contributing 😍

We would love to have you contribute!
See the CONTRIBUTION.md for more info. For questions, requests or a casual chat, we are very active on our discord server.
You can [join our discord server via this link][chat-url].

0 comments on commit 2470edf

Please sign in to comment.