Skip to content

A refused binary import leaves its stub directory in the temp dir #3485

Closed

Description

@nicolas-maman

ae build (and ae run) of a program with a binary import writes the import stubs to $TMPDIR/ae-binimport-<pid>-<n> (tools/ae.c, around ae-binimport-%d-%d). When the import is refused, for example by ae_refuse_split_ownership or ae_lib_check_compat, the refusal calls exit(1) and the directory stays behind.

To see it on Windows: build a static-runtime library whose export passes a struct holding a string, import it from a program, and run ae build. The build is refused, as it should be, and %TEMP%\ae-binimport-<pid>-0 is left with the stub in it. Every refused build leaves one more.

Expected: a refused import removes its stub directory, as a build that succeeds does.

Found while reviewing #3477; not part of it.

Activity

  1. nicolas-maman commented on Oct 30, 2026

    @nicolas-maman
    CollaboratorAuthor

    Scale on one Windows dev machine: 1,168 ae-binimport-<pid>-0 folders under C:\msys64\tmp (MSYS2's /tmp), dating back to 2026-10-06. Today's came from tests whose imports are refused by design: abi_policy (fake.ae), binary_import_ownership (rec.ae, frees.ae), binary_import_structs (engine.ae), abi_matrix (mlib.ae). So every local run of those tests adds a few, and CI runners do too.

  2. added 2 commits that reference this issue on Nov 2, 2026
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions