Skip to content

PlatformArch values support details#29512

Draft
rebloor wants to merge 2 commits intomdn:mainfrom
rebloor:PlatformArch-values-support-details
Draft

PlatformArch values support details#29512
rebloor wants to merge 2 commits intomdn:mainfrom
rebloor:PlatformArch-values-support-details

Conversation

@rebloor
Copy link
Copy Markdown
Contributor

@rebloor rebloor commented Apr 19, 2026

Summary

As a result of [WebExtensions] Deprecate runtime.PlatformInfo.nacl_arch #43799, it was identified that a number of the PlatformArch values were missing. This PR adds those values.

To do

Confirm values supported in Safari.

Related pull requests

Content changes in mdn/content#43847.

@rebloor rebloor requested a review from Rob--W April 19, 2026 18:46
@rebloor rebloor self-assigned this Apr 19, 2026
@rebloor rebloor added the data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions label Apr 19, 2026
@github-actions github-actions bot added the size:m [PR only] 25-100 LoC changed label Apr 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 19, 2026

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@bershanskiy
Copy link
Copy Markdown
Contributor

bershanskiy commented Apr 20, 2026

I would prefer for MDN to just note that the enum values are strings but avoid describing the specific browser- and system-dependent values.

I'm not sure that PlatformArch enum values are relevant for MDN readers, especially since Google intentionally obscures the inner workings of the system (e.g., design docs for "multi-crx" feature not made public, including Chrome Updater and Chrome Web Store server-side code, manifest.json key "platforms"). Documenting the enum at any given point in time will not be effective in the long term since at any point someone can update Chromium source and forget to update MDN (e.g., to adding a value to avid crashes on one platform but not actually fixing the cause or even updating the tests).

runtime.getPlatformInfo() it does not appear to serve any real use case besides data collection for either fingerprinting or bug report triage (e.g., in uBlock Origin). This use cases do not require knowledge of enum values.

CC @oliverdunk Courtesy ping in case you would be interested in this discussion.

@Rob--W
Copy link
Copy Markdown
Member

Rob--W commented Apr 20, 2026

I would prefer for MDN to just note that the enum values are strings but avoid describing the specific browser- and system-dependent values.

If there values are mostly stable, there may be value in documenting examples of what they look like. An enum implies that the enumeration is complete. Since this is not true, we should note that the list may be incomplete, in the mdn/content side (e.g. as part of mdn/content#43847).

runtime.getPlatformInfo() it does not appear to serve any real use case besides data collection for either fingerprinting or bug report triage (e.g., in uBlock Origin). This use cases do not require knowledge of enum values.

An example of a use case that I can imagine for this information is when the extension wants to determine which binary to serve when asking users to install a native messaging application.

Documenting the enum at any given point in time will not be effective in the long term since at any point someone can update Chromium source and forget to update MDN (e.g., to adding a value to avid crashes on one platform but not actually fixing the cause or even updating the tests).

From the way you described it, it sounded like a senseless property was added to work around a crash without fixing a root cause. After reading the references you provided (they are the same, did you mean a different link?), I disagree with the "not actually fixing the cause" description. The issue there was that Chromium apparently started compiling (and running!) for a new platform which was previously unrecognized and therefore triggered the NOTREACHED assertion. Adding a new enum value is a reasonable way to deal with that. The non-crashing on such platforms provides "test coverage" for the correct working on that platform. What it unfortunately does not provide is the guarantee that the value continues to be supported in the long term (e.g. if the mechanism to determine the CPU changes).

Incidentally, Firefox uses the same riscv64 value, which also landed without unit tests (other than existing tests passing when run on that platform): https://bugzilla.mozilla.org/show_bug.cgi?id=1985988

On the Firefox side we document the supported build targets at https://firefox-source-docs.mozilla.org/build/buildsystem/supported-configurations.html . Some of these targets are maintained by individuals external to the main project, which could call in question the long-term support of a particular architecture.

Comment thread webextensions/api/runtime.json Outdated
@bershanskiy
Copy link
Copy Markdown
Contributor

If there values are mostly stable, there may be value in documenting examples of what they look like.

Perhaps, WECG should document the recognized values to avoid future incompatibilities like arm64 and aarch64?

did you mean a different link?

Yes, sorry for mistake, I updated the link in original comment.

From the way you described it, it sounded like a senseless property was added to work around a crash without fixing a root cause.

I'm sorry if he comment sounded a bit alarmist. This isn't a big deal really. The proper fix which we merged soon after was to make nacl_arch optional and fix the tests accordingly. There are still cases when arch can cause similar crashes on unsupported platforms and there we have three options: declare enum values for all CPU architectures in advance (e.g., rarely used MIPS, LoongArch, etc.), make compilation errors obvious (by adding #error statements), or make arch optional as well. I didn't create a CL implementing a fix yet because I could not choose one option out of the three.

Incidentally, Firefox uses the same riscv64 value, which also landed without unit tests (other than existing tests passing when run on that platform): https://bugzilla.mozilla.org/show_bug.cgi?id=1985988

Great! Can we document this in WECG? Can we fix discrepancy between arm64 and aarch64?

@rebloor
Copy link
Copy Markdown
Contributor Author

rebloor commented Apr 20, 2026

Since this is not true, we should note that the list may be incomplete, in the mdn/content side (e.g. as part of mdn/content#43847).

Note added.

@Rob--W
Copy link
Copy Markdown
Member

Rob--W commented Apr 20, 2026

If there values are mostly stable, there may be value in documenting examples of what they look like.

Perhaps, WECG should document the recognized values to avoid future incompatibilities like arm64 and aarch64?

Incidentally, Firefox uses the same riscv64 value, which also landed without unit tests (other than existing tests passing when run on that platform): https://bugzilla.mozilla.org/show_bug.cgi?id=1985988

Great! Can we document this in WECG? Can we fix discrepancy between arm64 and aarch64?

Do you have an overview of the supported values across browsers? That would make it easier to tell what is different and what we should change or align on.

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

Labels

data:webext Compat data for Browser Extensions. https://developer.mozilla.org/Add-ons/WebExtensions size:m [PR only] 25-100 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants