Creating my own symlink "lua" in ~/bin pointing to lua5.4 is nice, but I have lua v5.3 (from MacPorts) installed in addition to lua v5.4...I was hoping to move to lua v5.4, but it seems more complicated than it should be. Perhaps I'm trying to force things with my PATH to allow all kinds of things to have precedence, and so doing it becomes a complicated tug-of-war. I'm wondering now if I should just start a subshell for each distinct "environment" with a very simplified PATH setting for each subshell.
One for Lua v5.4, one for Ada, one for Raku, one for Perl, one for Java, etc...seems overkill and lots of complexity and overhead. Ada and Alire demand to be first in precedence, unless I'm not using them, etc... I'm too old for this :-) On Wed, Oct 22, 2025 at 3:31 PM raf via macports-users < [email protected]> wrote: > On Wed, Oct 22, 2025 at 04:43:47AM +0200, Nils Breunese < > [email protected]> wrote: > > > Your own symlinks shouldn’t affect MacPorts or get overwritten. > Definitely not when you keep them out of /opt/local (e.g. > /usr/local/bin/lua -> /opt/local/bin/lua5.4), but even under /opt/local/bin > they should stay untouched until you install a port which claims that path. > > > > A symlink wouldn’t be a piecemeal solution, under the hood the ‘port > select’ command would also just create a symlink (/opt/local/bin/lua -> > /opt/local/bin/lua5.4). > > > > As long as it’s just for your own user account, I think I’d personally > just create an alias in my shell configuration. > > A shell alias only applies to interactively typed commands. > A better idea is a script in ~/bin with ~/bin early in $PATH. > Then any the lua command is accessible from other scripts/programs. > > cheers, > raf > > > Nils. > > > > Kenneth Wolcott <[email protected]> wrote: > > > > > Thank you, Nils. I had already tried my own symlinks, but I realized > that when lua was updated I'd probably confuse MacPorts or it would get > overwritten. I guess a local alias would be a better workaround than using > the symlinks. Also, I was concerned that this would be a piecemail > solution, not all Lua functionality might be available by doing it this > way. Wrote up a MacPorts enhancement request. > > > > > > Thanks, > > > Ken Wolcott > > > > > > On Tue, Oct 21, 2025 at 5:37 PM Nils Breunese <[email protected]> > wrote: > > > Kenneth Wolcott <[email protected]> wrote: > > > > > > > This fails: > > > > sudo port select --set lua lua5.4 > > > > > > > > I have lua54 installed. > > > > > > > > /opt/local/bin/lua5.4 exists, /opt/local/bin/lua does not. > > > > > > > > I'm confused. > > > > > > You can run ‘port select --summary’ to show a list of all selection > groups that available for the ports that are currently installed on your > system. As far as I can see the lua* ports currently don’t provide a > selection group for the ‘port select’ command, so the command you ran is > expected to fail. > > > > > > If you want to run ‘lua5.4' by calling ‘lua’, you can manage your own > alias (set ‘alias lua=lua5.4’ in your shell configuration), create a > symlink somewhere in your $PATH, or support for ‘port select’ will need to > be added to the lua* ports (consider creating a feature request ticket in > Trac). > > > > > > Nils. >
