🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@andrius-puksta-sensmetry
Copy link
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry commented Dec 29, 2025

Note for reviewers: this is best reviewed commit-by-commit, since commits are largely self-contained.

Changes:

  • Remove version constraints from lockfile (also bump lockfile version to 0.3). They are not needed for version resolution and arguably hurt readability a bit. We may want to still include versions (but not constraints) if we ever add support to depend on two different versions of same package.
    Example lockfile fragment before:
[[project]]
name = "test"
version = "0.0.1"
usages = [
    { resource = "urn:kpar:sysmod", version_constraint = "^5.0.0-alpha" },
]
sources = [
    { editable = "." },
]
checksum = "..."

Example after:

[[project]]
name = "test"
version = "0.0.1"
usages = [
    "urn:kpar:sysmod",
]
sources = [
    { editable = "." },
]
checksum = "..."
  • exclude benches and doctests from cargo test, since we have none. This cleans up cargo test output.
  • don't include same project (here "same" means specifically same name, version and checksum; it would be better to check some sort of canonical identifier instead of name if/when we have it) more than once in lockfile. Part of Detect and warn or fail in the presence of potentially conflicting projects #9.
  • (debug builds only) validate lockfile upon generating it

Fixes

Report a proper error when package was not found:

$ sysand add aaa:bbb
error: unable to select version of `aaa:bbb`: IRI is not resolvable: no resolver was able to resolve the IRI

instead of previous:

$ sysand add aaa:bbb
      Adding usage: `aaa:bbb`
error: Failed to satisfy usage constraints:
requested project(s) alternative nr 0 depends on aaa:bbb

Error message could be improved, but at least now it's explicitly checked and handled.

Report a proper error when required package version was not found:

$ sysand add urn:kpar:sysmod 5.0.0
error: failed to retrieve project(s): requested version unavailable: project `urn:kpar:sysmod`
was found, but the requested version constraint `^5.0.0`
was not satisfied by any of the found versions:
`5.0.0-alpha.2`, `5.0.0-alpha.1`

instead of previous:

$ sysand add urn:kpar:sysmod 5.0.0
      Adding usage: `urn:kpar:sysmod` 5.0.0
error: Failed to satisfy usage constraints:
requested project(s) alternative nr 0 depends on urn:kpar:sysmod no valid alternatives

Fixes #108.

Use Debug impls of reqwest(_middleware) errors to get all error details, since Display impls give no details. This makes errors look uglier. Current:

$ sysand env install aaa:bbb --index=http://localhost:8080/
error: unable to select version of `aaa:bbb`: resolution error: error making an HTTP request:
Reqwest(
    reqwest::Error {
        kind: Request,
        url: "http://localhost:8080/1b45c84078cf7810b6604c7b01169f668e41fd1784c21352e9e89d8833097dd2/versions.txt",
        source: hyper_util::client::legacy::Error(
            Connect,
            ConnectError(
                "tcp connect error",
                127.0.0.1:8080,
                Os {
                    code: 61,
                    kind: ConnectionRefused,
                    message: "Connection refused",
                },
            ),
        ),
    },
)

Previous:

$ sysand env install aaa:bbb --index http://localhost/
error: Choosing a version for aaa:bbb failed
Choosing a version for aaa:bbb failed
error making an HTTP request to 'http://localhost/1b45c84078cf7810b6604c7b01169f668e41fd1784c21352e9e89d8833097dd2/versions.txt':
error sending request for url (http://localhost/1b45c84078cf7810b6604c7b01169f668e41fd1784c21352e9e89d8833097dd2/versions.txt)

Other fixes:

  • sysand add: run package and dependency resolver before adding the requested package to .project.json

Refactor

  • optimize sysand sync to not re-read lockfile it just generated

Deps

  • update logos to 0.16; this version changes semantics of regexes to work properly and (probably) no longer be too greedy. This PR does not change our usage of logos, asidde from fixing line comment parsing.
  • update all other Rust deps to latest versions

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
… validation

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…nsure that we don't generate invalid lockfiles

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Uses Debug impl, since Display impl does not include
all details

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…ired version is not found

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…n constraint

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
…versions

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry andrius-puksta-sensmetry force-pushed the ap/solver-errors branch 3 times, most recently from 7092059 to e10a482 Compare January 5, 2026 14:45
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
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.

Properly handle nonexistent packages

2 participants