Skip to content

Add analytics reporting for the x86 version - #24054

Open
SMillerDev wants to merge 1 commit into
mainfrom
feat/analytics/report_x86_version
Open

SMillerDev wants to merge 1 commit into
mainfrom
feat/analytics/report_x86_version

Conversation

@SMillerDev

@SMillerDev SMillerDev commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Inspired by https://github.com/orgs/Homebrew/discussions/7092#discussioncomment-18528421, this now reports if the x86 processor has v1-4 support. That would be good to know to potentially make bottles on newer x86 versions saving developers time and the world energy by using more optimized instructions.

@MikeMcQuaid

Copy link
Copy Markdown
Member

Passing on this given conversation in the discussion.

@SMillerDev

Copy link
Copy Markdown
Member Author

I've read it again, but I only see argument there in favour of tracking this information.

@MikeMcQuaid

Copy link
Copy Markdown
Member

@SMillerDev TL;DR: I don't see a world in which we change this and do a mass rebottling for something without significant performance benchmarks, unless we're getting a hard 0️⃣ here. As-is this will mess with our existing analytics here too. I just don't think it's worth the large amount of effort here and breakage.

@MikeMcQuaid
MikeMcQuaid deleted the feat/analytics/report_x86_version branch September 21, 2026 20:44
@cho-m

cho-m commented Sep 22, 2026

Copy link
Copy Markdown
Member

I do see a possible future where we add a separate bottle for x86_64_v3_linux, maybe selectively for formulae that actually benefit.

This is the direction that major Linux distros have been preparing recently so users may start seeing a performance loss if switching from system to Homebrew binaries:

@MikeMcQuaid
MikeMcQuaid restored the feat/analytics/report_x86_version branch September 22, 2026 13:49
@MikeMcQuaid

Copy link
Copy Markdown
Member

@cho-m Thanks for context. I think logical time for this sort of change for us might be when we're doing Ubuntu/GCC/glibc version migrations. We could start using different bottle tags for each of those and consider adjusting what we support for Intel/ARM at those points.

@MikeMcQuaid MikeMcQuaid reopened this Sep 22, 2026
Comment thread Library/Homebrew/utils/os.sh Resolved
Comment thread Library/Homebrew/utils/analytics.rb Resolved
@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 3887d4a to 690f08d Compare September 28, 2026 10:36
Comment thread Library/Homebrew/brew.sh Resolved
@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 690f08d to 90bc603 Compare October 8, 2026 12:34
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c89c0eba-9b5a-47ea-9eb3-454ccf9291bd
Commits

Reviewing files that changed from the base of the PR and between 58bc2e8 and 0053e23.

Files selected for processing: 1
  • Library/Homebrew/test/hardware/cpu_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Package analytics now include CPU family information, helping distinguish systems by processor architecture.
    • Linux ARM processors with recognised implementers and models are classified by architecture family.
  • Bug Fixes
    • Linux ARM processors with unsupported implementers or unmapped models are identified as unknown.
    • Other unclassified CPU types, including PowerPC, are reported as undetermined rather than being assigned a processor family.

Linux CPU detection maps supported ARM models to architecture-family symbols. Package analytics includes the detected CPU family as a string-valued tag.

Changes: Linux CPU family and analytics

Layer / File(s) Summary
Linux CPU family detection
Library/Homebrew/extend/os/linux/hardware/cpu.rb, Library/Homebrew/test/hardware/cpu_spec.rb
ARM detection maps implementer and CPU part values to architecture-family symbols. Other implementers and unmapped models return unknown symbols. PPC detection is removed, and other unsupported CPU types return :dunno. The CPU family test list includes seven ARM family symbols and accepts unknown family symbols.
CPU family analytics tag
Library/Homebrew/utils/analytics.rb, Library/Homebrew/test/utils/analytics_spec.rb
default_package_tags adds the CPU family as a string-valued tag. The ARM custom-prefix test checks the :cpu_family tag and verifies :arch. A test checks that an ARM CPU produces the "armv8_0_a" tag.

Priority: Low

Merge Risk: Minimal · up to 0053e

No actionable CPU-family or analytics risk remains for supported Homebrew workflows.

Security architecture risk: Low · up to 04757

This adds CPU-family information to package telemetry without changing its destination or opt-out controls. The reviewed changes show no new privilege or access path. Downstream handling of the new telemetry field was not available for review.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The direct security-relevant exposure is additional host classification data in package analytics for clients whose existing analytics checks permit reporting. The change does not select a new destination or grant authority to the CPU-family value.

Trust Boundaries and Controls

  • observed — Both package-event reporting and final submission retain the existing analytics disable and per-run suppression checks. Tag serialization escapes spaces, commas, and equals signs; submission passes the body as a process argument rather than interpolating it into a shell command. These controls predate the PR and remain in place for the added field.

Resilience and Maintainability Implications

  • inferred — The new field uses the existing lazy tag cache and event-specific hash merge. It introduces no new durable state transition or recovery protocol; event construction does not overwrite cached tags with event-specific values. Transport timeout and detached submission behavior are unchanged.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title identifies the analytics reporting change and the x86 focus described in the objectives. It is related to the changeset, although it does not mention the broader CPU family detection and ARM…
Description check Passed The description explains the purpose of reporting x86 processor support levels and relates directly to the analytics changes in the pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title identifies the analytics reporting change and the x86 focus described in the objectives. It is related to the changeset, although it does not mention the broader CPU family detection and ARM updates.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 90bc603 to ccb4ca6 Compare October 8, 2026 12:35
@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch 3 times, most recently from 9e15d70 to 279c283 Compare October 19, 2026 07:43
@SMillerDev
SMillerDev marked this pull request as ready for review October 19, 2026 07:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 607f29f1-f270-4204-8f8d-c298f80d1268
📥 Commits

Reviewing files that changed from the base of the PR and between 8f10429 and 279c283.

📒 Files selected for processing: 3
  • Library/Homebrew/extend/os/linux/hardware/cpu.rb
  • Library/Homebrew/test/utils/analytics_spec.rb
  • Library/Homebrew/utils/analytics.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@SMillerDev

Copy link
Copy Markdown
Member Author

Output from my RPI now:

HOMEBREW_VERSION: 7.0.9-161-g5ab0620
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5ab06207b34e09426ad0ca94de7110c577b915fb
Last commit: 3 minutes ago
Branch: feat/analytics/report_x86_version
Core tap: N/A
Core cask tap: N/A
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
Homebrew Ruby: 4.0.7 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/4.0.7_1/bin/ruby
CPU: quad-core 64-bit armv8_0_a

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments: 1
Library/Homebrew/test/utils/analytics_spec.rb: 1

38-43: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Keep the existing custom-prefix example cross-platform and add a Linux consumer example.

:needs_linux would skip the existing example on macOS. Keep that example unchanged. Add a separate Linux-only example that supplies ARM cpuinfo data and asserts the serialised analytics value. A fixture used only by arm_family tests would not test default_package_tags.

Suggested fix
     it "returns OS_VERSION, ARM and prefix when HOMEBREW_PREFIX is a custom prefix on arm" do
       expect(Homebrew).to receive(:default_prefix?).and_return(false).at_least(:once)
       expect(described_class.default_package_tags).to have_key(:cpu_family)
       expect(described_class.default_package_tags).to have_key(:arch)
       expect(described_class.default_package_tags[:arch]).to eq HOMEBREW_PHYSICAL_PROCESSOR
       expect(described_class.default_package_tags).to have_key(:prefix)
       expect(described_class.default_package_tags[:prefix]).to eq "custom-prefix"
     end
 
+    it "serialises the Linux ARM CPU family in the package tags", :needs_linux do
+      allow(Hardware::CPU).to receive_messages(arm?: true, intel?: false)
+      allow(Hardware::CPU).to receive(:cpuinfo).and_return(
+        "CPU implementer : 0x41\nCPU part : 0xd08\n",
+      )
+      described_class.clear_cache
+
+      expect(described_class.default_package_tags[:cpu_family]).to eq "armv8_0_a"
+    end
+

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84644939-885c-4d00-aaac-221244b44c38
📥 Commits

Reviewing files that changed from the base of the PR and between 279c283 and 5ab0620.

📒 Files selected for processing: 1
  • Library/Homebrew/extend/os/linux/hardware/cpu.rb
🚧 Files skipped from review as they are similar to previous changes: 1
  • Library/Homebrew/extend/os/linux/hardware/cpu.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 5ab0620 to ca12a5d Compare October 19, 2026 08:19

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Preserve the PowerPC family value before the unknown fallback. · cpu.rb:43-47

Library/Homebrew/extend/os/linux/hardware/cpu.rb:43-47
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Preserve the PowerPC family value before the unknown fallback.

A supported Linux PowerPC host reaches this branch and now reports :dunno. This changes the cpu_family package analytics value and the 32-bit PowerPC installation metadata from ppc to dunno. Add a PowerPC branch so the new ARM unknown-family behaviour remains unchanged.

Suggested fix
-            else
+            elsif ppc?
+              :ppc
+            else
               :dunno

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39f16fb7-444f-4e51-a195-289dba48f543
📥 Commits

Reviewing files that changed from the base of the PR and between 5ab0620 and ca12a5d.

📒 Files selected for processing: 1
  • Library/Homebrew/test/utils/analytics_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from ca12a5d to 8266383 Compare October 19, 2026 08:43
@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 04757e8 to 21c7166 Compare October 24, 2026 14:50
@SMillerDev

Copy link
Copy Markdown
Member Author

Well that's an interesting failure: https://github.com/Homebrew/brew/actions/runs/40104299741/job/120902914789?pr=24054

curl: (6) Could not resolve host: ghcr.io

Error: Failed to download ruby from the following locations:
  - https://ghcr.io/v2/homebrew/core/portable-ruby/blobs/sha256:25d6becc4464b6e65ac38a76ccd27eee8be5d0d805f6b3292d74e37deb8dd13b

Do not file an issue on GitHub about this; you will need to figure out for
yourself what issue with your internet connection restricts your access to
GitHub (used for Homebrew updates and binary packages).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 11694d09-d009-4fe6-8dad-da00e1d53785
Commits

Reviewing files that changed from the base of the PR and between 04757e8 and 21c7166.

Files selected for processing: 1
  • Library/Homebrew/extend/os/linux/hardware/cpu.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 21c7166 to a303041 Compare October 24, 2026 14:59
@MikeMcQuaid

Copy link
Copy Markdown
Member

Well that's an interesting failure: https://github.com/Homebrew/brew/actions/runs/40104299741/job/120902914789?pr=24054

some GitHub downtime/issues I guess, seeing that on mine too

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from a303041 to 935c92b Compare October 24, 2026 15:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b307c1ea-91c4-4b33-abe3-ed574804377d
Commits

Reviewing files that changed from the base of the PR and between a303041 and 935c92b.

Files selected for processing: 2
  • Library/Homebrew/extend/os/linux/hardware/cpu.rb
  • Library/Homebrew/test/hardware/cpu_spec.rb

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 935c92b to 58bc2e8 Compare October 24, 2026 17:41
@SMillerDev
SMillerDev force-pushed the feat/analytics/report_x86_version branch from 58bc2e8 to 0053e23 Compare October 24, 2026 17:54

This branch has not been deployed

No deployments
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