-
-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
add 'include keyboard_features.mk' into build_keyboard.mk #8422
Conversation
One thing I would like to add here. If we're moving stuff around, I think this needs a userspace level needs a second pass check too. And for much the same reasons that the helix style boards too, in fact. And with the userspace check changed, so that it is consistent with specific to generic (keymap <-> user <-> keyboard). Specifically, to be more in line with the config.h handling. Eg:
Aside from this, I very much do like the change |
@drashna, I understand the significance of your hope. I looked it up. % find users keyboards/keebio -name keyboard_features.mk
users/drashna/keyboard_features.mk
keyboards/keebio/iris/keymaps/drashna/keyboard_features.mk
keyboards/keebio/iris/keymaps/keyboard_features.mk
keyboards/keebio/iris/rev4/keyboard_features.mk
keyboards/keebio/iris/keyboard_features.mk
keyboards/keebio/keyboard_features.mk
% make keebio/iris/rev4:drashna:clean
QMK Firmware 0.8.37
==== this is keyboards/keebio/iris/rev4/rules.mk
==== this is keyboards/keebio/rules.mk
==== this is keyboards/keebio/iris/rules.mk
==== this is keyboards/keebio/iris/rev4/rules.mk
Making keebio/iris/rev4 with keymap drashna and target clean
== start build_keyboard.mk ====
==== this is keyboards/keebio/rules.mk
==== this is keyboards/keebio/iris/rules.mk
==== this is keyboards/keebio/iris/rev4/rules.mk
==== this is keyboards/keebio/iris/keymaps/drashna/rules.mk
==== this is users/drashna/rules.mk
==== this is keyboards/keebio/iris/rev4/keyboard_features.mk
==== this is keyboards/keebio/iris/keyboard_features.mk
==== this is keyboards/keebio/keyboard_features.mk
(((((Easy to insert here)))))
==== this is common_features.mk
== end build_keyboard.mk ====
== include tmk_core/rules.mk It seems difficult for build_keyboard.mk to decide where to insert see https://github.com/mtei/qmk_firmware/tree/test_user_rules |
I was a bit misunderstood how build_keyboard.mk works. In this PR, it will be processed as follows.
see https://github.com/mtei/qmk_firmware/tree/test_user_rules if need test |
@drashna , What do you think if it looks like this?
|
I'm not a fan of leaving the If anything, I'd say just rename them, and have everything setup "correctly", but that would mean going through a breaking change. But that may be the best way to go about this. |
If the change for 'users/USER_NAME/*. mk' is a breaking change, I'd like to make that change in another PR. I now need this PR change to resolve qmk/qmk_configurator#684. |
I agree with @drashna. Userspace |
a9c643c
to
c7e49bb
Compare
@vomindoraan and @drashna, I agree. However, I would like to focus on the addition of I think the improvement of |
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.
Don't own affected hardware, but everything seems to check out 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.
LGTM (although consider this a weak approval)
@skullydazed @drashna, do you have any objections/opinions to this PR? |
I have a couple concerns here. For example 1, that seems awfully complicated. I don't have a solution for this use case yet but I am still considering the problem. For example 2, I think over time we have conflated the idea of enabling a feature with the idea that a feature is supported. Features should degrade gracefully if a keymap uses a feature a keyboard can't support. I have an alternative proposal to support this use case: Add a new type of After processing all In your example 2,
After that compiling An additional benefit of this proposal is that we can expose supported hardware features to the API, so Configurator could provide switches for enabling/disabling them, and possibly provide UI for configuring them. |
I agree with your suggestion in this case. It seems to be better. |
Ever since #2606, the Helix keyboard has been in need of this feature. In #2606, MakotoKurauchi and I aimed to give non-programmers the ability to configure in a simpler way. The standard QMK settings are too detailed and complex for them. I've been waiting for #2046 or #6794 or this #8422. And, with (qmk/qmk_configurator#684) and (qmk/qmk_configurator#714) reporting that Helix firmware cannot be generated, this feature is more strongly needed. If I significantly rewrite the rules.mk and config.h under keyboards/helix/rev2/keymaps, we might be able to generate Helix firmware, even under the qmk_configurator environment. However, it is a breaking change, so I want to avoid it. |
I feel that processing.mk is ambiguous. Since we have common_features.mk, keyboard_features.mk would be easier to understand. Is this not good enough? Other candidates
|
we could also consider the following for alignment purposes: |
I would prefer to avoid names that require prior knowledge to understand. A first-time keyboard maintainer should be able to reason about what the file is for based on the name alone. By that metric I don't like any of the names so far, but I do not have a better suggestion. Of the proposed names so far |
keyboard_features.mk is a keyboard-local version of the functions performed by common_features.mk.
c7e49bb
to
7418a4b
Compare
I talked with @tzarc about our path forward with this PR. It should get merged in parallel with #12108 so that we can catch and properly enforce the split between rules and post_rules. Given the large impact that will have on In the interim I will work on splitting the existing |
Is |
Yes. |
* Add check for non-assignment code in rules.mk * fix lint check * fix lint * fixup to reflect the final state of #8422 * fix lint
* qmk/develop: Remove bin/qmk (qmk#14231) ensure that the directory for sys.executable is in the user's path (qmk#14229) move everything from qmkfm/base_container to qmkfm/qmk_cli (qmk#14230) Nyquist (qmk#14202) Update the nix-shell environment (qmk#13316) [Keyboard] Add Viktus SP Mini (qmk#14069) [Keyboard] Corrected layout for np24 by YMDK (qmk#14096) [Keymap] My Prime E keymap (qmk#14117) [Keyboard] Add kelownaRGB64 (qmk#14141) [Keyboard] fix compile error `make helix/rev2/sc:all` (qmk#14214) fix automatic directory for qmk lint (qmk#14215) Add check for non-assignment code in rules.mk (qmk#12108) remove qmk console, which is now part of the global cli (qmk#14206) Fixup upstream paths for submodules. (qmk#14205) Bootmagic lite docs clarity. (qmk#14204) add 'include keyboard_features.mk' into build_keyboard.mk (qmk#8422) 2021Q3 pre-merge `develop` changelog, keyboard aliases (qmk#14198)
* add 'include keyboard_features.mk' into build_keyboard.mk keyboard_features.mk is a keyboard-local version of the functions performed by common_features.mk. * add comment into build_keyboard.mk * added description of keyboard_features.mk in hardware_keyboard_guidelines.md. * rename `keyboard_features.mk` to `post_rules.mk`
* Add check for non-assignment code in rules.mk * fix lint check * fix lint * fixup to reflect the final state of qmk#8422 * fix lint
* add 'include keyboard_features.mk' into build_keyboard.mk keyboard_features.mk is a keyboard-local version of the functions performed by common_features.mk. * add comment into build_keyboard.mk * added description of keyboard_features.mk in hardware_keyboard_guidelines.md. * rename `keyboard_features.mk` to `post_rules.mk`
* Add check for non-assignment code in rules.mk * fix lint check * fix lint * fixup to reflect the final state of qmk#8422 * fix lint
This is an alternative implementation of #6794 and #2046.
Description
keyboard_features.mk
is a file containing keyboard post-processing rules.Post-processing rules convert keyboard-specific shortcuts that represent combinations of standard options into QMK standard options.
keyboard_features.mk
is a keyboard-local version of the functions performed bycommon_features.mk
.rules.mk
andkeyboard_features.mk
are processed in the following order:Example 1
The
keyboard_features.mk
file can interpretfeatures
of a keyboard-level beforecommon_features.mk
. For example, when your designed keyboard has the option to implement backlighting or underglow using rgblight.c, writing the following in thekeyboard_features.mk
makes it easier for the user to configure therules.mk
.keyboards/top_folder/keymaps/a_keymap/rules.mk
keyboards/top_folder/keyboard_features.mk
Example 2
Now, if you compile the following, you get an error.
The reason for the error is that
layouts/community/ortho_4x12/bakingpy/rules.mk
does not have aplaid
keyboard check.If you write the following in
keyboards/plaid/keyboard_features.mk
, the above compilation error will be resolved.BACKLIGHT_ENABLE = no
You should write the same thing as above in the
keyboard_features.mk
for each keyboard ofzlant
,40percentclub/4x4
, andlets_split
. Thenlayouts/community/ortho_4x12/bakingpy/rules.mk
can be as simple as this:Note
Drashna said about #6794:
Yes, #6794 is a bit rough implementation. However, #2046 was an implementation that was too difficult for me to understand.
So, in this PR, I tried again a straightforward and general implementation.
The Helix keyboard really need this PR feature. That's because it turned out yesterday that the QMK Configurator did not compile Helix firmware correctly since October 2019(#6952). (qmk/qmk_configurator#684) (qmk/qmk_configurator#714)
On branch https://github.com/mtei/qmk_firmware/tree/update_helix_rules_mk_using_keyboard_features_mk, I used this feature to modify rules.mk for all Helix keymaps, and confirmed that the compilation did not change.
Types of Changes
Issues Fixed or Closed by This PR
Checklist