Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix
funkoverageso 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.