Skip to content

Commit f13cb9e

Browse files
authored
Add support for path dependencies (#607)
Adding a path dependency to a rustler Cargo.toml gives this cryptic error: == Compilation error in file lib/multiplayer_backend/project_mutator.ex == ** (Protocol.UndefinedError) protocol Enumerable not implemented for nil of type Atom (elixir 1.16.1) lib/enum.ex:1: Enumerable.impl_for!/1 (elixir 1.16.1) lib/enum.ex:166: Enumerable.reduce/3 (elixir 1.16.1) lib/enum.ex:4399: Enum.filter/2 (rustler 0.32.1) lib/rustler/compiler/config.ex:130: Rustler.Compiler.Config.gather_local_crates/4 (rustler 0.32.1) lib/rustler/compiler/config.ex:108: Rustler.Compiler.Config.external_resources/3 (rustler 0.32.1) lib/rustler/compiler/config.ex:79: Rustler.Compiler.Config.build/1 (rustler 0.32.1) lib/rustler/compiler.ex:8: Rustler.Compiler.compile_crate/3 lib/multiplayer_backend/project_mutator.ex:2: (module) Somehow this dependency slips nil's in the specs, so we just filter them out.
1 parent 127e255 commit f13cb9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rustler_mix/lib/rustler/compiler/config.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ defmodule Rustler.Compiler.Config do
117117

118118
paths = Enum.map(local_deps, & &1["path"]) ++ paths_acc
119119

120-
as_specs = Enum.map(local_deps, &get_spec(packages, &1["name"]))
120+
as_specs =
121+
local_deps
122+
|> Enum.map(&get_spec(packages, &1["name"]))
123+
|> Enum.reject(&is_nil/1)
121124

122125
visited =
123126
local_deps

0 commit comments

Comments
 (0)