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

tools/sizes.py: Restore to the prior behavior regarding output destination #8572

Merged
merged 1 commit into from
May 17, 2022

Conversation

jjsuwa-sys3175
Copy link
Contributor

once tools/sizes.py outputted to stderr rather stdout before da4a19f

(Arduino IDE 1.8.19 for Windows doesn't capture stdout, 2.0.0-rc6 does)

@mcspr
Copy link
Collaborator

mcspr commented May 17, 2022

Should we, though? This is not an error, as the coloring might suggest, but a simple informative message.


BTW I thought we had an option to replace Sketch uses... lines (ref. commit comments), but...

Arduino/platform.txt

Lines 157 to 161 in 1bb041b

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.irom0\.text|\.text|\.text1|\.data|\.rodata|)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
#recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*

It is actually something hard-coded
https://github.com/arduino/arduino-cli/blob/18cb00c25bcb5c7dfc2dc733231ff391a281899e/legacy/builder/phases/sizer.go#L97

Only future 2.0.0 IDE allows to have a custom output (by reading certain JSON field)
https://github.com/arduino/arduino-cli/blob/18cb00c25bcb5c7dfc2dc733231ff391a281899e/legacy/builder/phases/sizer.go#L52

@jjsuwa-sys3175
Copy link
Contributor Author

jjsuwa-sys3175 commented May 17, 2022

This is not an error, as the coloring might suggest, but a simple informative message.

i understand what you mean, but no sizes shown actually... only in my environment?
scrnshot

better than not seeing anything, even if that color may suggest an error.

(note: applying "Show verbose output during ☑compilation" in IDE Preferences, it also becomes visible as informative, w/other unwanted misc msgs)

@mcspr
Copy link
Collaborator

mcspr commented May 17, 2022

Not really, based on the builder's code :/
https://github.com/arduino/arduino-cli/search?q=utils.Show+%2F*+stderr+*%2F
(also assuming current arduino-cli code is the same as the included builder one)

I have tried .postbuild, but the same rules apply

recipe.hooks.sketch.postbuild.1.pattern="{runtime.tools.python3.path}/python3" -I "{runtime.tools.sizes}" --elf "{build.path}/{build.project_name}.elf" --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --mmu "{build.mmuflags}"

Oh well.

tools/sizes.py Outdated Show resolved Hide resolved
…ation

once `tools/sizes.py` outputted to `stderr` rather `stdout` before da4a19f

(Arduino IDE 1.8.19 for Windows doesn't capture `stdout`, 2.0.0-rc6 does)
@mcspr mcspr merged commit 48b60f4 into esp8266:master May 17, 2022
@jjsuwa-sys3175 jjsuwa-sys3175 deleted the sizes_stderr branch May 17, 2022 14:28
@per1234
Copy link
Contributor

per1234 commented Feb 17, 2023

Arduino IDE 1.8.19 for Windows doesn't capture stdout, 2.0.0-rc6 does

I happened to take a look at this today, and was confused by the quoted statement. Since the "why is it printed in red in the IDE" question is likely to be raised by the users periodically, I'll add some information here:

When the "Show verbose output during: ☐ compilation" Arduino IDE preference is disabled, the IDE only prints the output from the stderr stream of the compilation commands. The stdout stream output of the commands is only printed when that preference is enabled.

This handling of compilation output is the same in Arduino IDE 1.x and 2.x so I can only think of two possible causes of the claimed different behavior between the two versions:

  • The "Show verbose output during: ☐ compilation" Arduino IDE preference was set differently from one IDE to another (IDE 2.x uses a different preference store from 1.x)
  • This bug: Verbose output preferences are not applied correctly arduino/arduino-ide#374 that caused verbose compilation output on upload when verbose upload output was enabled, which has been fixed since Arduino IDE 2.0.0-rc9.1

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.

None yet

3 participants