PragTob

PragTob

Erlang brew package has the JIT disabled - should it be enabled by default?

:wave:

Hey folks!

So, this may be me not knowing how to interact with brew maintainers or Mac.

It seems like current versions of erlang on brew do not have the JIT enabled, despite being 26.2.2.

How do I know? Well, there is a benchee test that’s failing :sweat: And emu_flavor is returning :emu instead of :jit:

https://github.com/bencheeorg/benchee/actions/runs/8049202423/job/22126255043?pr=426#step:9:11

"26.2.2"
emu flavor: :emu

It used to work but seems to have broken in the past weeks. I can’t find anything suspicious in the brew formula. Other OSs also work fine, naturally.

I checked that this isn’t just a github action/CI behavior by running brew install erlang on my partners’ mac (still an intel mac) and it also reported the emu flavor.

Does anyone have an idea where to dig/report/fix this behavior or why it is like that? I don’t think it’s on purpose, the default experience should be the “JIT” experience by now.

I’m asking for the erlang experience on Mac, I’m going ahead and disabling the test on mac now :sweat_smile:

Marked As Solved

LostKobrakai

LostKobrakai

That’s expected as of 26.2.2, which disabled the jit on intel based macs: asmjit+macos+x86: ephemeral "Verifying shm-id-XXXXXXXXXXXXXXXX" security popups appear during each invocation of erlang · Issue #8043 · erlang/otp · GitHub

Also Liked

dimitarvp

dimitarvp

This is related to the super annoying small popup you get on Intel Macs when JIT is enabled.

Check this thread for context: Popup appears for a fraction of a second whenever a mix task is run (verifying shm-id-F8BD8E...)

Disabling the JIT is a workaround to avoid the popup. A proper fix will come in OTP 27 which is I think due in May 2024.

PragTob

PragTob

@LostKobrakai @dimitarvp thank you as always! I read the changelog to identify that this isn’t wanted behavior but couldn’t find anything but maybe I was too tired :sweat_smile:

So, thanks a lot for solving this mystery for me :dancer:

xinz

xinz

FYI, in OTP 27 can Allow explicit enabling the JIT on Intel Macs by bjorng · Pull Request #8219 · erlang/otp · GitHub, here are my steps to enable JIT for my macOS/intel case.

Step 1

brew uninstall --ignore-dependencies erlang

Step 2

brew edit erlang

Add --enable-jit option to configure

    args = %W[
      --enable-dynamic-ssl-lib
      --enable-jit
      --enable-hipe
      --enable-shared-zlib
      --enable-smp-support
      --enable-threads
      --enable-wx
      --with-odbc=#{Formula["unixodbc"].opt_prefix}
      --with-ssl=#{Formula["openssl@3"].opt_prefix}
      --without-javac
    ]

Step 3

export HOMEBREW_NO_INSTALL_FROM_API=1
brew install erlang --build-from-source

brew install ignores locally edited casks and formulae if
HOMEBREW_NO_INSTALL_FROM_API is not set, so we temporarily export the env argument, reinstall erlang via brew installer and my local erlang formulae file occurred conflict with the above edited "--enable-jit", resolve the conflict by rerun brew edit erlang and save it.

The above steps enable JIT for my case macOS Sonama(intel) with Erlang/OTP 27.2.1

➜  ~ erl -eval 'io:format("~p~n", [erlang:system_info(emu_flavor)]), halt().'
Erlang/OTP 27 [erts-15.2.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns] [dtrace]

jit

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39467 209
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36352 110
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement