mxcl/homebrew — Issue #8850: When linking fails due to permissions, print the failed path and continue
Author: Sharpie
Created: 2011-11-28 23:20:37+00:00
State: open
Labels: bugs

For example, in issue #8737 a user sees:

```
==> Finishing up
ln /usr/local/bin/pkg-config
ln /usr/local/share/man/man1/pkg-config.1
ln /usr/local/share/doc/pkg-config
ln: pkg.m4: Permission denied
Error: The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link pkg-config'
```

Homebrew is doing two things wrong here:

- We stop trying to link components after the first failure, but still continue on with the installation. So, failing to link something semi-essential because `#{PREFIX}/share/aclocal` is not writable means we never continue on to try linking really important stuff like `#{PREFIX}/lib`. We should either continue on and try everything, or make link errors fatal to the entire install process.

- We tell the user about paths that successfully linked, `ln /usr/local/share/doc/pkg-config`, but not a peep about what paths failed to link: `ln: pkg.m4: Permission denied`. This means that users will try risky solutions such as running `sudo chown -R` on all of `/usr/local` instead of targeting `/usr/local/share/aclocal`---unless they happen to know that is where `.m4` files live.