Skip to content
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

Pack MIBC files #17513

Merged
merged 50 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6b19819
Pack MIBC files
psfinaki Aug 7, 2024
3f3153f
Update Directory.Build.targets
psfinaki Aug 8, 2024
afe74e3
temp
KevinRansom Aug 8, 2024
efa30cb
temp
KevinRansom Aug 9, 2024
11b14ab
mibc copies
KevinRansom Aug 9, 2024
f6ebb7b
Update fsc.targets
psfinaki Aug 9, 2024
22977e5
Update SourceBuildPrebuiltBaseline.xml
psfinaki Aug 9, 2024
f101b74
only F#
psfinaki Aug 9, 2024
8ba6e53
Update SourceBuildPrebuiltBaseline.xml
psfinaki Aug 9, 2024
9bff2d8
Update SourceBuildPrebuiltBaseline.xml
psfinaki Aug 9, 2024
1cdb488
Fix
vzarytovskii Aug 12, 2024
15a855a
don't bother for specific OS and stuff
psfinaki Aug 12, 2024
04d46e8
Update SourceBuildPrebuiltBaseline.xml
psfinaki Aug 12, 2024
217d0e7
Add forgotten applying to proto
vzarytovskii Aug 12, 2024
c46454e
Use linux pgo on mac
vzarytovskii Aug 12, 2024
869e3ae
fix locking files
vzarytovskii Aug 12, 2024
0386c3b
Try something
psfinaki Aug 12, 2024
d4062e9
revert
psfinaki Aug 12, 2024
9ce5b09
up
psfinaki Aug 14, 2024
0d56b97
up
psfinaki Aug 14, 2024
aca86c3
try something
psfinaki Aug 14, 2024
c4acbd0
Update Directory.Build.targets
psfinaki Aug 14, 2024
540b060
updates
psfinaki Aug 19, 2024
f349e6a
Pass arguments explicitly
vzarytovskii Aug 19, 2024
806062d
Merge branch 'main' into pgo-4
vzarytovskii Aug 19, 2024
ee0cc2c
Have an explicit task in proto
vzarytovskii Aug 19, 2024
beacded
Have an explicit task in proto
vzarytovskii Aug 19, 2024
478f8fa
Merge branch 'main' into pgo-4
vzarytovskii Aug 19, 2024
2b6259b
Should be good now?
vzarytovskii Aug 19, 2024
e920b9c
Merge branch 'pgo-4' of https://github.com/psfinaki/fsharp into pgo-4
vzarytovskii Aug 19, 2024
947da2f
Should be good now? Please
vzarytovskii Aug 19, 2024
decffa0
Merge branch 'main' into pgo-4
vzarytovskii Aug 19, 2024
346c655
Move restore baack
vzarytovskii Aug 20, 2024
8f7cca8
Merge branch 'pgo-4' of https://github.com/psfinaki/fsharp into pgo-4
vzarytovskii Aug 20, 2024
2757c54
Try something
psfinaki Aug 20, 2024
a1fb4de
hah
psfinaki Aug 20, 2024
386f882
well how bout this bro
psfinaki Aug 21, 2024
19478df
Update single-test.fs
psfinaki Aug 21, 2024
c4587c5
Update SourceBuildPrebuiltBaseline.xml
psfinaki Aug 21, 2024
9f9e5d1
Update optimizationData.targets
psfinaki Aug 21, 2024
df42c2d
oops
psfinaki Aug 22, 2024
11fbefd
Update optimizationData.targets
psfinaki Aug 22, 2024
f0de7e2
more hacks
psfinaki Aug 22, 2024
6126069
aaaaaand more hacks
psfinaki Aug 22, 2024
f454dd7
Merge branch 'main' into pgo-4
psfinaki Aug 22, 2024
e641163
up
psfinaki Aug 22, 2024
f0cbffd
Merge branch 'pgo-4' of https://github.com/psfinaki/fsharp into pgo-4
psfinaki Aug 22, 2024
ce37717
bad copypaste
psfinaki Aug 22, 2024
90d1336
oops
psfinaki Aug 22, 2024
0a8e1c8
Merge branch 'main' into pgo-4
psfinaki Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<RepoRoot Condition="'$(RepoRoot)' == ''">$(MSBuildThisFileDirectory)</RepoRoot>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<FSharpNetCoreProductDefaultTargetFramework>net9.0</FSharpNetCoreProductDefaultTargetFramework>
<IgnoreMibc Condition="'$(IgnoreMibc)' == ''">$(DotNetBuildFromSource)</IgnoreMibc>
</PropertyGroup>

<!--
Expand Down
15 changes: 15 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,19 @@
</KnownCrossgen2Pack>
</ItemGroup>

<!-- We want to restore ALL the MIBCs when we build anything, since in the future it will contain different profiles, not only the FSC one we got from building Giraffe -->
<Import Project="$(MSBuildThisFileDirectory)\eng\restore\optimizationData.targets"/>
<ItemGroup>
<PackageReference Include="@(MIBCPackage)" />
</ItemGroup>

<Target Name="CopyMIBCWrapper" AfterTargets="Restore" BeforeTargets="Build;Pack">
<MSBuild
Projects="$(MSBuildThisFileDirectory)eng\restore\optimizationData.targets"
Properties="ArtifactsDir=$(MSBuildThisFileDirectory)artifacts\;NuGetPackageRoot=$(NuGetPackageRoot);MibcFiles=$(MibcFiles);optimizationwindows_ntx86MIBCRuntimeVersion=$(optimizationwindows_ntx86MIBCRuntimeVersion);optimizationwindows_ntx64MIBCRuntimeVersion=$(optimizationwindows_ntx64MIBCRuntimeVersion);optimizationwindows_ntarm64MIBCRuntimeVersion=$(optimizationwindows_ntarm64MIBCRuntimeVersion);optimizationlinuxx64MIBCRuntimeVersion=$(optimizationlinuxx64MIBCRuntimeVersion);optimizationlinuxarm64MIBCRuntimeVersion=$(optimizationlinuxarm64MIBCRuntimeVersion)"
Targets="CopyMIBC"
RemoveProperties="TargetFramework"
StopOnFirstFailure="True" />
</Target>

