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

[OS Detection] Improve MacOS detection #24708

Merged
merged 4 commits into from
Jan 29, 2025
Merged

Conversation

drashna
Copy link
Member

@drashna drashna commented Dec 12, 2024

Description

Fix detection for macOS by making the detection more flexible.

Types of Changes

  • Core
  • Bugfix

Issues Fixed or Closed by This PR

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).

@drashna drashna requested a review from a team December 12, 2024 03:06
@@ -133,7 +133,7 @@ void process_wlength(const uint16_t w_length) {
} else if (setups_data.count == setups_data.cnt_ff) {
// Linux has 3 packets with 0xFF.
guessed = OS_LINUX;
} else if (setups_data.count == 5 && setups_data.last_wlength == 0xFF && setups_data.cnt_ff == 1 && setups_data.cnt_02 == 2) {
} else if (setups_data.count >= 5 && setups_data.last_wlength == 0xFF && setups_data.cnt_ff >= 1 && setups_data.cnt_02 >= 2) {
Copy link
Member

@zvecr zvecr Dec 12, 2024

Choose a reason for hiding this comment

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

// Some collected sequences of wLength can be found in tests.

Any chance we can collect a sample of the "new" macos behaviour and update tests so they pass?

Copy link
Member Author

Choose a reason for hiding this comment

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

added to comments and tests

@drashna drashna added the breaking_change_2025q1 Targeting breaking changes Q1 2025 label Jan 7, 2025
@tzarc tzarc merged commit 8bf01dd into qmk:master Jan 29, 2025
4 checks passed
alk-alyss added a commit to alk-alyss/qmk_firmware that referenced this pull request Jan 30, 2025
* 'master' of https://github.com/qmk/qmk_firmware: (221 commits)
  Add Keychron C3 Pro (Red & RGB) (qmk#24874)
  [OS Detection] Improve MacOS detection (qmk#24708)
  Bump vite from 5.2.14 to 5.4.12 in /builddefs/docsgen (qmk#24852)
  Reject keyboard.json next to info.json (qmk#24882)
  Add keyboard clap_studio/flame60 (qmk#24870)
  [Keyboard] Add Support E8ghtyNeo (qmk#24859)
  [License Violation] add pressplayid (qmk#24869)
  Fix missing wait.h include in Dip Switch Map (qmk#24863)
  Add Model-B keyboard (qmk#24681)
  Updated Licence Violations for Chosfox L75 (qmk#24833)
  License violations updates. (qmk#24831)
  Add Lily (qmk#24813)
  `kikoslab/kl90`: fix keymap (qmk#24826)
  [Keyboard] Add ic45v2 (qmk#24818)
  Allow running Docker container on MacOS (without in-container USB support) (qmk#24412)
  `salane/ncr80alpsskfl`: add additional layouts (qmk#24809)
  Bump nanoid from 3.3.7 to 3.3.8 in /builddefs/docsgen (qmk#24713)
  Fix a build warning and tidy up a keymap (qmk#24805)
  [Bug] Fix Underglow keycode processing (qmk#24798)
  [Docs] Fix wording in Mod Tap documentation (qmk#24796)
  ...
@drashna drashna deleted the fix/os_detection branch January 31, 2025 01:25
Rumadon pushed a commit to Rumadon/qmk_firmware that referenced this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking_change_2025q1 Targeting breaking changes Q1 2025 bug core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] detected_host_os() not detecting MacOS
3 participants