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

build.py --dev flag does not do the same as codal.json "dev": true #86

Open
microbit-carlos opened this issue Mar 11, 2024 · 0 comments

Comments

@microbit-carlos
Copy link
Collaborator

microbit-carlos commented Mar 11, 2024

Looking at build.py, the dev flag is described as "enable developer mode (does not use target-locked.json)":

parser.add_option('-d', '--dev', dest='dev', action="store_true", help='enable developer mode (does not use target-locked.json)', default=False)


There is also another way to "enable developer mode" by setting the "target.dev": true key in codal.json. This mode is processed in the CMake files and it read target-locked.json instead of target.json from codal-microbit-v2:

if("${codal.target.dev}" STRGREATER "")
file(READ "./${LIB_DEST}/${codal.target.name}/target.json" device_json)
message("${BoldMagenta}Using target.json (dev version) ${ColourReset}")
else()
file(READ "./${LIB_DEST}/${codal.target.name}/target-locked.json" device_json)
message("${BoldMagenta}Using target-locked.json${ColourReset}")
endif()

The build.py --dev flag it's only used:

  • When the --update flag is used to update (git pull) the libraries:
    • build.py#L61
    • In this case a build.py does not invoke any CMake files, so it never uses target-locked.json or target.json
    • So in this case, the build.py description of the --dev flag does not quite apply
  • When the "target" command argument is used (e.g. python build.py codal-microbit --dev)
    • build.py#L116
    • In this case it completely overwrites the codal.json to include this flag, and incidentally loses all other configured options from the file
    • Also, this needs an existing target to be specified in utils/targets.json, which right now does not contain an entry for codal-microbit-v2
    • So this is either an obsolete option, or something that needs to be updated for micro:bit V2

With the normal python build.py invocation with the --dev flag does not do anything at all, which is also a bit confusing.

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

No branches or pull requests

1 participant