Coder Social home page Coder Social logo

mac-setup's People

Contributors

chosak avatar cwdavies avatar jduquette avatar marcesher avatar scotchester avatar willbarton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mac-setup's Issues

PATH isn't set as expected

The Homebrew and Python setup scripts try to put their own bin directories ahead of the system ones, so that for example python invokes Pyenv. But this doesn't work right, and these directories end up after the system ones.

Expected behavior

The homebrew_setup.sh adds this line to .zshenv:

export PATH=/Users/me/homebrew/bin:${PATH}

and then python_setup.sh adds this line to .zshenv:

eval export PATH="/Users/me/.pyenv/shims:${PATH}"

The idea being that after .zshenv runs, PATH should be something like:

/Users/me/.nvm/versions/node/v16.13.0/bin:/Users/me/.pyenv/shims:/bin:/Users/me/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Current behavior

In practice, though, when Zsh starts up it first sources our .zshenv but then sources /etc/profile, which on Big Sur contains this line:

if [ -x /usr/libexec/path_helper ]; then
	eval `/usr/libexec/path_helper -s`
fi

which has the effect of moving the system paths back to the front:

% export PATH=/Users/me/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
% echo $PATH
/something:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
% eval `/usr/libexec/path_helper -s`
% echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/me/.pyenv/shims

This means that e.g. running python chooses the wrong thing:

% which python
/usr/bin/python

(related SO question)

Proposed fix

I think perhaps we should move our path manipulation to .zshrc, instead of .zshenv, to avoid this rewriting. @willbarton or others who are more familiar with Zsh: would this have any negative side effects?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.