[Mono-list] which confused about which mono
Edward Ned Harvey (mono)
edward.harvey.mono at clevertrove.com
Sun May 3 12:14:23 UTC 2015
> From: mono-list-bounces at lists.ximian.com [mailto:mono-list-
> bounces at lists.ximian.com] On Behalf Of Martin Thwaites
>
> do you have a mono version in ~/tmp/mono? if so it will use that first, but i
> don;t think which takes into account your current directory.
I am also somewhat perplexed by the question - because "which" is supposed to follow your PATH environment variable exactly like your shell does. So if you have "." on your PATH, then "which" and bash would both use it. Otherwise, they would both not use it.
The only difference between calling mono, and calling /usr/bin/mono, is the fact that you specified /usr/bin. And this difference is detectable by the mono runtime. Evidently, as surprising as it is, it seems something in the mono runtime is actually using that, and behaving differently as a result.
Matt, just for the heck of it, try this:
ls -ld /usr /usr/bin /usr/bin/mono
drwxr-xr-x 10 root root 4096 Oct 24 2013 /usr
drwxr-xr-x 2 root root 36864 Apr 9 15:27 /usr/bin
lrwxrwxrwx 1 root root 9 Apr 25 2014 /usr/bin/mono -> mono-sgen
"mono" is normally a symlink pointing to mono-sgen. In fact, guess what? Some other symlinks may also point to mono-sgen, and the way mono-sgen figures out what it's supposed to do, is by looking at the name by which it was called. So it makes perfect sense that it will behave differently depending on how it's called... But I cannot explain the 3.2.7 vs 4.1.0 thing right now.
I suspect, something along the lines of ... mono-sgen thinks to itself, "If I was called 'mono' then search for libraries on [some set] of directories. But if I was called '/usr/bin/mono' then search for libraries on [some other set] of directories."
You'll probably have the best luck asking in the mono-devel list.
Also, try repeating your test, when your PWD is some other directory. For example cd to your home directory, or cd /usr/bin, and see if the behavior changes.
More information about the Mono-list
mailing list