Skip to content

Commit

Permalink
fix: set install_name to absolute path for libpact_ffi.dylib (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-is-hate committed Oct 2, 2023
1 parent dd2c5c1 commit 5cef32c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions installer/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (i *Installer) installDependencies() error {
return err
}

err = setOSXInstallName(dst, info.libName)
err = setOSXInstallName(dst)

if err != nil {
return err
Expand Down Expand Up @@ -289,8 +289,9 @@ func (i *Installer) updateConfiguration(dst string, pkg string, info packageInfo
return i.config.writeConfig(c)
}

var setOSXInstallName = func(file string, lib string) error {
cmd := exec.Command("install_name_tool", "-id", fmt.Sprintf("%s.dylib", lib), file)
var setOSXInstallName = func(file string) error {
cmd := exec.Command("install_name_tool", "-id", file, file)
log.Println("[DEBUG] running command:", cmd)
stdoutStderr, err := cmd.CombinedOutput()

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion installer/installer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (m *mockConfiguration) writeConfig(pactConfig) error {

func restoreOSXInstallName() func() {
old := setOSXInstallName
setOSXInstallName = func(string, string) error {
setOSXInstallName = func(string) error {
return nil
}

Expand Down

0 comments on commit 5cef32c

Please sign in to comment.