Skip to content

Microsoft.NETCore.Platforms: support adding rids with '-' in the base part. - #84413

Merged
ericstj merged 2 commits into
dotnet:mainfrom
tmds:add_rid
Apr 6, 2023
Merged

Microsoft.NETCore.Platforms: support adding rids with '-' in the base part.#84413
ericstj merged 2 commits into
dotnet:mainfrom
tmds:add_rid

Conversation

@tmds

@tmdstmds commented Apr 6, 2023

Copy link
Copy Markdown
Member

Currently when trying to add a rid like 'linux-musl-x64' the rid is not understood to be base = 'linux-musl', arch = 'x64'.

Instead the parser considers a potential optional qualifier. This causes the rid to be parsed as base = 'linux', arch = 'musl', and qualifier = 'x64'.

We know the rids being added won't have a qualifier. If we take this into account while parsing, we can parse the rid correctly.

@ericstj ptal.

cc @ayakael

… part.
Currently when trying to add a rid like 'linux-musl-x64'
the rid is not understood to be base = 'linux-musl', arch = 'x64'.
Instead the parser considers a potential optional qualifier.
This causes the rid to be parsed as base = 'linux', arch = 'musl',
and qualifier = 'x64'.
We know the rids being added won't have a qualifier. If we take
this into account while parsing, we can parse the rid correctly.
@ghostghost added area-Infrastructure-libraries community-contribution Indicates that the PR has been added by a community member labels Apr 6, 2023
@ghost

ghost commented Apr 6, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently when trying to add a rid like 'linux-musl-x64' the rid is not understood to be base = 'linux-musl', arch = 'x64'.

Instead the parser considers a potential optional qualifier. This causes the rid to be parsed as base = 'linux', arch = 'musl', and qualifier = 'x64'.

We know the rids being added won't have a qualifier. If we take this into account while parsing, we can parse the rid correctly.

@ericstj ptal.

cc @ayakael

Author:tmds
Assignees:-
Labels:

area-Infrastructure-libraries, community-contribution

Milestone:-

@tmds
tmds requested a review from ericstjApril 6, 2023 11:31
@tmds

tmds commented Apr 6, 2023

Copy link
Copy Markdown
MemberAuthor

Interesting to know: os-release allows - in the base part:

ID=
A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_" and "-") identifying the operating system

@ericstjericstj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM modulo a nit. Thank you for the fix!

…ection.cs
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
@tmds

tmds commented Apr 6, 2023

Copy link
Copy Markdown
MemberAuthor

Thank you too for helping to get it fixed quickly @ericstj.

@ericstj

Copy link
Copy Markdown
Member

Build failures are reported and unrelated to this PR.

@ericstj
ericstj merged commit 238e3d3 into dotnet:mainApr 6, 2023
ayakael added a commit to ayakael/runtime that referenced this pull request Apr 7, 2023
@ghostghost locked as resolved and limited conversation to collaborators May 6, 2023
@carlossanlop

carlossanlop commented May 15, 2023

Copy link
Copy Markdown
Contributor

Do we need a 7.0 backport?
Edit: Confirmed with Eric that yes, we need one.

@carlossanlop

Copy link
Copy Markdown
Contributor

/backport to release/7.0-staging

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/7.0-staging: https://github.com/dotnet/runtime/actions/runs/4985461853

@github-actionsgithub-actionsBot unlocked this conversation May 15, 2023
@github-actionsgithub-actionsBot locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Infrastructure-librariescommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@tmds@ericstj@carlossanlop