Skip to content
New issue

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

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

Already on GitHub? # to your account

cask/audit: Rework tmpdir removal #17377

Merged

Conversation

samford
Copy link
Member

@samford samford commented May 27, 2024

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

I previously introduced a finalizer method in Cask::Audit to remove the created @tmpdir once it's no longer needed (#17358) but the existing approach produces a finalizer references object to be finalized warning when brew audit is run. I didn't see this warning when I was originally testing it but now it reliably appears.

This reworks the finalizer to define it within the #extract_artifacts method and use @tmpdir as the target object.

Fixes #17374.

I previously introduced a finalizer method in `Cask::Audit` to remove
the created `@tmpdir` once it's no longer needed but the existing
approach produces a `finalizer references object to be finalized`
warning when `brew audit` is run. I didn't see this warning when I
was originally testing it but now it reliably appears.

This reworks the finalizer to define it within the
`#extract_artifacts` method and use `@tmpdir` as the target object.
@MikeMcQuaid MikeMcQuaid merged commit 92adf6a into Homebrew:master May 27, 2024
25 checks passed
@MikeMcQuaid
Copy link
Member

Thanks for fix @samford. Would appreciate work on a better solution here that avoids the (very non-idiomatic) finaliser use.

@samford samford deleted the cask-audit-rework-tmpdir-removal branch May 27, 2024 21:23
@github-actions github-actions bot added the outdated PR was locked due to age label Jun 27, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

warning: finalizer references object to be finalized on every brew audit --cask
2 participants