Skip to content

Last lines of compilation output are not printed #1073

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

Closed
3 tasks done
per1234 opened this issue Jun 17, 2022 · 3 comments Β· Fixed by #1074
Closed
3 tasks done

Last lines of compilation output are not printed #1073

per1234 opened this issue Jun 17, 2022 · 3 comments Β· Fixed by #1074
Assignees
Labels
conclusion: resolved Issue was resolved criticality: high Of high impact status: in progress Work is in progress on this topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Jun 17, 2022

Describe the problem

πŸ› The last lines of compilation output are not shown in Output panel

To reproduce

  1. Select File > Preferences... from the Arduino IDE menus.
  2. Uncheck the box next to Show verbose output during > β˜‘ compile.
    β“˜ The issue occurs with the verbose output as well. This is done only to produce more simple output for the demo.
  3. Click the OK button.
  4. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
    β“˜ The issue is not specific to this board. A board selection is specified only to ensure the output described here in the demo will be consistent with that seen by those who are reproducing it.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation process to finish.
  7. If the issue does not occur, repeat the process from step 5 until it does occur.

πŸ› The memory usage output is not shown:


--------------------------
Compilation complete.

The output should be:

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

--------------------------
Compilation complete.

Expected behavior

All lines of compilation output

Arduino IDE version

2.0.0-rc7-snapshot-94ceefd

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

I bisected the issue to 4c62431 (does not occur when using the build for a804766).


The number of missing lines varies. This is easier to observe with verbose compilation output enabled. Sometimes the line showing the avr-size command that would be expected immediately before the memory usage lines is printed:

[...]

"C:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-13926962AEE9C72B0EB120253E6668CD/sketch_jun17a.ino.elf" "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-13926962AEE9C72B0EB120253E6668CD/sketch_jun17a.ino.hex"

"C:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-13926962AEE9C72B0EB120253E6668CD/sketch_jun17a.ino.elf"

--------------------------
Compilation complete.

Other times it is not:

[...]

"C:\\Users\\per\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-13926962AEE9C72B0EB120253E6668CD/sketch_jun17a.ino.elf" "C:\\Users\\per\\AppData\\Local\\Temp\\arduino-sketch-13926962AEE9C72B0EB120253E6668CD/sketch_jun17a.ino.hex"


--------------------------
Compilation complete.

More rarely, one or two of the memory usage lines are shown.


Originally reported at https://forum.arduino.cc/t/memory-usage-display-after-compile/1003909

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jun 17, 2022
@davegarthsimpson davegarthsimpson linked a pull request Jun 17, 2022 that will close this issue
4 tasks
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jun 20, 2022
@per1234
Copy link
Contributor Author

per1234 commented Jun 27, 2022

A report on the forum revealed that the problem still occurs:

https://forum.arduino.cc/t/2-0-rc8-nightly-20220627-ram-usage-not-displayed/1007235

I can reproduce this. What I observe is that, even using the build from the time of the fix (a715da3), the last line of the compilation output:

Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

is sometimes not printed, but the problem occurs very infrequently (approximately 3% of compilations). Something changed at a54d7c8. Using that build and all after that (up to the current state at 2.0.0-rc8), it is much more frequent (approximately 30% of compilations).

@per1234 per1234 reopened this Jun 27, 2022
@per1234 per1234 removed the conclusion: resolved Issue was resolved label Jun 27, 2022
@davegarthsimpson
Copy link
Contributor

davegarthsimpson commented Jun 28, 2022

This appears CLI related, when the last line is cut off it is not received at all by the IDE;

I actually get the line cut off around 30-70% of the time with the latest CLI.

I get around 1-3% if I use a build of the CLI omitting the change in this PR;

I believe this "rate limiting" was actually deemed not essential anyway.

@cmaglie

off the back of this issue I've opened a PR which further improves the output panel buffer mechanism, but it does not solve this issue.

p.s. a7edca6 can be ignored with regards to this issue as the associated branch was deleted.

@per1234
Copy link
Contributor Author

per1234 commented Jul 1, 2022

Since it turned out to be a bug in Arduino CLI, I'm going to close this as resolved by the fix: arduino/arduino-cli#1787

The IDE will continue to produce the fault, but that is only because it is still using the version of Arduino CLI that had the bug. The fix will propagate to Arduino IDE as a matter of course on the next update of the Arduino CLI dependency, without any special action required in this code base.

Thanks Dave for your excellent work on identifying the source of the fault.

@per1234 per1234 closed this as completed Jul 1, 2022
@per1234 per1234 added the conclusion: resolved Issue was resolved label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved criticality: high Of high impact status: in progress Work is in progress on this topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants