Skip to content

Conversation

HashNuke
Copy link
Member

@HashNuke HashNuke commented Mar 16, 2025

This PR improves Erlang installation for Mac OS, by setting default options for Erlang installation by kerl.

This PR also fixes an issue with kerl by setting the --with-ssl option with the correct openssl brew prefix path. The default kerl behaviour is to look for openssl@3.0, but that is an invalid path. Should instead of looking for openssl@3.

Thanks to @ppicom for posting debugging notes on #319. Those notes helped with work on this PR.

Issues that this PR fixes

Changes

  • Run dependency checks and indicate packages to install for macos.
    • Add a note about having to build wxmac from source with homebrew for observer.
  • if unixodbc is installed:
    • Set/update CC with unixodbc include path
    • Set/update LDFLAGS with unixodbc include path
    • Set/update KERL_CONFIGURE_OPTIONS with the --with-odbc option
  • if openssl is installed, set/update KERL_CONFIGURE_OPTIONS with the --with-ssl
  • if ulimit is below 1k, then set it to 65536 for current terminal session.
  • if openjdk is installed, then add it to PATH for current terminal session.
  • Add some logging to provide feedback to the user during the installation process. Helps to be transparent about env vars
  • Checks for kerl build and installation before cleaning it up. The kerl error message about build and installation does not appear anymore during erlang installation.

Screenshot: Successful installation with new log messages

image

Screenshot: Observer working as expected (wxmac dependency)

image

Screenshot: Warning message if an optional package is missing

This screenshot was taken during development when I had a package missing on my computer. So the log messages may old different compared to the newer screenshots above.

image

Screenshot: Old behaviour/output for erlang installation

This screenshot is a reference. This depicts the old behaviour when Erlang installation fails due to missing packages and the user has no clue why it fails (This is the openssl path detection issue with kerl that is mentioned in the beginning of this PR).

image

* Run dependency checks and indicate packages to install for macos.
  * Add a note about having to build wxmac from source with homebrew for observer.
* if unixodbc is installed:
  * Set/update CC with unixodbc include path
  * Set/update LDFLAGS with unixodbc include path
  * Set/update KERL_CONFIGURE_OPTIONS with the --with-odbc option
* if openssl is installed, set/update KERL_CONFIGURE_OPTIONS with the --with-ssl option.
* if ulimit is below 1k, then set it to 65536 for current terminal session.
* if openjdk is installed, then add it to $PATH for current terminal session.
* Add some logging to provide feedback to the user during the installation process.
  Helps to be transparent about env vars
@HashNuke HashNuke self-assigned this Mar 16, 2025
@HashNuke
Copy link
Member Author

Merging this PR since installation on MacOS is broken

Fixed the linter warnings. Tested again by uninstalling and installing Erlang 27.3 in a new terminal window (screenshot below).

CleanShot 2025-03-16 at 20 08 47@2x

@Stratus3D
Copy link
Member

Thanks for the PR @HashNuke ! I think this is a nice improvement. I left one comment about something that seemed off. Otherwise this looks good to me 👍

@HashNuke HashNuke deleted the fix-mac-install branch March 17, 2025 15:24
@HashNuke
Copy link
Member Author

@Stratus3D Thanks for catching that! Just updated the msg on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment