-
Notifications
You must be signed in to change notification settings - Fork 156
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
IDEA: build FSAC standalone binaries for each OS/Arch/TFM #1258
Draft
baronfel
wants to merge
3
commits into
ionide:main
Choose a base branch
from
baronfel:build-arch-specific-binaries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,5 @@ test/FsAutoComplete.Tests.Lsp/TestResults/ | |
.tool-versions | ||
BenchmarkDotNet.Artifacts/ | ||
|
||
*.sarif | ||
*.sarif | ||
artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,11 @@ | |
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFrameworks>net6.0</TargetFrameworks> | ||
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> | ||
<TargetFrameworks Condition="'$(BuildNet7)' == 'true'">net6.0;net7.0</TargetFrameworks> | ||
<TargetFrameworks Condition="'$(BuildNet8)' == 'true'">net6.0;net7.0;net8.0</TargetFrameworks> | ||
Comment on lines
6
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WIP: we could potentially remove all of the BuildNetX stuff if we built/tested standalone binaries. |
||
<RuntimeIdentifiers> | ||
win-x64;linux-x64;linux-arm64;osx-x64;osx-arm64;linux-musl-x64;linux-musl-arm64</RuntimeIdentifiers> | ||
<AssemblyName>fsautocomplete</AssemblyName> | ||
<ServerGarbageCollection>true</ServerGarbageCollection> | ||
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection> | ||
|
@@ -17,6 +19,10 @@ | |
<SatelliteResourceLanguages>en</SatelliteResourceLanguages> | ||
<IsPackable>true</IsPackable> | ||
<PackAsTool>true</PackAsTool> | ||
<PublishSingleFile>true</PublishSingleFile> | ||
<PublishSelfContained>true</PublishSelfContained> | ||
<DebugType>embedded</DebugType> | ||
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="../../README.md" Pack="true" PackagePath="\" /> | ||
|
@@ -64,6 +70,12 @@ | |
<TargetsForTfmSpecificBuildOutput> | ||
$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Label="Trimming Settings"> | ||
<TrimmerRootAssembly Include="Serilog" /> | ||
<TrimmerRootAssembly Include="Ionide.ProjInfo.ProjectSystem" /> | ||
</ItemGroup> | ||
|
||
<!-- workaround for not being able to have p2p dependencies in tool output dir | ||
https://github.com/nuget/home/issues/3891#issuecomment-377319939 --> | ||
<Target Name="CopyProjectReferencesToPackage" DependsOnTargets="ResolveReferences"> | ||
|
@@ -72,5 +84,37 @@ | |
Include="@(ReferenceCopyLocalPaths -> WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
<Target Name="BuildAllStandloneApplications"> | ||
<ItemGroup> | ||
<!-- Make MSBuild Items out of the RIDs so we can batch across them --> | ||
<_RIDS Include="$(RuntimeIdentifiers)" /> | ||
<!-- Make MSBuild Items out of the TFMs so we can batch across them. Create NUM_RIDS items | ||
per-TFM because we want to build each TFM for all supported platforms. --> | ||
<_TFMS | ||
Include="$(TargetFrameworks)" | ||
RID="%(_RIDS.Identity)" /> | ||
<!-- Turn the _TFMS items into requests to build this project (fsautocomplete.fsproj) with | ||
different parameters. This pattern is often used to to parallel builds of the same project in | ||
MSBuild logic. --> | ||
<_RIDSpecificFSACBuild | ||
Include="$(MSBuildThisFile)" | ||
AdditionalProperties="RuntimeIdentifier=%(_TFMS.RID);TargetFramework=%(_TFMS.Identity)" /> | ||
</ItemGroup> | ||
|
||
<!-- Ask MSBuild to build all of the requests we just made. The MSBuild Task recognizes the | ||
AdditionalProperties metadata and will apply that to each specific build, we can specify the things | ||
that are common to all of the builds here. Unsetting RuntimeIdentifiers and TargetFrameworks | ||
ensures that the SDK targets detect that these are single-RID/single-TFM builds accurately, and | ||
since we're pretty certain there are no data dependencies here we can have the builds operate in | ||
parallel. --> | ||
<MSBuild | ||
Projects="@(_RIDSpecificFSACBuild)" | ||
Targets="Publish" | ||
Properties="Configuration=Release;SelfContained=true" | ||
RemoveProperties="RuntimeIdentifiers;TargetFrameworks" | ||
BuildInParallel="true" /> | ||
</Target> | ||
|
||
<Import Project="..\..\.paket\Paket.Restore.targets" /> | ||
</Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think if we go down this path, we should move to requiring .NET 8 and use the artifacts layout to simplify out outputs.