Add package conflicts
Rolling Release / build (push) Successful in 1m41s
Rolling Release / publish (push) Successful in 9s

Packages can declare conflicts in orbit.json. The solver keeps them apart,
and a global install offers to replace the installed ones in the way.
Rollback now checks for clashes before it unlinks anything.

Planning: 8m9kt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Opus 5.5 committed 2026-12-01 05:29:25 -08:00
1 parent 6d35f207fd
commit cc47acb3e2
9 files changed
+831 -28

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
---
data:
priority: normal
status: done
tags:
- solver
type: feature
id: 8m9kt
title: Package conflicts
---
Packages such as `moonbit` and `moonbit-nightly` can't be installed together, but only a clash of command names stops it, and the user must remove one by hand first.
Acceptance criteria:
- `orbit.json` takes `"conflicts": { "<name>": "<constraint>" }`, as in Arch. One side declaring it is enough. `*` includes prereleases.
- The solver never selects conflicting packages, in a project or globally, and says why when that leaves no solution.
- A global install that conflicts with installed packages asks before replacing them. Without a terminal it fails unless `--replace` is given. It refuses if another package needs the one to be removed, and downloads first.
- Conflicts are kept in `state.json` and `orbit.lock`; rollback checks them.
Outcome: `src/main/conflicts.mbt` and the solver. Checked end to end against `registry:2`, including the prompt. `moonbit-nightly` declares its conflict in orbit-packages. Arch's `provides` and `replaces` are not included: one package can't satisfy a dependency on another.