dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.62k stars 4.56k forks source link

Unify tryrun scripts #86829

Open MichalStrehovsky opened 1 year ago

MichalStrehovsky commented 1 year ago

https://github.com/dotnet/runtime/pull/86781#discussion_r1207000325

We have tryrun.cmake that is mostly used for -cross builds.

Then we have similar things in runtime/src/native/libs/configure.cmake and https://github.com/dotnet/runtime/blob/main/eng/native/tryrun_ios_tvos.cmake.

We should reconcile this.

Related: #56622

ghost commented 1 year ago

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

Issue Details
https://github.com/dotnet/runtime/pull/86781#discussion_r1207000325 We have tryrun.cmake that is mostly used for `-cross` builds. Then we have similar things in [runtime/src/native/libs/configure.cmake](https://github.com/dotnet/runtime/blob/c5256458235e00c4bc4634c3cc389fefdd4c10d8/src/native/libs/configure.cmake#L572-L605) and https://github.com/dotnet/runtime/blob/main/eng/native/tryrun_ios_tvos.cmake. We should reconcile this. Related: #56622
Author: MichalStrehovsky
Assignees: -
Labels: `area-Infrastructure-libraries`, `os-android`
Milestone: -
janvorli commented 1 year ago

@MichalStrehovsky the tryrun.cmake contains values for cross build that the configure.cmake would detect if the build was executed on the target OS. It is used only for checks that execute code, so they cannot be evaluated on the build hosting OS. This is a cmake concept - the tryrun.cmake is meant to be separate, as it is loaded by cmake as an initialization of its cache. It is not clear to me how we could reasonably unify these.

MichalStrehovsky commented 1 year ago

@MichalStrehovsky the tryrun.cmake contains values for cross build that the configure.cmake would detect if the build was executed on the target OS. It is used only for checks that execute code, so they cannot be evaluated on the build hosting OS.

Yes, it's the same thing that the quoted part of configure.cmake is also doing. It's not clear why we spread these around the codebase

janvorli commented 1 year ago

Oh, I am surprised to see it in the configure.cmake in libraries. The ones in coreclr don't have that, they use the tryrun.cmake.

ViktorHofer commented 12 months ago

@akoeplinger as you are assigned, should this stay in 8.0.0 or be moved?

akoeplinger commented 12 months ago

@ViktorHofer it can stay in 8.0 for now

ilonatommy commented 1 week ago

@akoeplinger, this looks like a fast cleanup issue, will you have capacity for it?

akoeplinger commented 1 week ago

Hopefully 😄