Skip to content

Consider adding Homebrew to the list of incompatible programs #1902

@DePingus

Description

@DePingus

What new feature should Elvish have?

Hi. I installed elvish using brew and set it as my default shell...which broke brew. That's because eval '/home/linuxbrew/.linuxbrew/bin/brew shellenv' doesn't work in elvish. It looks like brew shellenv is trying to set the paths by running these commands:

export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew";
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar";
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew";
export PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin${PATH+:$PATH}";
[ -z "${MANPATH-}" ] || export MANPATH=":${MANPATH#:}";
export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}";

I've converted that to elvish (except for that MANPATH line, I don't know what that does) and added it to my rc.elv file. Now brew is working again. Here is what I have:

set E:HOMEBREW_PREFIX = '/home/linuxbrew/.linuxbrew'
set E:HOMEBREW_CELLAR = '/home/linuxbrew/.linuxbrew/Cellar'
set E:HOMEBREW_REPOSITORY = '/home/linuxbrew/.linuxbrew/Homebrew'
set E:PATH = '/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:'$E:PATH
#if (has-env MANPATH) { set E:MANPATH = ':$E:MANPATH#:' } #What is this?
if (has-env INFOPATH) {
    set E:INFOPATH = '/home/linuxbrew/.linuxbrew/share/info:'$E:INFOPATH
} else {
    set E:INFOPATH = '/home/linuxbrew/.linuxbrew/share/info'
}

It might be a good idea add this info to the list of incompatible programs at https://elv.sh/get/default-shell.html and then link there from the Homebrew installation section on https://elv.sh/get/package-manager.html#macos .

Output of "elvish -version"

0.21.0

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ❓Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions