amaxwell / tlutility

TeX Live Utility, a Mac OS GUI for the TeX Live Manager
http://amaxwell.github.io/tlutility/
BSD 3-Clause "New" or "Revised" License
306 stars 17 forks source link

First PATH element clobbered #128

Closed jpcirrus closed 2 years ago

jpcirrus commented 2 years ago

With TLU Version 1.53 (1.53) on a M1 Mac running macOS 12.2.1 whereas in the past (not sure how long ago) TLU prepended /Library/TeX/texbin to the PATH variable now the the first PATH element is clobbered by /Library/TeX/texbin.

amaxwell commented 2 years ago

TLU has prepended the path element set in its preferences for at least the last decade, and that code hasn't changed in years. I need a description of exactly what you see versus what you expect to see, preferably with log output or error messages.

jpcirrus commented 2 years ago

My PATH as reported by the shell:

$ echo $PATH
/usr/local/bin:/opt/homebrew/bin:/Library/TeX/texbin:/Library/Developer/CommandLineTools/usr/bin:/usr/bin:/bin:/usr/local/sbin:/opt/homebrew/sbin:/usr/sbin:/sbin

but the TLU log has an entry:

2022-04-10 09:07:38 +0000 Notice +[TLMEnvironment updatePathEnvironment][1727]  Using PATH = "(
    "/Library/TeX/texbin",
    "/opt/homebrew/bin",
    "/Library/TeX/texbin",
    "/Library/Developer/CommandLineTools/usr/bin",
    "/usr/bin",
    "/bin",
    "/usr/local/sbin",
    "/opt/homebrew/sbin",
    "/usr/sbin",
    "/sbin"
)"

/Library/TeX/texbin has not been prepended to PATH, it has clobbered the first element, in this case /usr/local/bin.

amaxwell commented 2 years ago

As I said, this code has not changed in years, and in this case I can point to November 2014:

    /*
     17 Nov 2014: user ended up with /usr/local/bin prepended to his PATH somehow,
     and also had an ancient and/or broken Python version in /usr/local/bin. Since
     we shouldn't need /usr/local/bin in the PATH, let's just remove it.
     */
    [systemPaths removeObject:@"/usr/local/bin"];

    // prepend TL to PATH in case of macports or fink TL
    [systemPaths insertObject:[[NSUserDefaults standardUserDefaults] objectForKey:TLMTexBinPathPreferenceKey] atIndex:0];

I could probably allow /usr/local/bin in the path now, since Python is no longer a concern, but I still don't understand what problem you think this is causing for TeX Live Utility.

jpcirrus commented 2 years ago

On examining the log I was surprised to see the first element in the PATH had been clobbered and only raised the issue because I thought it might have been an unintentional error. Thank you for the explanation.