Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message when git is not found #9206

Merged

Conversation

blueraft
Copy link
Contributor

Summary

Closes #9200

Test Plan

Using the following Dockerfile:

FROM debian:latest

RUN apt-get update && apt-get install -y python3

WORKDIR /app
COPY target/debug/uv .
RUN chmod +x uv

RUN /app/uv venv && /app/uv pip install [email protected]:pallets/flask.git
❯ cargo build -q -p uv && docker build .
...
 => ERROR [6/6] RUN /app/uv venv && /app/uv pip install [email protected]:pallets/flask.git                    0.4s
------
 > [6/6] RUN /app/uv venv && /app/uv pip install [email protected]:pallets/flask.git:
0.275 Using CPython 3.11.2 interpreter at: /usr/bin/python3
0.275 Creating virtual environment at: .venv
0.318   × Failed to download and build `git @
0.318   │ file:///app/github.com:pallets/flask.git`
0.318   ├─▶ Git operation failed
0.318   ╰─▶ Git executable not found. Ensure that Git is installed and available.
------
Dockerfile:9
--------------------
   7 |     RUN chmod +x uv
   8 |
   9 | >>> RUN /app/uv venv && /app/uv pip install [email protected]:pallets/flask.git
  10 |
--------------------
ERROR: failed to solve: process "/bin/sh -c /

@charliermarsh charliermarsh self-assigned this Nov 18, 2024
@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Nov 18, 2024
@charliermarsh charliermarsh self-requested a review November 18, 2024 17:15
#[error("Git executable not found. Ensure that Git is installed and available.")]
GitNotFound,
#[error("Unexpected error: {0}")]
Other(String),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should make this #[error(transparent)] and pass the source unmodified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@charliermarsh charliermarsh merged commit ad34200 into astral-sh:main Nov 18, 2024
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git operation failed cannot find binary path for git dependencies while doing uv sync in dockerfile
2 participants