-
Notifications
You must be signed in to change notification settings - Fork 14
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
Set tool(-bin) dir and add to PATH #87
Conversation
ac31257
to
e35ed48
Compare
e35ed48
to
561bff6
Compare
@charliermarsh I still get the warning described in #60 as can be seen here: https://github.com/astral-sh/setup-uv/actions/runs/10925849201/job/30328341490?pr=87#step:4:10 Could the reason be that |
Okay even when |
The reason was that |
dd940eb
to
3f421bc
Compare
Make sure the default tool bin dir or the user supplied is added to the PATH. On Windows the tool dir and tool bin dir is moved to the TMP dir to take advantage of the fact that on GitHub hosted Windows runners this is on the faster D: drive
3f421bc
to
e712968
Compare
- name: Install the latest version of uv with a custom tool dir | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
tool-dir: "/path/to/tool/dir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not just be done via env:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user would have to add this to every step using uv then. That's why I decided against it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, smart
### UV_TOOL_DIR | ||
|
||
On Windows `UV_TOOL_DIR` is set to `uv-tool-dir` in the `TMP` dir (e.g. `D:\a\_temp\uv-tool-dir`). | ||
On GitHub hosted runners this is on the much faster `D:` drive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the cache is also on the D:
drive, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It's also in the TMP dir so D:\a\_temp\
on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added documentation for the default value of UV_CACHE_DIR
src/utils/inputs.ts
Outdated
return toolBinDirInput; | ||
} | ||
if (process.platform === "win32") { | ||
return "D:\\a\\_temp\\uv-tool-bin-dir"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs said it's on D:
on GitHub-hosted runners. But isn't this setting it on all runners? Is that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I should rather implement it like the cache, look for RUNNER_TEMP
first and only use a static value as fallback.
On second thought maybe even fail if RUNNER_TEMP
is not set. The static fallback path (and drive) might not even exist and then fail with hard to understand error messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to throw if RUNNER_TEMP is not set.
return `${process.env.RUNNER_TEMP}${path.sep}uv-tool-bin-dir`; | ||
} | ||
throw Error( | ||
"Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it that RUNNER_TEMP
is always defined on GitHub runners?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So tests show that it is and I could not find contrary information
Fixes: #83
Fixes: #60