Skip to content

Proposal: configurable staging dir (macos $TMPDIR volatility) #146

Description

@MikkoParkkola

Context: follow-up on PR #144 (closed — thanks for the clear review @alessandrogario).

On macOS hosts with TCC/sandbox restrictions, $TMPDIR points under /var/folders/... which is per-user and can be purged by the OS mid-run if the session leader changes or the process is backgrounded. This caused intermittent failures in my environment where mquire staged packages under that tree and later couldn't read them back.

Proposal for discussion (not a PR):

  1. Allow --staging-dir <path> CLI flag override.
  2. Default precedence:
    • MQUIRE_STAGING_DIR env var if set
    • $XDG_CACHE_HOME/mquire/staging on Linux
    • ~/Library/Caches/mquire/staging on macOS
    • fallback to $TMPDIR only when neither writable
  3. Preserve existing $TMPDIR behavior on platforms where the new defaults don't apply, so no behavioral change for current users.

Open questions for maintainers:

  • Is the macOS $TMPDIR volatility reproducible in trailofbits' own CI/dev environments? If not, scope could be narrower (flag-only, no default change).
  • Preferred env var name? Happy to follow project conventions.
  • Scope — is mquire stage the only consumer of temp dirs, or are there others to unify?

Happy to draft a PR against whatever plan you endorse — no changes to defaults without your sign-off.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions