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

chore: update macOS environment-variable shell script #12878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jahorton
Copy link
Contributor

I ran into a couple of issues when getting my Mac development laptop set up to build our Android app, some of them related to this script. One distinctly noticeable item: we use OpenJDK 11, not Java 8... yet the variables in the script still reference the latter!

Reference (current master):

keyman/docs/build/macos.md

Lines 156 to 161 in f268d04

## Keyman for Android Dependencies
* openjdk 11, Android SDK, Android Studio, Ant, Gradle, Maven
```shell
brew install openjdk@11 android-sdk android-studio ant gradle maven

@keymanapp-test-bot skip

@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S19 milestone Jan 13, 2025
export PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH"
export JAVA_HOME=/usr/local/opt/openjdk@8
export JAVA_HOME=/opt/homebrew/opt/java11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential caveat: if I'm not mistaken, this path for things installed via Homebrew may be Apple Silicon specific. Granted, Mac in general is headed that way, so maybe it's not a bad thing to do this, anyway.

Might be worth a spot of discussion if I'm right about the distinction, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, for Intel Macs, Homebrew was in /usr/local/opt, and it uses /opt/homebrew/opt for Apple Silicon. I still use an Intel machine for my dev machine, but we should be on all Apple Silicon before too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we feel it important, I can probably make this adaptive: https://stackoverflow.com/a/65259353

It is technically possible to detect i386 vs arm in bash shell. Seems to hold in zsh too. That said, if a process in the chain is being run via Rosetta, that will cause an i386 report, according to some of the comments elsewhere in that StackOverflow thread. May need to take care.

@jahorton jahorton requested a review from sgschantz January 13, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants