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

make cargo lock updater keep outpath links in temporary directory #229

Conversation

lilyinstarlight
Copy link
Contributor

This fixes running nix-update on cargo lock packages leaving result links laying around

@@ -163,10 +163,14 @@ def update_cargo_deps_hash(opts: Options, filename: str, current_hash: str) -> N
def update_cargo_lock(
opts: Options, filename: str, dst: CargoLockInSource | CargoLockInStore
) -> None:
tempdir = tempfile.TemporaryDirectory()
Copy link
Owner

Choose a reason for hiding this comment

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

In the event of a build failure this would not cleanup tempdir unless with tempdir: is used. So we need to --no-out-link to nix build to skip the symlink all together or add a large with statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered both options and --no-out-link made me worry about GC races, but I am fine to add the with statement (it was a bigger diff and it was already leaving them everywhere, so I didn't initially do that)

I'll push the with tempfile.TemporaryDirectory() as tempfile: version sometime in the next hour or two

Thank you!

@lilyinstarlight lilyinstarlight force-pushed the fix/cargo-lock-leaving-result-links-everywhere branch from 97b7ebc to f80ee70 Compare March 6, 2024 12:04
@lilyinstarlight lilyinstarlight requested a review from Mic92 March 6, 2024 12:09
@Mic92 Mic92 merged commit a42ae67 into Mic92:master Mar 11, 2024
3 checks passed
@lilyinstarlight lilyinstarlight deleted the fix/cargo-lock-leaving-result-links-everywhere branch March 11, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants