Help Implementing Custom Registry

I'm currently working on implementing a custom cargo registry for GitLab. I've read about how git and sparse index work and thinking of implementing sparse index. Currently, I built a FastAPI-based web server with basic APIs for fetching config.json, publishing, and downloading. I've made a sample crate with the following Cargo.toml:

[package]
name = "local_package"
version = "0.1.30"
edition = "2021"
description = "A local package"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# clap = { version = "4.5.18"}

This is working well when I do:

โžœ  local_package git:(master) โœ— cargo publish --index sparse+http://localhost:8001/ --token cioINbd1Va8cwhP8ZGvjzmHP2wxCvAlVS3F --allow-dirty 
    Updating `sparse+http://localhost:8001/` index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging local_package v0.1.30 (/home/luna/Documents/local_package)
    Packaged 4 files, 1.2KiB (827.0B compressed)
   Verifying local_package v0.1.30 (/home/luna/Documents/local_package)
   Compiling local_package v0.1.30 (/home/luna/Documents/local_package/target/package/local_package-0.1.30)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s
   Uploading local_package v0.1.30 (/home/luna/Documents/local_package)
    Uploaded local_package v0.1.30 to registry `sparse+http://localhost:8001/`
note: waiting for `local_package v0.1.30` to be available at registry `sparse+http://localhost:8001/`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
   Published local_package v0.1.30 at registry `sparse+http://localhost:8001/

But as soon as I add clap as a dependency, I'm not sure why the publish command is waiting for something to be updated in the index:

โžœ  local_package git:(master) โœ— cargo publish --index sparse+http://localhost:8001/ --token cioINbd1Va8cwhP8ZGvjzmHP2wxCvAlVS3F --allow-dirty 
    Updating `sparse+http://localhost:8001/` index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging local_package v0.1.31 (/home/luna/Documents/local_package)
    Updating crates.io index
    Packaged 4 files, 6.3KiB (2.2KiB compressed)
   Verifying local_package v0.1.31 (/home/luna/Documents/local_package)
   Compiling utf8parse v0.2.2
   Compiling anstyle v1.0.10
   Compiling anstyle-query v1.1.2
   Compiling colorchoice v1.0.3
   Compiling is_terminal_polyfill v1.70.1
   Compiling strsim v0.11.1
   Compiling clap_lex v0.7.4
   Compiling anstyle-parse v0.2.6
   Compiling anstream v0.6.18
   Compiling clap_builder v4.5.26
   Compiling clap v4.5.26
   Compiling local_package v0.1.31 (/home/luna/Documents/local_package/target/package/local_package-0.1.31)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.40s
   Uploading local_package v0.1.31 (/home/luna/Documents/local_package)
    Uploaded local_package v0.1.31 to registry `sparse+http://localhost:8001/`
note: waiting for `local_package v0.1.31` to be available at registry `sparse+http://localhost:8001/`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
   Waiting [=>                          ] 6/60                                                                                                                                      

And my updated index looks like this:

{"name": "local_package", "vers": "0.1.30", "deps": [], "cksum": "bf3a78a3a0f4c1c318942f4dca82ddeae412b255391c63a61d709cec1dcdefd8", "features": {}, "yanked": false}
{"name": "local_package", "vers": "0.1.31", "deps": [{"optional": false, "default_features": true, "name": "clap", "features": [], "version_req": "^4.5.18", "target": null, "kind": "normal", "registry": "https://github.com/rust-lang/crates.io-index"}], "cksum": "1e5bbf4f287ea520ebbb5cf7a43d1bb5d3b6125ba70ec46eebd93cfaa6d9fb22", "features": {}, "yanked": false}

From the cargo source code, I can see that it's trying to do something with the dependent packages (cargo/src/cargo/ops/registry/publish.rs at master ยท rust-lang/cargo ยท GitHub). I'm not sure what it's trying to do. Meanwhile, in my web server, I don't see any failed API calls. It's GETting the index file.

Do I need to update anything else along with the package metadata when using dependent packages? I'm just storing the JSON metadata into the index and the crate file to the crate location.

1 Like

That should be sufficient.

It is waiting for the server to process the publish request. It will repeatedly request the index until it can find the new 0.1.31. Can you log all the requests and responses on the server side? If the index request are getting the response you describe, then for some reason Cargo is ignoring that entry. Cargo ignores rows that have problems, so that we can add new things without braking older Cargoes. Ed just added some better error messages for around ignored versions. So after publish and using nightly Cargo try depending on local_package = "0.1.31" and see if the error gives more info. If not we may have to look at Cargos own loging.

Without External Deps (v0.1.0)

These are the logs for doing cargo publish without external dependencies:

{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": ""}}
{"request": {"method": "PUT", "url": "http://localhost:8001/api/v1/crates/new", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "accept": "application/json", "authorization": "cioINbd1Va8cwhP8ZGvjzmHP2wxCvAlVS3F", "content-length": "1141"}}, "response": {"status_code": 200, "body": "{\"message\":\"Crate created successfully\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"0dce2c97a9d8eb09b9167f970022c3b2\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n"}}
โžœ  local_package git:(master) โœ— cargo publish --index sparse+http://localhost:8001/ --allow-dirty 
    Updating `sparse+http://localhost:8001/` index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging local_package v0.1.0 (/home/luna/Documents/local_package)
    Packaged 4 files, 1.2KiB (826.0B compressed)
   Verifying local_package v0.1.0 (/home/luna/Documents/local_package)
   Compiling local_package v0.1.0 (/home/luna/Documents/local_package/target/package/local_package-0.1.0)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
   Uploading local_package v0.1.0 (/home/luna/Documents/local_package)
    Uploaded local_package v0.1.0 to registry `sparse+http://localhost:8001/`
note: waiting for `local_package v0.1.0` to be available at registry `sparse+http://localhost:8001/`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
   Published local_package v0.1.0 at registry `sparse+http://localhost:8001/`

Logs for cargo install without external deps:

{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"13234bfd124eeecbde57bd56b576aff5\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"13234bfd124eeecbde57bd56b576aff5\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n"}}
cargo install --index sparse+http://localhost:8001/  local_package@0.1.0 --force
    Updating `sparse+http://localhost:8001/` index
  Installing local_package v0.1.0 (registry `sparse+http://localhost:8001/`)
    Updating `sparse+http://localhost:8001/` index
   Compiling local_package v0.1.0 (registry `sparse+http://localhost:8001/`)
    Finished `release` profile [optimized] target(s) in 0.23s
   Replacing /home/luna/.cargo/bin/local_package
    Replaced package `local_package v0.1.0 (registry `sparse+http://localhost:8001/`)` with `local_package v0.1.0 (registry `sparse+http://localhost:8001/`)` (executable `local_package`)

With External Deps (v0.1.2)

These are the logs when I do cargo publish with clap as a dependency:

{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"fb2bc1d8935cc6cdffe70bb4e22eafcb\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "PUT", "url": "http://localhost:8001/api/v1/crates/new", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "accept": "application/json", "authorization": "cioINbd1Va8cwhP8ZGvjzmHP2wxCvAlVS3F", "content-length": "2774"}}, "response": {"status_code": 200, "body": "{\"message\":\"Crate created successfully\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"80964cc8bff84d9b218a14afb30b0ed0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}
โžœ  local_package git:(master) โœ— cargo publish --index sparse+http://localhost:8001/ --allow-dirty 
    Updating `sparse+http://localhost:8001/` index
warning: manifest has no documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging local_package v0.1.2 (/home/luna/Documents/local_package)
    Updating crates.io index
    Packaged 4 files, 6.3KiB (2.2KiB compressed)
   Verifying local_package v0.1.2 (/home/luna/Documents/local_package)
   Compiling utf8parse v0.2.2
   Compiling colorchoice v1.0.3
   Compiling anstyle v1.0.10
   Compiling anstyle-query v1.1.2
   Compiling is_terminal_polyfill v1.70.1
   Compiling clap_lex v0.7.4
   Compiling strsim v0.11.1
   Compiling anstyle-parse v0.2.6
   Compiling anstream v0.6.18
   Compiling clap_builder v4.5.27
   Compiling clap v4.5.27
   Compiling local_package v0.1.2 (/home/luna/Documents/local_package/target/package/local_package-0.1.2)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.32s
   Uploading local_package v0.1.2 (/home/luna/Documents/local_package)
    Uploaded local_package v0.1.2 to registry `sparse+http://localhost:8001/`
note: waiting for `local_package v0.1.2` to be available at registry `sparse+http://localhost:8001/`.
You may press ctrl-c to skip waiting; the crate should be available shortly.
^C   Waiting [                            ] 2/60                                                                                                                                      

I clicked ^C to avoid cargo publish waiting. Then I did cargo install and I got the following logs:

{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}
{"request": {"method": "GET", "url": "http://localhost:8001/config.json", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain"}}, "response": {"status_code": 200, "body": "{\"dl\":\"http://localhost:8001/crates\",\"api\":\"http://localhost:8001\"}"}}
{"request": {"method": "GET", "url": "http://localhost:8001/lo/ca/local_package", "headers": {"host": "localhost:8001", "user-agent": "cargo/1.84.0 (66221abde 2024-11-19)", "accept-encoding": "deflate, gzip", "connection": "Upgrade, HTTP2-Settings", "upgrade": "h2c", "http2-settings": "AAMAAABkAAQAoAAAAAIAAAAA", "cargo-protocol": "version=1", "accept": "text/plain", "if-none-match": "\"b22dfa068e9a6bdd2b812e46574969e0\""}}, "response": {"status_code": 200, "body": "{\"name\": \"local_package\", \"vers\": \"0.1.0\", \"deps\": [], \"cksum\": \"0039170cdd15c6ef14b12fa1dca243a2b414a020fb7855eb933de3d6ec758f84\", \"features\": {}, \"yanked\": false}\n{\"name\": \"local_package\", \"vers\": \"0.1.2\", \"deps\": [{\"optional\": false, \"default_features\": true, \"name\": \"clap\", \"features\": [], \"version_req\": \"^4.5.18\", \"target\": null, \"kind\": \"normal\", \"registry\": \"https://github.com/rust-lang/crates.io-index\"}], \"cksum\": \"bfccab3fc6ac635b5a7421130a9281caa5e1669004c235d7eea4ce31e67146b1\", \"features\": {}, \"yanked\": false}\n"}}

cargo install returned this:

cargo install --index sparse+http://localhost:8001/  local_package@0.1.2 --force
    Updating `sparse+http://localhost:8001/` index
error: could not find `local_package` in registry `sparse+http://localhost:8001/` with version `=0.1.2`