Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Dec 8, 2023

CoreLib is an OS-specific library. Using the same intermediate output path for different OSes can lead to using stale artifacts such as ILLink descriptors.

CoreLib is an OS-specific library. Using the same intermediate output path for
different OSes will lead to using stale artifacts such as ILLink descriptors.
@ghost ghost added area-Infrastructure-coreclr community-contribution Indicates that the PR has been added by a community member labels Dec 8, 2023
@ghost
Copy link

ghost commented Dec 8, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

CoreLib is an OS-specific library. Using the same intermediate output path for different OSes will lead to using stale artifacts such as ILLink descriptors.

Author: SingleAccretion
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

<BaseIntermediateOutputPath Condition="'$(IsNativeAotProject)' == 'true'">$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', 'coreclr', 'nativeaot', '$(MSBuildProjectName)'))</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(TargetOS).$(TargetArchitecture).$(Configuration)\</IntermediateOutputPath>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the Condition be different now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see reason to change it. It's basically testing for "is this library target-specific".

@SingleAccretion SingleAccretion marked this pull request as ready for review December 8, 2023 19:57
@am11
Copy link
Member

am11 commented Dec 9, 2023

@ViktorHofer, @akoeplinger, this seems like something we can consolidate repo-wide. Makes sense to not mix win-x64 stuff with linux-x64 under obj/. Mono and libraries have similar requirements PlatformName wasn't the best choice for this.

@akoeplinger
Copy link
Member

I agree.

@SingleAccretion
Copy link
Contributor Author

I agree it would make sense to make the same change in not-coreclr, but I myself am not familiar enough with the infrastructure of other directories to make the change with confidence.

@am11
Copy link
Member

am11 commented Dec 10, 2023

Yup, it was something for the future. Nice find! :)
(normally we move these common props to top level Directory.Build.props file and clean up the redundant definitions in project folders; or derive the props from arcade directly)

@akoeplinger akoeplinger changed the title Make the intermediate output path OS-specific for CoreCLR Make the intermediate output path OS-specific for CoreCLR/Mono Dec 11, 2023
@akoeplinger
Copy link
Member

akoeplinger commented Dec 11, 2023

I checked and libraries shouldn't be affected since they're including the TFM (which includes the OS for libraries) in their intermediate folder. I applied this change to src/mono as well, this should cover the missing piece.

@ViktorHofer
Copy link
Member

Agreeing with @akoeplinger, the libraries subset shouldn't be touched as:

  • It compiles as AnyCPU so an architecture doesn't need to be encoded in the paths
  • The TargetPlatformMoniker is already encoded in the paths as part of the TargetFramework.

@akoeplinger
Copy link
Member

Thanks for fixing this! I hit this a while ago and it was very annoying but then I forgot to track it down :)

@SingleAccretion SingleAccretion deleted the OS-Specific-CoreLib branch January 10, 2024 21:04
@github-actions github-actions bot locked and limited conversation to collaborators Feb 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants