gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.77k stars 743 forks source link

Include erlang ffi modules on .app file for releases to work with gleam apps #3710

Open LostKobrakai opened 8 hours ago

LostKobrakai commented 8 hours ago
gleam new repro
cd repro
gleam export erlang-shipment 
cat build/erlang-shipment/gleam_stdlib/ebin/gleam_stdlib.app

The modules list is missing gleam_stdlib for being an erlang ffi module.

Same problem applies to hex tarballs *.app.src files.

lpil commented 8 hours ago

Thank you.

lawik commented 8 hours ago

Smells like Nerves support.

lpil commented 8 hours ago

High priority it is

LostKobrakai commented 3 hours ago

Leaving some notes from me digging through the codebase:

It seems like compiler-cli/templates/gleam@@compile.erl would need to be updated to not just return ok/error, but also the module names of successfully compiled modules. BeamCompiler.compile would then return that to PackageCompiler.perform_erlang_codegen, which after some reordering could then write an app file containing both gleam sourced modules as well as erlang/elixir ffi sourced modules.