Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for path dependencies #607

Merged
merged 1 commit into from
May 29, 2024

Conversation

flupke
Copy link
Contributor

@flupke flupke commented Apr 29, 2024

What changes

Fix a bug when adding a path dependency to a rustler Cargo.toml that 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.

How to test

Clone this repository and try to build it to reproduce the error. Uncomment the rustler dependency pointing to this PR to fix.

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.
@filmor
Copy link
Member

filmor commented May 29, 2024

I think this will do for now.

@filmor filmor merged commit f13cb9e into rusterlium:master May 29, 2024
31 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants