-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Build size on Linux significantly larger than on Windows #8483
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
Comments
Proposal to sort this out
|
Not sure yet where to look into. The Windows and Linux builds are very similar in size, but the GitHubActions build isn't. The GitHub Actions build I used is this one: https://github.com/letscontrolit/ESPEasy/actions/runs/1829618174 Most notable difference in the output of Linux build:
GitHub Actions build:
Only the difference in nr. of section headers (reported to be 40 bytes) accounts for about 13000 bytes. From the diffs of the
That's a 783 difference in symbols. So if anyone has an idea where to look, as I've no idea right now. |
Don't see how Core is involved though. Plus, it is 2.7.4 Comparing your builds, there is LittleFS & SDFS included in the GH_Actions one. I'd look at the build system & your extra scripts related to build feature sets? |
It really doesn't seem to matter which build I pick. |
Just looked at it a bit more and indeed LittleFS and SDFS do seem to be present in the GH build and not in the build I make myself. There has been some issue in the past where these got included in the code while not needed. Another thing is that looking through the sections in the .elf file, there are apparently duplicate entries, or at least multiple entries with the same name.
|
Part of the PIO build script for is here, but it is mostly build flags How it is linked in the Actions environment may be different, local PC would be significantly faster and it may generate a different file order when building. Not necessary a PIO-specific issue, but it may be related to the way object files are creating dependencies on symbols / objects / etc. Also, maybe related, |
Hmm this clearly makes clear there is a difference between local build and on GitHub: https://github.com/letscontrolit/ESPEasy/runs/5181022567?check_suite_focus=true Edit: So if it does make a difference for 3.0.x then I can look into adding those to the lib_ignore. |
The prliminary SDK3 version embedded in this core is known to be buggy, you were the first - if I remember well - to highlight its slowness. |
Yep, I remember :) In ESPEasy I managed to work around its slower operating speed. So speed is -for me- no longer an issue. |
I just noticed something like this, where apparently an include was not (yet) present when compiling one of the plugins. |
I do wonder why compilation size also differs with re. And just to test the theory (which could be our master, but idk what is the status of 3.0.2 in ESPEasy) |
So far, 3.0.2 is working great as far as I have been able to test it. I will dive into it a bit more. |
OK, looks like it was indeed mainly an issue for PlatformIO.
Regarding the PlatformIO extending of envs.
This last But there are other fixes too, which I think are not all related to PlatformIO. One example is missing includes. Not all code in esp8266/Arduino can be compiled without Some globally defined objects like ArduinoOTA are best only accessed in a single .cpp file and thus only include that header file once. If accessed from several .cpp files and not defined in a mutual .h file, you may get very strange dependencies and I wonder if the code will run as expected as there might perhaps be more than one object with the same name in your build.
I think that I may find other strange link dependencies when I go through my code a bit longer. |
Basic Infos
Platform
Settings in IDE
Problem Description
For ESPEasy I do develop on Windows.
The builds are made using GitHub Actions, which is running on Linux.
I also tested it locally on Linux and a user tested it on MacOS too.
The builds made on Windows are significantly smaller (order of 35k - 40k) compared to those made on Linux/MacOS.
I do use the same PlatformIO config on both.
However, I do not know whether the toolchain on both may be different.
I did try a lot of extra compiler flags to get the build size down as it is an ever ongoing battle to get as much as possible in the small max. sketch size of an ESP8266.
For example
-Os
to optimize for size and-s
to force extra effort to strip unused functions.However, this does not seem to have any effect on Windows builds and hardly noticable effect (if any) on Linux/MacOS.
Not sure if this is a problem for this repository, or PlatformIO or even Gcc, but I have to start somewhere.
A few thoughts of what might be the issue here:
I really don't have a clue anymore to where to look and this really hinders development as I spent more time on micro-optimization of code than actually writing new code lately.
One side effect is that the code is now running even faster than ever, but still failing lots of GH Actions builds where they run perfectly fine on Windows builds.
The text was updated successfully, but these errors were encountered: