Skip to content

Running locally (for testing) requires setting GIT_REPO_URL #2030

Closed
@bruceadams

Description

@bruceadams

Running the background-worker locally fails to find the local index git repo, like this:

$ cargo run --bin background-worker
    Finished dev [unoptimized + debuginfo] target(s) in 0.25s
     Running `target/debug/background-worker`
Booting runner
Using local uploader, crate files will be in the local_uploads directory
Cloning index
thread 'main' panicked at 'Failed to clone index: Error { code: -1, klass: 2, message: "failed to resolve path \'file://./tmp/index-bare\': No such file or directory" }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

A workaround, described in #1996 (comment), is to define GIT_REPO_URL to the correct, absolute path on the local machine, like this:

$ GIT_REPO_URL=file:///Users/bruce/github/crates.io/tmp/index-bare cargo run --bin background-worker
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
     Running `target/debug/background-worker`
Booting runner
Using local uploader, crate files will be in the local_uploads directory
Cloning index
Runner booted, running jobs

Ideally, this would manage to just work using relative paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions