You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Deeply nested DSLs create module names such as Elixir.Wayfarer.Dsl.Wayfarer.Config.Wayfarer.Targets.Targets.Wayfarer.Targets.Targets.Http.Wayfarer.Targets.Targets.HealthChecks.HealthChecks which will trigger enametoolong on some systems:
08:20:24.969 [error] Process #PID<0.153.0> raised an exception
** (File.Error) could not write to file "/home/james/Dev/harton.dev/james/wayfarer/_build/dev/lib/wayfarer/ebin/Elixir.Wayfarer.Dsl.Wayfarer.Config.Wayfarer.Targets.Targets.Wayfarer.Targets.Targets.Http.Wayfarer.Targets.Targets.HealthChecks.HealthChecks.beam": file name too long
(elixir 1.17.1) lib/file.ex:1144: File.write!/3
(elixir 1.17.1) lib/kernel/parallel_compiler.ex:334: anonymous fn/3 in Kernel.ParallelCompiler.write_module_binaries/3
(elixir 1.17.1) lib/enum.ex:1268: anonymous fn/3 in Enum.flat_map/2
(stdlib 6.0) maps.erl:860: :maps.fold_1/4
(elixir 1.17.1) lib/enum.ex:2543: Enum.flat_map/2
(elixir 1.17.1) lib/kernel/parallel_compiler.ex:261: Kernel.ParallelCompiler.spawn_workers/3
(mix 1.17.1) lib/mix/compilers/elixir.ex:1018: anonymous fn/9 in Mix.Compilers.Elixir.compiler_loop/6
To be clear this an issue with BEAM and not Spark or Elixir and in response to a similar bug report against Elixir José's response boils down to "just use shorter module names". I think he's right. There are a couple of strategies I can think of;
Move generated modules out of the Elixir. namespace (I suggest Spark.).
Name modules by using a hash of their DSL path. I'd suggest :erlang.phash2 since it should always be available. It doesn't really matter if the modules are "discoverable" as they're only ever imported by Spark anyway. We can always add a flag to disable this behaviour while debugging.
To Reproduce
I triggered it by using eCryptfs on a portable Linux device because the effective file length limit is ~140 bytes. It is possible to reproduce on Linux & macOS (255 byte limit) by creating a DSL with very long entity names.
Expected behavior
The DSL extension should cleanly compile.
Runtime
Elixir version 1.17.1
Erlang version 27.0
OS Linux 5.10.17-v8+ aarch64. Raspberry Pi OS based on Debian 11 (bullseye).
Spark version 2.2.4
any related extension versions
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
Deeply nested DSLs create module names such as
Elixir.Wayfarer.Dsl.Wayfarer.Config.Wayfarer.Targets.Targets.Wayfarer.Targets.Targets.Http.Wayfarer.Targets.Targets.HealthChecks.HealthChecks
which will triggerenametoolong
on some systems:To be clear this an issue with BEAM and not Spark or Elixir and in response to a similar bug report against Elixir José's response boils down to "just use shorter module names". I think he's right. There are a couple of strategies I can think of;
Elixir.
namespace (I suggestSpark.
).:erlang.phash2
since it should always be available. It doesn't really matter if the modules are "discoverable" as they're only ever imported by Spark anyway. We can always add a flag to disable this behaviour while debugging.To Reproduce
I triggered it by using eCryptfs on a portable Linux device because the effective file length limit is ~140 bytes. It is possible to reproduce on Linux & macOS (255 byte limit) by creating a DSL with very long entity names.
Expected behavior
The DSL extension should cleanly compile.
Runtime
1.17.1
27.0
2.2.4
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: