Skip to content

Conversation

@bmuenzenmeyer
Copy link
Contributor

@bmuenzenmeyer bmuenzenmeyer commented Nov 4, 2025

Description

Set default mac architecture to arm64

Validation

hard to verify as I learned I cannot run the site at all on my work network (a me problem!)

Related Issues

attempt to address #8324

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@vercel
Copy link

vercel bot commented Nov 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Nov 5, 2025 5:03pm

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.73%. Comparing base (9fbb9f6) to head (5147f1a).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8328   +/-   ##
=======================================
  Coverage   76.72%   76.73%           
=======================================
  Files         118      118           
  Lines        9805     9808    +3     
  Branches      335      336    +1     
=======================================
+ Hits         7523     7526    +3     
  Misses       2280     2280           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

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

Why not

@bmuenzenmeyer bmuenzenmeyer marked this pull request as ready for review November 4, 2025 19:36
@bmuenzenmeyer bmuenzenmeyer requested a review from a team as a code owner November 4, 2025 19:36
Copilot AI review requested due to automatic review settings November 4, 2025 19:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the OS detection logic to default to ARM architecture for macOS devices when high entropy values are unavailable. The change reflects the shift in Apple's hardware from Intel (x86) to Apple Silicon (ARM) processors.

  • Extracts the detectOS() call into a variable to avoid calling it twice
  • Updates the fallback architecture logic to assume ARM for macOS and x86 for other operating systems
  • Updates the corresponding test to expect the new default ARM architecture for macOS

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
apps/site/hooks/react-client/useDetectOS.ts Extracts OS detection to a variable and changes macOS fallback architecture to ARM
apps/site/hooks/react-client/tests/useDetectOS.test.mjs Updates test assertion to expect ARM architecture for macOS

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ovflowd
Copy link
Member

ovflowd commented Nov 5, 2025

The code was wrong, there was a bug. I've fixed it.

// we attempt to fallback to what the User Agent indicates
bitness = uaIndicates64 ? '64' : '32',
architecture = 'x86',
bitness = os === 'MAC' || uaIndicates64 ? '64' : '32',
Copy link
Member

Choose a reason for hiding this comment

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

macOS UA's don't have "64", but 32bit macOS isn't a thing anymore since many generations of macOS/OS X.

Copy link
Member

Choose a reason for hiding this comment

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

(Although I'm absolutely not a fan of os specific code, this is a small enough check tho

architecture = 'x86',
bitness = os === 'MAC' || uaIndicates64 ? '64' : '32',
// we assume that MacOS has moved to arm64 by default now
architecture = os === 'MAC' ? 'arm' : 'x86',
Copy link
Member

Choose a reason for hiding this comment

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

Also, this was incorrectly set as "arm64", but there's no such thing as "arch64", for some reason TypeScript is resolving as "string"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for looking into this - I had a lot of trouble testing this locally and decided to push it for review 😅

@efekrskl
Copy link
Contributor

efekrskl commented Nov 5, 2025

Seems to work fine now (I'm on M1)

@ovflowd ovflowd added the github_actions:pull-request Trigger Pull Request Checks label Nov 5, 2025
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Nov 5, 2025
@ljharb
Copy link
Member

ljharb commented Nov 5, 2025

is there a preview link i can use to verify whether this works or not?

@ovflowd
Copy link
Member

ovflowd commented Nov 5, 2025

is there a preview link i can use to verify whether this works or not?

#8328 (comment)

@ljharb
Copy link
Member

ljharb commented Nov 6, 2025

Thanks, I didn't see it in the status check section and missed the comment. It certainly defaults to ARM64 for me in Safari on my M4.

@ovflowd
Copy link
Member

ovflowd commented Nov 6, 2025

Thanks, I didn't see it in the status check section and missed the comment. It certainly defaults to ARM64 for me in Safari on my M4.

No worries! It's easy T times to get lost on the sea of comments. For future reference, PRs here the Vercel deployment often is the first comment of any PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants