-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix rid processing on macOS #60494
fix rid processing on macOS #60494
Conversation
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue Details#59066 made some changes how we calculate RID on macOS and it was not quite right. The test was failing because there was embedded '\0'. So even if we add the architecture, that would be stripped with There is still another problem. The way how the old code was written we would always return For 12.0+ the rid will be fixes #60341
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Co-authored-by: Vitek Karas <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
Regression was after 6.0 fork right? |
I don't understand this -- where was the embedded '\0'? |
This comes from @agocke runtime/src/native/corehost/hostmisc/pal.unix.cpp Lines 592 to 595 in 1c949ac
With the current code and runtime/src/native/corehost/hostmisc/utils.cpp Lines 211 to 221 in 1c949ac
So it seems like if we construct |
yes. But we should take both to 6.0 - either now or via servicing as the original intent is to support macOS 12. |
LLVM AOT looks like infrastructure unrelated to the change. |
size = pos - str; | ||
|
||
} | ||
else if (major == 12) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this read else if (major == 11)
? I think line 594 will never execute because, if major==12
, line 587 executes instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that too. Here is a PR to fix: #60668
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this should not be there. It somehow sneaked in when I was trying to remove the extra size calculation ;(
* fix rid processing on macOS * Update src/native/corehost/hostmisc/pal.unix.cpp * Update src/native/corehost/hostmisc/pal.unix.cpp * remove extra size calculation
* RID work for macOS 12 (#59066) * fix rid processing on macOS (#60494) * fix rid processing on macOS * Update src/native/corehost/hostmisc/pal.unix.cpp * Update src/native/corehost/hostmisc/pal.unix.cpp * remove extra size calculation * Fix "fix rid processing on macOS" (#60668) The `else if (major == 12)` is dead code, since the previous if `if (major > 11)` would be true for `major == 12`. Judging by the comment and code, it looks like the intention of this `else if` statement was to match `major == 11`. * add the packaging for platforms package Co-authored-by: Austin Wise <[email protected]> Co-authored-by: Anirudh Agnihotry <[email protected]>
#59066 made some changes how we calculate RID on macOS and it was not quite right.
The test was failing because there was embedded '\0'. So even if we add the architecture, that would be stripped with
.c_str
. It actually worked for11.2.3
I started with but failed on11.2
(no real ARM dependency IMHO)There is still another problem. The way how the old code was written we would always return
osx.11.0
fromget_current_os_rid_platform
even for 11.6. That does not break the test but then when we walk the graph we would end up with genericosx-arm64
. So to maintain compatibility, I added special processing for 11.x (and verified with dotnet --info)For 12.0+ the rid will be
osx.12-arm64
and that match<Versions>10.10;10.11;10.12;10.13;10.14;10.15;10.16;11.0;12</Versions>
fixes #60341