-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Child exit with signal n returns 128+n #10781
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
Conversation
Removes some code duplication
Following https://tldp.org/LDP/abs/html/exitcodes.html, a fatal signal n gets the exit code 128+n (unix only). Fixes #10751
Tagging in @Gankra, I've never seen this before. |
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 yep this looks familiar
let pid = child.id().context("Failed to get child process ID")?; | ||
signal::kill(Pid::from_raw(pid.try_into()?), Signal::SIGTERM).context("Failed to send SIGTERM") |
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.
oh hey this is exactly the platform-specific code that I was surprised to see when looking at #9652, still not sure why we don't do an equivalent thing 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.
I'm not familiar with how signals work on windows, what do we need to do for 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.
I suppose it's more of a question of: why do we need to explicitly kill the script? Won't killing our own process "normally" in response to CTRL+C achieve the desired effect since it's a child process?
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 the context you're looking for in
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.
Wow yep it sure does, thanks!
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.5.24` -> `0.5.25` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.5.25`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0525) [Compare Source](astral-sh/uv@0.5.24...0.5.25) ##### Enhancements - Allow installation of manylinux wheels on loongarch64 ([#​10927](astral-sh/uv#10927)) - Allow optional `=` for editables in `requirements.txt` ([#​10954](astral-sh/uv#10954)) - Add Windows aarch64 to the release binaries ([#​10885](astral-sh/uv#10885)) ##### Bug fixes - Use spec-compliant (`128+n`) exit codes for `uv run` and `uv tool run` on Unix ([#​10781](astral-sh/uv#10781)) - Fix best-interpreter lookups when there is an invalid interpreter in the `PATH` ([#​11030](astral-sh/uv#11030)) - Guard against concurrent cache writes on Windows ([#​11007](astral-sh/uv#11007)) - Prioritize package preferences with greater package versions ([#​10963](astral-sh/uv#10963)) - Reject `--editable` flag on non-directory requirements ([#​10994](astral-sh/uv#10994)) - Respect `--no-sources` for `uv pip install` workspace discovery ([#​11003](astral-sh/uv#11003)) - Set `JEMALLOC_SYS_WITH_LG_PAGE=16` in ARM Docker builds ([#​10943](astral-sh/uv#10943)) - Update `riscv64` Python downloads to allow install on `riscv64gc` ([#​10937](astral-sh/uv#10937)) - Fix file persist retries on Windows ([#​11008](astral-sh/uv#11008)) - Fix incorrect error message when specifying `tool.uv.sources.(package).workspace` with other options ([#​11013](astral-sh/uv#11013)) - Improve SIGINT handling in `uv run` ([#​11009](astral-sh/uv#11009)) ##### Documentation - Add `SECURITY` policy ([#​11035](astral-sh/uv#11035)) - Add `Requires-Python` upper bound behavior to the docs ([#​10964](astral-sh/uv#10964)) - Add a troubleshooting section and reproducible example guide ([#​10947](astral-sh/uv#10947)) - Add documentation for `uv add -r` ([#​10926](astral-sh/uv#10926)) - Amend `requires-python` rules in resolver documentation ([#​10993](astral-sh/uv#10993)) - Reference workspaces in `--no-sources` documentation ([#​10995](astral-sh/uv#10995)) - Update documentation for activating virtual environments in different shell ([#​11000](astral-sh/uv#11000)) - Add Docker SHA pinning tip ([#​10955](astral-sh/uv#10955)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzcuMiIsInVwZGF0ZWRJblZlciI6IjM5LjEzNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Following https://tldp.org/LDP/abs/html/exitcodes.html, a fatal signal n gets the exit code 128+n (unix only).
Fixes #10751
First commit is only deduplicating code without features changes, the second commit is the actual fix.