Skip to content

[ feature ] Automating Mid-Install Temporary Directory Cleanup#301

Open
Matthew-Mosior wants to merge 5 commits intostefan-hoeck:mainfrom
Matthew-Mosior:temporary-directories-not-cleaned
Open

[ feature ] Automating Mid-Install Temporary Directory Cleanup#301
Matthew-Mosior wants to merge 5 commits intostefan-hoeck:mainfrom
Matthew-Mosior:temporary-directories-not-cleaned

Conversation

@Matthew-Mosior
Copy link
Copy Markdown
Contributor

@Matthew-Mosior Matthew-Mosior commented Aug 16, 2024

This PR enables the removal of temporary directories that used to linger after a mid-install Ctrl+C.

To accomplish this, the idris2-async library is utilized to race two threads within the withTmpDir function:

  1. SigINT listener thread.
  2. Runner via finally thread.

This PR closes #288.

@Matthew-Mosior Matthew-Mosior marked this pull request as ready for review August 16, 2024 03:38
@Matthew-Mosior Matthew-Mosior changed the title [ feature] Automating Mid-Install Temporary Directory Cleanup [ feature ] Automating Mid-Install Temporary Directory Cleanup Aug 16, 2024
Comment thread src/Pack/Runner.idr Outdated
@stefan-hoeck
Copy link
Copy Markdown
Owner

Thank you for taking the initiative here. I'll be happy to look into this once async becomes more stable. Right now, I'm still experimenting with different threadpool / runner implementations, and it is not yet clear how signal handling will work out.

On Linux, I'm planning to use epoll for timers, signal handlers, and asynchronous IO, but epoll only exists on Linux. For other Unix systems, there is kqueue but I have no experience with that.

tl,dr: It is too early to make async a dependency of a central tool such as pack. I'm currently spending a lot of my free time with async, but it is definitely a non-trivial library.

@Matthew-Mosior
Copy link
Copy Markdown
Contributor Author

Matthew-Mosior commented Aug 16, 2024

@stefan-hoeck Not a problem, excited to help out in this direction!

Looking forward to seeing where async goes, it looks really solid already. Will be excited to hop back on this when the time is right (idris2-async is in a more stable place).

@buzden buzden added enhancement New feature or request blocked Solution is blocked by something external labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Solution is blocked by something external enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporary directories not cleaned

3 participants