fix(mcpack): check manifest include value before resolving #1446
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.
While trying to build a project targeting the Raspberry Pi Pico with
mcpack
, I ran into an error:All other platform targets were working, so I started exploring the cause.
After digging around the source code for
mcpack
, I narrowed down the issue to how the tool resolves modules from included manifest.json files. This led to the arducam module for the ECMA-419 image/in implementation, which uses a git include for the Pico.When comparing
mcpack
with themcmanifest
tool, I noticed the latter has support for git sources that is missing frommcpack
.This PR fixes the current error by checking the type of the
include
field's value before attempting to resolve the expected string path to the included module.I'm not sure if git support should be added to mcpack if the evaluated manifest from mcpack still goes through mcconfig (a subclass of mcmanifest).