-
-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
build size-check enhancement #5485
Conversation
Changed to display a warning when the free size of compilation result is less than 512 bytes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great optimization, but I find the wording on the warning awkward/poor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 👍
Considering how wildly the filesize varies depending on the enabled features, I don't know how useful this will be. It doesn't seem like there is that fine of control over it. Funnily enough I also have a Gist that looks pretty much identical to this, but with a threshold of 1024 bytes. I didn't get around to submitting it due to the above. |
By looking at the test results of the existing PR, I can know which keyboard will reach its limit soon. This is useful information when changing core modules. I can try a build by choosing a keyboard that is likely to exceed the limit. |
Very nice! |
@mtei I agree that this is very nice. It gives us a good look at what boards are close to the limit. Also, it may help to start get some optimization done. |
In my testing I had difficulty getting builds which were within the range of this warning, even at 1024 bytes, by just juggling rules.mk features. They were almost always under or oversize. What sort of changes is this intended to warn against? Layers? |
Several. For one, Travis CI uses avr gcc 5.4.0, which compiles larger than newer versions. So it may flag firmware. Also, it may help to identify feature creep, in ... when boards have a high numbered layer, wasting space. Also, it feels like a good move for users, as it makes it obvious when you're starting to run low on firmware space. (like in my case). For a majority of boards, this won't matter. But there are a few boards .... where this would. And a number of those are already showing up in the Travis CI check here |
That just sounds like a reason not to implement this, tbh. Wouldn't it be a false positive compared to when you build it yourself?
Maybe, if enabling certain features didn't just push it right over the limit. See some of the comments in the build options - these might be outdated numbers but enabling mouse keys for example apparently adds around 4700 bytes, and turning on media keys adds another ~450 (I guess media keys are usually enabled anyway though). The nonconsecutive layers thing I agree with, but I don't know how common that is. |
MSYS uses the same version of AVR GCC, actually. So, it wouldn't necessarily be a false positive. And there may be distros using older versions, as well. So, using the oldest version is more reasonable than a newer version that not everyone has. That way, users don't have to worry about "why it won't compile the default keymap".
It's pretty common. A lot of the boards using the tri layer stuff use it, due to copy-pasta
The numbers are worse than outdated. They're completely compiler version dependant. And most of them are not accurate, and haven't been for a long while. The other issue, is that we need to have "reasonable defaults" for the Configurator, too. We can't just turn off everything. At least until the Configurator has the ability to toggle abilities. Either way, I can definitely see reasons for both adding these and reasons not to. I personally do like it, but I'll defer to others, here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good discussion. LGTM
I tested this PR during my review earlier. I don't know how @drashna did it, but my MSYS avr-gcc is even older than 5.4.0 (I'm running Windows 8.1):
For me, the crkbd on current master barely fits the available space:
|
@noroadsleft the AVR toolchain provided by Microchip/Atmel was "updated" sometime recently I think. |
@noroadsleft Yeah, it was updated, and a while back, I updated the MSYS script to grab that version instead. If you re-run the script, it should update the components. |
Edit: Got this fixed last night. |
for Example. ``` $ make SIZE_MARGIN=2048 crkbd:all $ make crkbd:all ## mergin is 1024 ```
Changed default margin 512 to 1024.
Added SIZE_MARGIN variable.
|
change message to ‘approaching the maximum’ Co-Authored-By: mtei <[email protected]>
Awesome, and thanks for all the work that you've done for QMK Firmware @mtei!! |
* build size-check enhancement Changed to display a warning when the free size of compilation result is less than 512 bytes. * update message.mk * add SIZE_MARGIN variable, change default margin 512 to 1024 for Example. ``` $ make SIZE_MARGIN=2048 crkbd:all $ make crkbd:all ## mergin is 1024 ``` * Update message.mk change message to ‘approaching the maximum’ Co-Authored-By: mtei <[email protected]>
* 'master' of https://github.com/qmk/qmk_firmware: (75 commits) [Keyboard] E6V2 Bootmapper Client QMK port (qmk#5495) [Keymap] Add kwer keymap and RGB mod description to cypher (qmk#5479) [Keymap] added user keymap (qmk#5499) build size-check enhancement (qmk#5485) [Keyboard] Add Collide39 keyboard (qmk#5486) [Docs] Add udev rule for Input Club bootloaders (qmk#5494) [Keymap] adding keymaps (qmk#3583) Add 3 speed mousekey movement option (qmk#2246) [Keymap] add redox/rev1:fculpo keymap (qmk#5491) [Keymap] Update iris default (qmk#5489) Refactor staryu to current standards and enable support for backlight keycodes (qmk#5487) Fixing Ergodox_EZ rgb_led initialization Added songs from Nier and Nier Automata Document an annoyance with Grave Escape and macOS Terminal (qmk#5483) Bugfix for recently integrated cypher keyboard (qmk#5481) add keyboards/mxss/rgblight.h from e661f15:quantum/rgblight.h (qmk#5461) [Keymap] Planck Keymap :: rjhiglefort (qmk#5059) Add support for RGB LEDs wired directly to each half's controller (qmk#5392) [Keyboard] added cypher keyboard support (qmk#5466) [Keymap] Add custom Planck Light keymap (qmk#5464) ...
* build size-check enhancement Changed to display a warning when the free size of compilation result is less than 512 bytes. * update message.mk * add SIZE_MARGIN variable, change default margin 512 to 1024 for Example. ``` $ make SIZE_MARGIN=2048 crkbd:all $ make crkbd:all ## mergin is 1024 ``` * Update message.mk change message to ‘approaching the maximum’ Co-Authored-By: mtei <[email protected]>
* build size-check enhancement Changed to display a warning when the free size of compilation result is less than 512 bytes. * update message.mk * add SIZE_MARGIN variable, change default margin 512 to 1024 for Example. ``` $ make SIZE_MARGIN=2048 crkbd:all $ make crkbd:all ## mergin is 1024 ``` * Update message.mk change message to ‘approaching the maximum’ Co-Authored-By: mtei <[email protected]>
* build size-check enhancement Changed to display a warning when the free size of compilation result is less than 512 bytes. * update message.mk * add SIZE_MARGIN variable, change default margin 512 to 1024 for Example. ``` $ make SIZE_MARGIN=2048 crkbd:all $ make crkbd:all ## mergin is 1024 ``` * Update message.mk change message to ‘approaching the maximum’ Co-Authored-By: mtei <[email protected]>
Description
Changed to display a warning when the free size of compilation result is less than 512 bytes. :-)
Example:
Types of Changes
Checklist