</Project>
27 changes: 27 additions & 0 deletions eng/restore/optimizationData.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<!-- We want to restore ALL the MIBCs when we build anything, since in the future it will contain different profiles, not only the FSC one we got from building Giraffe -->
<ItemGroup Condition="'$(IgnoreMIBC)' != 'true'">
<MIBCPackage Include="optimization.windows_nt-x86.mibc.runtime" Version="$(optimizationwindows_ntx86MIBCRuntimeVersion)" />
<MIBCPackage Include="optimization.windows_nt-x64.mibc.runtime" Version="$(optimizationwindows_ntx64MIBCRuntimeVersion)" />
<MIBCPackage Include="optimization.windows_nt-arm64.mibc.runtime" Version="$(optimizationwindows_ntarm64MIBCRuntimeVersion)" />
<MIBCPackage Include="optimization.linux-x64.mibc.runtime" Version="$(optimizationlinuxx64MIBCRuntimeVersion)" />
<MIBCPackage Include="optimization.linux-arm64.mibc.runtime" Version="$(optimizationlinuxarm64MIBCRuntimeVersion)" />
</ItemGroup>

<!-- We copy all packages to the output (per architecture) -->
<Target Name="CopyMIBC">
<ItemGroup>
<MibcFiles Include="$(NuGetPackageRoot)%(MibcPackage.Identity)\%(MibcPackage.Version)\**\DotNet_FSharp.mibc" />
</ItemGroup>

<Copy
SourceFiles="@(MibcFiles)"
DestinationFolder="$(ArtifactsDir)mibc\%(MibcPackage.Identity)\"
SkipUnchangedFiles="true" />

<Copy
SourceFiles="@(MibcFiles)"
DestinationFolder="$(ArtifactsDir)mibc-proto\%(MibcPackage.Identity)\"
SkipUnchangedFiles="true" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<NuspecProperty Include="configuration=$(Configuration)" />
</ItemGroup>

<ItemGroup Condition="'$(IgnoreMibc)' != 'true'">
<NuspecProperty Include="mibcRoot=$(ArtifactsDir)\mibc" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\fsi\fsiProject\fsi.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\fsc\fscProject\fsc.fsproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
<file src="FSharp.Build\$configuration$\netstandard2.0\Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$configuration$\netstandard2.0\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />

<!-- PGO, MIBC -->
<file src="$mibcRoot$\**\*.mibc" target="contentFiles\mibc" />

<!-- resources -->
<file src="FSharp.Core\$configuration$\netstandard2.0\**\FSharp.Core.resources.dll"
target="lib\$fSharpNetCoreProductTargetFramework$" />
Expand Down
13 changes: 13 additions & 0 deletions src/fsc/fscProject/fsc.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Proto'">
<MibcTargetOS>linux</MibcTargetOS>
<!-- We deliberately want to use linux mibc pgo data on macOS -->
<MibcTargetOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">linux</MibcTargetOS>
<MibcTargetOS Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">windows_nt</MibcTargetOS>
<MibcTargetArchitecture>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</MibcTargetArchitecture>
<MibcCurrentMachineArcitecture>$(MibcTargetOS)-$(MibcTargetArchitecture)</MibcCurrentMachineArcitecture>
<MibcFile>$(ArtifactsDir)mibc-proto\optimization.$(MibcCurrentMachineArcitecture).mibc.runtime\DotNet_FSharp.mibc</MibcFile>

<TargetFramework>$(FSharpNetCoreProductTargetFramework)</TargetFramework>
<PublishReadyToRun>$(EnablePublishReadyToRun)</PublishReadyToRun>
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
<ReadyToRunOptimizationData>$(MibcFile)</ReadyToRunOptimizationData>
</PropertyGroup>

<ItemGroup Condition="'$(Configuration)' == 'Proto'">
Expand All @@ -24,6 +33,10 @@
<IntermediateOutputPath>$(ArtifactsDir)obj/$(MSBuildProjectName)/$(Configuration)/</IntermediateOutputPath>
</PropertyGroup>

<Target Name="ValidateMibcFile" AfterTargets="CopyMIBC" BeforeTargets="Build;Pack" Condition="'$(IgnoreMibc)' != 'true'">
<Error Condition="'$(Configuration)' == 'Proto' AND !Exists('$(MibcFile)')" Text="Mibc file '$(MibcFile)' does not exist." />
</Target>

<Import Project="$([MSBuild]::GetPathOfFileAbove('fsc.targets', '$(MSBuildThisFileDirectory)../'))" />

</Project>
1 change: 1 addition & 0 deletions tests/fsharp/single-test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ let generateProjectArtifacts (pc:ProjectConfiguration) outputType (targetFramewo
<RestoreAdditionalProjectSources Condition = "" '$(RestoreAdditionalProjectSources)' == ''"">$(RestoreFromArtifactsPath)</RestoreAdditionalProjectSources>
<RestoreAdditionalProjectSources Condition = "" '$(RestoreAdditionalProjectSources)' != ''"">$(RestoreAdditionalProjectSources);$(RestoreFromArtifactsPath)</RestoreAdditionalProjectSources>
<RollForward>LatestMajor</RollForward>
<IgnoreMIBC>true</IgnoreMIBC>
</PropertyGroup>

<!-- FSharp.Core reference -->
Expand Down
Loading