Skip to content

Report board platform and build platform on compile JSON output #1608

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

Merged
merged 2 commits into from
Dec 29, 2021

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Dec 29, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?
    Added two fields board_platform and build_platform in the compile JSON output.

board_platform is the platform where the board is defined.
build_platform is the platform used to build the sketch (it may be different if the board_platform reference a core from another platform)

$ arduino-cli compile -b arduino:avr:uno --format json
{
  "compiler_out": "Sketch uses 2406 bytes (7%) of program storage space. Maximum is 32256 bytes.\nGlobal variables use 1212 bytes (59%) of dynamic memory, leaving 836 bytes for local variables. Maximum is 2048 bytes.\n",
  "compiler_err": "",
  "builder_result": {
    "build_path": "/tmp/arduino-sketch-3A27009D252C3EBEA95BE31BD605BF0D",
    "executable_sections_size": [
      {
        "name": "text",
        "size": 2406,
        "max_size": 32256
      },
      {
        "name": "data",
        "size": 1212,
        "max_size": 2048
      }
    ],
    "board_platform": {
      "id": "arduino:avr",
      "version": "1.8.4"
    },
    "build_platform": {
      "id": "arduino:avr",
      "version": "1.8.4"
    }
  },
  "success": true
}
  • Other information:
    Slightly refactored the way commands.Compile returns the result.

@cmaglie cmaglie merged commit 4506bf9 into arduino:master Dec 29, 2021
@cmaglie cmaglie deleted the increase_compile_json_output branch December 29, 2021 16:44
umbynos added a commit to arduino/arduino-cslt that referenced this pull request Dec 29, 2021
This is possible thanks to arduino/arduino-cli#1608
It's mandatory to use a version of the cli that has that change > 0.20.2
umbynos added a commit to arduino/arduino-cslt that referenced this pull request Jan 10, 2022
This is possible thanks to arduino/arduino-cli#1608
It's mandatory to use a version of the cli that has that change > 0.20.2
umbynos added a commit to arduino/arduino-cslt that referenced this pull request Jan 10, 2022
This is possible thanks to arduino/arduino-cli#1608
It's mandatory to use a version of the cli that has that change > 0.20.2
umbynos added a commit to arduino/arduino-cslt that referenced this pull request Jan 10, 2022
* `cobra init`

* update .gitignore

* add compile command

* make fqbn flag required and cleanup

* [WIP] add resultJson generation

* use regex to get objectfile path ,added TODOs with notes

* add check on compile success

* remove regexp and implement some tests (they are failing)

* `ParseObjFilePath` should be finished, tests are passing

* `.o` file and `result.json` are saved in `build dir`, refactor some var names

* don't use parsing from compilerOut but json field `build_path` instead
the tool now supports multiple `.o`

* simplify the result.json file aggregating `CoreInfo` & `LibInfo` structs

* add packager to `coreInfo`, cleanup & fixes

* fix path with spaces not being recognized as a valid platform
isolate `parsePlatformLine` function

* add README.md

* remove horrible parsing of the the `CompilerOut` to get the platform
This is possible thanks to arduino/arduino-cli#1608
It's mandatory to use a version of the cli that has that change > 0.20.2

* apply suggestions by @silvanocerza
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.

3 participants