fix: avoid resolving symlinks in shim PMG binary path (#303)

* fix: avoid resolving symlinks in shim PMG binary path

Shims hardcoded the resolved Cellar path (e.g.
/opt/homebrew/Cellar/pmg/0.16.0/bin/pmg) instead of the stable
Homebrew symlink. This broke all shims after `brew upgrade` since
the old Cellar directory is removed.

Fixes #302

* fix pip test pkg version
This commit is contained in:
Sahil Bansal
2026-05-27 16:00:43 +05:30
committed by GitHub
parent 37958f4441
commit 19b9f2ca1f
2 changed files with 3 additions and 8 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ func ProtectionTestCases() []ProtectionTestCase {
},
{
PackageManager: "pip",
Package: "safedep-test-pkg==0.1.4",
InstallArgs: []string{"pip", "install", "--no-cache-dir", "safedep-test-pkg==0.1.4"},
Package: "safedep-test-pkg==0.0.4",
InstallArgs: []string{"pip", "install", "--no-cache-dir", "safedep-test-pkg==0.0.4"},
NeedsVenv: true,
},
}
+1 -6
View File
@@ -136,12 +136,7 @@ func currentExecutable() (string, error) {
return "", fmt.Errorf("failed to resolve pmg executable: %w", err)
}
resolved, err := filepath.EvalSymlinks(exe)
if err != nil {
return filepath.Abs(exe)
}
return resolved, nil
return filepath.Abs(exe)
}
func shellQuote(value string) string {