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

Migrate platform independent code from tmk_core -> quantum #13673

Merged
merged 2 commits into from
Aug 17, 2021

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Jul 23, 2021

Description

Trying to catch the end of the develop cycle to minimise merge issues

git mv tmk_core/common/*action* quantum/
git mv tmk_core/common/key* quantum/
git mv tmk_core/common/eeconfig.* quantum/

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@zvecr zvecr added the breaking_change Changes that need to wait for a version increment label Jul 23, 2021
@github-actions github-actions bot added the core label Jul 23, 2021
@zvecr zvecr changed the title Migrate action from tmk_core -> quantum Migrate action|keyboard|keycode from tmk_core -> quantum Jul 23, 2021
@tzarc
Copy link
Member

tzarc commented Jul 24, 2021

Need to retarget develop.

@tzarc tzarc requested review from tzarc and a team July 24, 2021 09:40
@zvecr zvecr marked this pull request as ready for review July 31, 2021 13:49
@zvecr
Copy link
Member Author

zvecr commented Jul 31, 2021

Will rebase closer to develop closing, to minimise any potential issues with other user PRs.

@github-actions github-actions bot added CI cli qmk cli command dependencies documentation keyboard keymap python translation via Adds via keymap and/or updates keyboard for via support labels Aug 1, 2021
@zvecr zvecr changed the base branch from master to develop August 1, 2021 13:36
@github-actions github-actions bot removed dependencies CI keymap via Adds via keymap and/or updates keyboard for via support keyboard documentation python cli qmk cli command translation labels Aug 1, 2021
@zvecr zvecr added breaking_2021q3 and removed breaking_change Changes that need to wait for a version increment labels Aug 4, 2021
@zvecr zvecr changed the title Migrate action|keyboard|keycode from tmk_core -> quantum Migrate action|eeconfig|keyboard|keycode from tmk_core -> quantum Aug 7, 2021
@zvecr zvecr changed the title Migrate action|eeconfig|keyboard|keycode from tmk_core -> quantum Migrate platform independent code from tmk_core -> quantum Aug 7, 2021
@drashna
Copy link
Member

drashna commented Aug 12, 2021

I'm not sure why, but this break split side detection. EE Hands, master left/right doesn't matter, the USB side registers as left. Period. Confirmed on 3 different boards. And both with merging into a branch and checkout out this PR directly.

@sigprof
Copy link
Contributor

sigprof commented Aug 12, 2021

I'm not sure why, but this break split side detection.

Probably because these files get linked in a different order after applying the PR:

quantum/split_common/split_util.c:__attribute__((weak)) bool is_keyboard_left(void) {
tmk_core/common/keyboard.c:__attribute__((weak)) bool is_keyboard_left(void) { return true; }

build_keyboard.mk contains:

SRC += $(KEYBOARD_SRC) \
    $(KEYMAP_C) \
    $(QUANTUM_SRC)
...
# this appends $(QUANTUM_DIR)/split_common/split_util.c to $(QUANTUM_SRC) if requested
include common_features.mk
...
SRC += $(TMK_COMMON_SRC)

So before the PR quantum/split_common/split_util.c was listed in $(SRC) before tmk_core/common/keyboard.c, but after the PR the order of those files is reversed — and this apparently affects the choice between multiple weak definitions of the is_keyboard_left symbol.

Note that the behavior of ld in the presence of multiple weak definitions of a symbol does not seem to be documented anywhere, therefore relying on the first weak definition overriding subsequent weak definitions might actually be unsafe. However, this might not be the only place in QMK where multiple different weak definitions of the same symbol are used.

@zvecr
Copy link
Member Author

zvecr commented Aug 12, 2021

Kinda meh, but the latest commit should resolve the split issues. Given the other SPLIT_KEYBOARD guards in quantum, its no worse, but overall it would be better to introduce nicer longer term abstractions for some of this stuff.

Copy link
Member

@drashna drashna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm it works

@drashna
Copy link
Member

drashna commented Aug 17, 2021

Found an issue.

quantum/via.h:19:10: fatal error: tmk_core/common/eeconfig.h: No such file or directory
 #include "tmk_core/common/eeconfig.h"  // for EECONFIG_SIZE

@zvecr zvecr merged commit b8e913c into qmk:develop Aug 17, 2021
qieq added a commit to qieq/qmk_firmware that referenced this pull request Sep 1, 2021
Updated path to keycode.h (file moved in qmk#13673).
@qieq qieq mentioned this pull request Sep 1, 2021
6 tasks
nhongooi pushed a commit to nhongooi/qmk_firmware that referenced this pull request Dec 5, 2021
* Migrate action|keyboard|keycode|eeconfig from tmk_core -> quantum
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
* Migrate action|keyboard|keycode|eeconfig from tmk_core -> quantum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants