Skip to content

add FreeBSD to Common/tests/XunitTraitsDiscoverers/PlatformID.cs? #14507

@ghuntley

Description

@ghuntley

Greetings,

With FreeBSD becoming a reality over in the CoreCLR repository I have started combing for references within CoreFX that will potentially need changing. PlatformID.cs has caught my eye and it looks like this is used to target if unit test(s) should be enabled/disabled on a particular platform:

This issue is a RFC to discuss as to how PlatformID should be modified to cater for FreeBSD and how to handle other BSD variants that use different kernels.

https://github.com/dotnet/corefx/blob/master/src/Common/tests/XunitTraitsDiscoverers/PlatformID.cs is currently:

[Flags]
public enum PlatformID
{
    Windows = 1,
    Linux = 2,
    OSX = 4,
    Any = Windows | Linux | OSX
}

Whilst OSX due to the family lineage could be argued to be a BSD it makes more sense to specifically purpose a flag just for FreeBSD as every release of OSX drifts further and further away from the original origins. Thus add FreeBSD = 8

[Flags]
public enum PlatformID
{
    Windows = 1,
    Linux = 2,
    OSX = 4,
    FreeBSD = 8,
    Any = Windows | Linux | OSX | FreeBSD
}

If a team forms around OpenBSD, NetBSD or DragonFlyBSD and actual product ships then we could rename FreeBSD to BSD similar to below:

[Flags]
public enum PlatformID
{
    Windows = 1,
    Linux = 2,
    OSX = 4,
    BSD = 8,
    Any = Windows | Linux | OSX | BSD
}

However unlike linux, FreeBSD/NetBSD/DragonFlyBSD all have different kernels so potentially it might be required to split them out as separate platforms as follows.

[Flags]
public enum PlatformID
{
    Windows = 1,
    Linux = 2,
    OSX = 4,
    FreeBSD = 8,
    OpenBSD = 16, 
    NetBSD = 32, 
    DragonFlyBSD = 64, 
    Any = Windows | Linux | OSX | FreeBSD | OpenBSD | DragonFlyBSD
}

/cc: other members of portteam - @kangaroo, @josteink, @janhenke, @ajensenwaud
/bcc: @richlander - we need a label created for FreeBSD on this repo and this issue tagged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    os-freebsdFreeBSD OSos-linuxLinux OS (any supported distro)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions