hexpm / bob

The Builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

long-shot feature request: elixir OTP 25 builds with JIT disabled

sbe-arg opened this issue · comments

something on the line of:

  • 1.14.2-erlang-24.3.4.9-debian-bullseye-20230202-slim-nojit
  • x.x.x-erlang-25.x.x-distro-something-somethingelse-nojit

What's the use case for this?

Been running dockerfiles with

ENV ERL_COMPILER_OPTIONS="[{d,'JIT_INFO',false}]"

to avoid segmentation faults in arm64 builds but would be ideal to have it image specific instead of dockerfile tuned.

You can select a different emulator with -emu_flavor. https://www.erlang.org/doc/man/erl.html

Since there are options to disable the JIT I don't feel like separate images are needed since it would double the amount we have to build.

Makes sense, thanks for clarifying.

From aforementioned docs:

(The emulator with this flavor must be built. You can build a specific flavor by doing make FLAVOR=$FLAVOR in the Erlang/OTP source repository.)

are we building our images with make FLAVOR=? If not then -emu_flavour flag will only be useful with the default value, smp. If we aren't I think maybe we should, I'm not aware of downsides of doing so.

The downside is larger images. The beam flavor is slower and likely only to get slower with time, I would avoid it the most we can.

Sorry to post in a closed issue but what is the recommended way to disable JIT in the current hexpm images?

I've tried the following options:

  • ENV ERL_FLAGS="+JPperf true" doesn't disable JIT but the build works
  • ENV ERL_COMPILER_OPTIONS="[{d,'JIT_INFO',false}]" doesn't work
  • ENV ERL_FLAGS="-emu_flavor smp" doesn't work
  • ENV ELIXIR_ERL_OPTIONS="-emu_flavor smp" doesn't work

Reference build: ruslandoga/plausible#93

No, it is not possible. The VM is compiled with the JIT in.

I see. Thank you!