symlink problems with mac os

Per Bothner per@bothner.com
Sun Oct 22 17:40:00 GMT 2017


On 10/22/2017 06:04 AM, Björn Raupach wrote:

> There is a Homebrew port fof Kawa which avoids the problem by patching
> bin/kawa before installing it:
> 
> https://github.com/Homebrew/homebrew-core/blob/master/Formula/kawa.rb
> 
> Agreed. I would do a patch like this in MacPorts, too. Was just raising awareness of this minor issue if it was unnoticed before.

I've been vaguely aware of it.

> The reason for the readlink to handle the case that you install kawa
> as a symlink for example /usr/local/bin/kawa -> /opt/kawa-3.0/bin/kawa .
> I think that is useful to support - and it doesn't work without the -f.

On second though that use-case can be handled just as well with creating
an executable file /usr/local/bin/kawa containing:

exec /opt/kawa-3.0/bin/kawa "$@"

However, when doing a source build, and then executing from the build
directory (as the test-suite does) still has to traverse a symlink,
as configure creates a symlink from kawa.sh to kawa.sh.in.

> The maven snippet above handles that case. I can link a link and still get maven to run. Would make it portable and doesn’t need any dependency.

It would slow start up a little bit.

> Looking for patches? I have time to look at that and now I am curious enough to try and solve this. ;)

I think I want to leave kawa.sh.in as-is, but have configure
create kawa instead of kawa.sh.  That way we don't need a symlink in the normal case.
I'm trying this out now.

-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list