Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] macOS build/install instructions should be updated #4006

Closed
curldivergence opened this issue Aug 2, 2024 · 2 comments
Closed

[docs] macOS build/install instructions should be updated #4006

curldivergence opened this issue Aug 2, 2024 · 2 comments
Labels
documentation-change Change to Written Documentation

Comments

@curldivergence
Copy link

Hi, I've decided to try Odin on macOS (Sonoma 14.5, aarch64), and noticed several issues with the "Getting Started" section related to this platform:

  1. run echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc_profile works only for Intel-based Macs, on ARM-based ones Homebrew does not install packages into /usr/local but rather into /opt/homebrew/ (symlink to LLVM bin directory on my machine is located at /opt/homebrew/opt/llvm/bin/)
  2. I think there is an error in the name of the file to which the export command should be appended: I suppose that either ~/.zshrc or ~/.zsh_profile was meant (however even though I use zsh as my main interactive shell, the latter file is absent on my system)
  3. "Requirements" section tells to install LLVM 14, but since I already had LLVM 18 installed via brew, I decided to give it a shot and it seemingly worked (also, instruction for Linux mentions a range of versions from 11 to 18)
  4. The command mentioned in (1) assumes using zsh as a shell, but the very next instruction item also mentions bash, in which case (1) would not have effect
  5. The most important problem: the advice to permanently add the brew-installed LLVM's bin directory to $PATH can be dangerous (this is also mentioned in brew info llvm, btw), since
  • it contains binaries which already exist in user's $PATH, most importantly, clang
  • even if we assume no user actually needs Apple's clang in their $PATH and we can just tell them to overwrite it, this is not what actually happens since the build instructions tell to append LLVM's /bin/ to $PATH (i.e. not prepend), so after doing that which clang would still return /usr/bin/clang, resulting in a mixture of different toolchain versions on $PATH, which can lead to interesting problems :)
  1. I was building on the latest macOS version, but did not need to run this bit: On newer versions of macOS, some headers are not installed by default, so maybe it should be removed or the specific versions should be stated?

Please let me know if you need any more info from my system or if I can help in any way.
Thanks!

@laytan laytan added the documentation-change Change to Written Documentation label Aug 11, 2024
@gingerBill
Copy link
Member

Please make an issue here please: https://github.com/odin-lang/odin-lang.org

You can also make a PR if you want to improvement to the documentation directly.

@laytan
Copy link
Sponsor Collaborator

laytan commented Aug 28, 2024

We have rewritten the install documentation and I think all these points were addressed, thanks for bringing them up!

@laytan laytan closed this as completed Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-change Change to Written Documentation
Projects
None yet
Development

No branches or pull requests

3 participants