Skip to content

Conversation

@lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Sep 22, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

For some reason, when running yarn fix on macOS with ARM processor, it relies on an X86 wrapper/install of clang-format, throwing build errors if you don't have Rosetta installed.

This PR will do the following changes:

Package

  • Remove deprecated yarn package that includes an old clang format that has no arm support.

GH CI

  • Install on Ubuntu VM clang 20 and other dependencies so it matches a the output that brew install on macos produces.
  • sentry-cocoa doesn't need this change since the lint step uses macos VM, making the setup easy by using brew.

Clang Script

  • Prefer brew version of clang-format so it uses the correct architecture for the current system.
  • Rollback to the original path if we don't have a brew installation.
  • Alert users on how to install clang-format if not found.
  • Alert users about arch errors and how to manually run clang-format in case of architecture mismatch.

iOS Folder

  • Changes applied by clang-format after running yarn fix due to new changes generated by newer clang-format.

💡 Motivation and Context

Annoying errors where I can't use clang-format locally due to wrong CPU Arch. ALSO, clang-format was always producing different formating than CI clang-format, wasting developer time by manually fixing the CI format.

💚 How did you test it?

CI/Locally

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog.

@lucas-zimerman lucas-zimerman changed the base branch from lz/5186 to lz/ios-logs September 22, 2025 17:49
@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 394.76 ms 385.32 ms -9.44 ms
Size 17.75 MiB 19.68 MiB 1.94 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.86 ms 1242.71 ms 14.86 ms
Size 2.63 MiB 3.96 MiB 1.33 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.12 ms 1231.18 ms 5.06 ms
Size 3.19 MiB 4.53 MiB 1.35 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Sep 22, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.53 ms 377.52 ms 58.99 ms
Size 7.15 MiB 8.41 MiB 1.26 MiB

@lucas-zimerman
Copy link
Collaborator Author

Oh that's why!
Clang used by the repo comes from npm, the same is 3 years old unmaintained.

@lucas-zimerman lucas-zimerman marked this pull request as ready for review September 22, 2025 20:27
@lucas-zimerman lucas-zimerman changed the title Patch clang-format Drop outdated clang-format from npm Sep 22, 2025
@lucas-zimerman lucas-zimerman mentioned this pull request Sep 22, 2025
10 tasks
Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

LGTM 🥇
Thank you for fixing this Lucas 🙇

@lucas-zimerman lucas-zimerman merged commit 0fe4b3a into lz/ios-logs Sep 23, 2025
57 of 65 checks passed
@lucas-zimerman lucas-zimerman deleted the lz/clang-fix branch September 23, 2025 12:11
antonis pushed a commit that referenced this pull request Sep 23, 2025
* enable ios logs:

* logs

* changelog

* Drop outdated clang-format from npm (#5191)

* enable logs on expo sample

* repro'

* patch clang-format and run it

* return flags

* return original sample code

* more rollback

* print clang version

* remove deprecated package, add clang-format setup

* try setup clang21

* other strategy to update clang/ more changes for version

* gh action name change

* Update .github/workflows/buildandtest.yml

---------

Co-authored-by: Lucas Zimerman <lucaszimerman@Lucass-Mac-mini.local>
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.

3 participants