Skip to content

Document what OperatingSystemUtils and OperatingSystemUtils.hostPlatform is representing #184358

Description

@Gustl22

Use case

I recently stumbled across the class OperatingSystemUtils in flutter_tools.

I noticed that the implementation of hostPlatform differs from platform to platform.
E.g. Windows uses Abi.current to determine its architecture variants, whereas all others use their custom implementation.

Wouldn't it make sense for all to use Abi.current.
See:

HostPlatform get hostPlatform;

One reason I can think about it is not done on purpose, because the platform (TARGET) Dart runs on can differ from actual machine platform (HOST), e.g. when cross-platform building. But then Windows should use its own implementation without using Abi.current.

I am no expert there, I just want to be sure. Maybe Abi.current also reflects the real host (?), but I think it doesn't.

Therefore it would be good to have documented, what OperatingSystemUtils and OperatingSystemUtils.hostPlatform is representing and for what it can be used.

Proposal

I would like to propose to document the usage of this class properly and in a second step, if feasable, replace the implementation with Darts built-in Abi.current implementation on all platforms.

See commit: dd69590

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterd: api docsIssues with https://api.flutter.dev/team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions