Skip to content

Handle multicall binaries#100

Merged
ilmanzo merged 2 commits intomainfrom
handle_multicall_binaries
Jan 12, 2026
Merged

Handle multicall binaries#100
ilmanzo merged 2 commits intomainfrom
handle_multicall_binaries

Conversation

@ilmanzo
Copy link
Owner

@ilmanzo ilmanzo commented Jan 12, 2026

To fix funkoverage so it handles multicall binaries (like run0, busybox, or git) automatically, we need to modify how the tool backs up the original binary and constructs the ORIGINAL_BINARY path in the wrapper.

The goal is to ensure that inside the backup directory, we preserve the filename that the user originally invoked.

The Logic Patch
Currently, the tool resolves the symlink (run0 → systemd-run), moves the real binary (systemd-run) to the backup folder, and points the wrapper at that real binary.

The Fix: If the input file is a symlink, we must create a corresponding symlink in the backup directory and point the wrapper at that backup symlink.

Step-by-Step Implementation

  • Check if Target is a Symlink: Before wrapping, check os.Lstat.

  • Resolve & Backup Real Binary: If it is a symlink, resolve it to find the actual executable. Copy/move that executable to your backup folder (e.g., as systemd-run).

  • Recreate Symlink in Backup: Create a symlink in the backup folder that matches the original filename (e.g., run0 -> systemd-run).

  • Point Wrapper to Backup Symlink: Generate the shell script setting ORIGINAL_BINARY to the path of the backup symlink, not the real binary.

@ilmanzo ilmanzo merged commit 1ea7b19 into main Jan 12, 2026
2 checks passed
@ilmanzo ilmanzo deleted the handle_multicall_binaries branch January 12, 2026 15:34
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.

1 participant