{"record":{"id":"40ac3cbc0cf09a26","repo":"astral-sh/uv","slug":"source-does-not-exist","errorCode":null,"errorMessage":"Source `{}` does not exist","messagePattern":"Source `(.+?)` does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/build_frontend.rs","lineNumber":316,"sourceCode":"        extra_build_dependencies,\n        extra_build_variables,\n        exclude_newer,\n        link_mode,\n        upgrade: _,\n        build_options,\n        sources,\n        torch_backend: _,\n        cuda_driver_version: _,\n        amd_gpu_architecture: _,\n    } = settings;\n\n    // Determine the source to build.\n    let src = if let Some(src) = src {\n        let src = std::path::absolute(src)?;\n        let metadata = match fs_err::tokio::metadata(&src).await {\n            Ok(metadata) => metadata,\n            Err(err) if err.kind() == io::ErrorKind::NotFound => {\n                return Err(anyhow::anyhow!(\n                    \"Source `{}` does not exist\",\n                    src.user_display()\n                ));\n            }\n            Err(err) => return Err(err.into()),\n        };\n        if metadata.is_file() {\n            Source::File(Cow::Owned(src))\n        } else {\n            Source::Directory(Cow::Owned(src))\n        }\n    } else {\n        Source::Directory(Cow::Borrowed(project_dir))\n    };\n\n    // Attempt to discover the workspace; on failure, save the error for later.\n    let workspace = Workspace::discover(\n        src.directory(),","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/build_frontend.rs#L298-L334","documentation":"Raised by `uv build` when an explicit source path is given and tokio metadata() fails with io::ErrorKind::NotFound. uv absolutizes the path first, so the message shows the resolved path — it means the file or directory you asked to build genuinely is not on disk at that location.","triggerScenarios":"`uv build ./dist/pkg-1.0.tar.gz` when the sdist was cleaned or never built; typo in the path; running from the wrong working directory (relative path resolved against cwd); path with wrong casing on case-sensitive filesystems.","commonSituations":"CI scripts referencing an artifact path produced by an earlier step that failed or moved; shell quoting issues with paths containing spaces; rebuilding after `git clean`/`rm -rf dist` removed the referenced file.","solutions":["Verify the path exists: `ls` the exact printed path and fix typos or casing.","Check your working directory — uv resolves relative paths against cwd, so `cd` to the expected root or pass an absolute path.","Regenerate the artifact if it was cleaned (e.g., re-run the step that produces the sdist) before `uv build` on it.","Quote paths containing spaces or special characters in your shell."],"exampleFix":"# before (run from repo root, package is in crates/)\nuv build ./pkg  # -> Source `.../pkg` does not exist\n# after\nuv build ./crates/pkg","handlingStrategy":"validation","validationCode":"# Rust: check existence before invoking the build\nlet src = std::path::absolute(src)?;\nif !tokio::fs::try_exists(&src).await? {\n    anyhow::bail!(\"build source missing: {}\", src.display());\n}\n# Shell:\ntest -e \"$SRC\" || { echo \"missing build source: $SRC\" >&2; exit 1; }\nuv build \"$SRC\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Assert artifacts exist at the start of build scripts (test -e) before invoking uv build.","Pass absolute paths or run from a known working directory.","Quote paths with spaces in shell scripts."],"tags":["build","filesystem","path"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}