-
Notifications
You must be signed in to change notification settings - Fork 518
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
allow use deps on ERL_LIBS in escriptize #2552
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to merge this and I had to do a second take. The apps that are being resolved here are apps that have been declared as part of your project, as defined by
rebar_state:all_deps(State)++rebar_state:project_apps(State)
(line 120). These should actually never contain anything inERL_LIBS
because they're built dynamically from what fits within rebar.config and is resolved recursively.You can actually see the resolving of
code:lib_dir/1
dependencies below on line 276 (279 in your patch). Those are dependencies that should be declared in the .app or .app.src files, but not within rebar.config, since rebar.config assumes it's fetching all the deps declared there.I believe you see the issue you're having here because there's a disconnection between how you're using the dependencies in rebar3's config (for them to be fetched) and where they're supposed to be used for runtime dependencies (in .app or .app.src files).
I believe this PR is the wrong fix for your problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ferd, the code on line 278 (281 here) skips dependencies which are in
code:root_dir()
, ie. part of OTP, but not apps which are in other directories but still onERL_LIBS
. These are included inBinDepNames
but the next call tofind_deps_of_deps
fails since these deps are not inrebar_state:all_deps(State)++rebar_state:project_apps(State)
(I haven't added them torebar.config
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yeah, the recursive call is re-adding them there, and it makes sense at that point. Yeah the fix would make sense then since the input set is no longer the rebar.config apps anymore. My bad for the bad code reading.