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

Extend rustler_mix to handle local dependencies with external_resources #386

Merged

Conversation

evnu
Copy link
Member

@evnu evnu commented Oct 4, 2021

As explained in #381, our current approach to use @external_resources fails to recompile nested crates, as we only consider the NIF crate itself. This pull request fixes that by recursing over the output of cargo metadata: Starting from the NIF crate, it retrieves the dependencies and uses the path field to determine if they are defined locally. If so, it adds those paths to an accumulator and recurses on those local dependencies.

@evnu evnu requested a review from a team October 4, 2021 12:46
@evnu evnu force-pushed the 381-fix-external_resources-for-local-deps branch 2 times, most recently from 00abdc3 to b8f201c Compare October 4, 2021 13:00
@evnu evnu force-pushed the 381-fix-external_resources-for-local-deps branch from b8f201c to a7e015b Compare October 4, 2021 13:30
@evnu evnu merged commit cf3bff2 into rusterlium:master Oct 5, 2021
@evnu evnu deleted the 381-fix-external_resources-for-local-deps branch October 5, 2021 07:47
karolsluszniak added a commit to karolsluszniak/rustler that referenced this pull request Oct 6, 2021
This fixes a regression from rusterlium#386 which made rustler_mix call
`cargo metadata` even when skip_compilation? is set to true,
breaking setups in which the rust library is built separately, e.g.
in separate docker stage with proper rust versioning and in which
the elixir compilation stage doesn't have cargo.

This fix assumes that the external_resources attribute is
irrelevant when skip_compilation? is set to true.
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