Please check if the PR fulfills these requirements
See how to contribute
What kind of change does this PR introduce?
compile --show-properties
now correctly output the result in text and JSON format.
What is the current behavior?
The properties are mixed with the build recap:
$ arduino-cli compile -b arduino:avr:uno --show-properties -v
Utilizzo della scheda 'uno' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6
Utilizzo del core 'arduino' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6
_id=uno
archive_file_path={build.path}/{archive_file}
bootloader.extended_fuses=0xFD
bootloader.file=optiboot/optiboot_atmega328.hex
[.......CUT......]
vid.1=0x2341
vid.2=0x2A03
vid.3=0x2341
vid.4=0x2341
Piattaforma utilizzata Versione Percorso
arduino:avr 1.8.6 /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6
A crash occurs if wrong FQBN is set:
$ arduino-cli compile -b arduino:avr:unoa --show-properties -v
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xc0a47c]
goroutine 1 [running]:
github.com/arduino/arduino-cli/commands/compile.Compile({0x16edb40?, 0x0?}, 0xc0000c06e0, {0x10f36c0?, 0xc0000132d8}, {0x10f36c0?, 0xc0000132f0}, 0x0)
/home/megabug/Workspace/arduino-cli/commands/compile/compile.go:192 +0x17bc
github.com/arduino/arduino-cli/internal/cli/compile.runCompileCommand(0xc00038d400?, {0xc00024ddc0, 0x0, 0x4?})
/home/megabug/Workspace/arduino-cli/internal/cli/compile/compile.go:216 +0x989
github.com/spf13/cobra.(*Command).execute(0xc00038d400, {0xc00024dd80, 0x4, 0x4})
/home/megabug/Software/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0xc00028db80)
/home/megabug/Software/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
/home/megabug/Software/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902
main.main()
/home/megabug/Workspace/arduino-cli/main.go:31 +0x77
JSON output is mixed with build properties:
$ arduino-cli compile -b arduino:avr:uno --show-properties --format json -v
_id=uno
archive_file_path={build.path}/{archive_file}
bootloader.extended_fuses=0xFD
bootloader.file=optiboot/optiboot_atmega328.hex
bootloader.high_fuses=0xDE
[.......CUT.......]
vid.1=0x2341
vid.2=0x2A03
vid.3=0x2341
vid.4=0x2341
{
"compiler_out": "Utilizzo della scheda 'uno' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6\nUtilizzo del core 'arduino' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6\n",
"compiler_err": "",
"builder_result": {
"build_path": "/tmp/arduino/sketch-002050EAA7EFB9A4FC451CDFBC0FA2D3",
"board_platform": {
"id": "arduino:avr",
"version": "1.8.6",
"install_dir": "/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6"
},
"build_platform": {
"id": "arduino:avr",
"version": "1.8.6",
"install_dir": "/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6"
}
},
"success": true
}
What is the new behavior?
$ arduino-cli compile -b arduino:avr:uno --show-properties -v
_id=uno
archive_file_path={build.path}/{archive_file}
bootloader.extended_fuses=0xFD
bootloader.file=optiboot/optiboot_atmega328.hex
bootloader.high_fuses=0xDE
bootloader.lock_bits=0x0F
bootloader.low_fuses=0xFF
...
$ arduino-cli compile -b arduino:avr:unoa --show-properties -v
Si è verificato un errore durante la compilazione: Si è verificato un errore durante la risoluzione di FQBN: la scheda arduino:avr:unoa non è stata trovata
$ arduino-cli compile -b arduino:avr:unoa --show-properties -v --format json
{
"compiler_out": "",
"compiler_err": "",
"builder_result": {
"build_path": "/tmp/arduino/sketch-002050EAA7EFB9A4FC451CDFBC0FA2D3"
},
"success": false,
"error": "Si è verificato un errore durante la compilazione: Si è verificato un errore durante la risoluzione di FQBN: la scheda arduino:avr:unoa non è stata trovata"
}
$ arduino-cli compile -b arduino:avr:uno --show-properties --format json -v
{
"compiler_out": "Utilizzo della scheda 'uno' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6\nUtilizzo del core 'arduino' dalla piattaforma nella cartella: /home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6\n",
"compiler_err": "",
"builder_result": {
"build_path": "/tmp/arduino/sketch-002050EAA7EFB9A4FC451CDFBC0FA2D3",
"board_platform": {
"id": "arduino:avr",
"version": "1.8.6",
"install_dir": "/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6"
},
"build_platform": {
"id": "arduino:avr",
"version": "1.8.6",
"install_dir": "/home/megabug/.arduino15/packages/arduino/hardware/avr/1.8.6"
},
"build_properties": [
"_id=uno",
"archive_file_path={build.path}/{archive_file}",
"bootloader.extended_fuses=0xFD",
"bootloader.file=optiboot/optiboot_atmega328.hex",
[.........CUT.........]
"vid.1=0x2341",
"vid.2=0x2A03",
"vid.3=0x2341",
"vid.4=0x2341"
]
},
"success": true
}
Does this PR introduce a breaking change, and is titled accordingly?
No breaking changes
Uh oh!
There was an error while loading. Please reload this page.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)What kind of change does this PR introduce?
compile --show-properties
now correctly output the result in text and JSON format.What is the current behavior?
The properties are mixed with the build recap:
A crash occurs if wrong FQBN is set:
JSON output is mixed with build properties:
What is the new behavior?
Does this PR introduce a breaking change, and is titled accordingly?
No breaking changes