-
Notifications
You must be signed in to change notification settings - Fork 564
[build] Extend dotnet build support on unix #6585
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <!-- | ||
| See https://github.com/xamarin/xamarin-android/commit/ceca993068c0401f664676db85edec1d772bf5ff | ||
| --> | ||
| <Project> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="$(PkgMono_Unix)\runtimes\linux-x64\native\libMono.Unix.so" CopyToOutputDirectory="PreserveNewest" /> | ||
| <_MonoUnixDylib Include="$(PkgMono_Unix)\runtimes\osx-arm64\native\libMono.Unix.dylib" Condition=" '$(HostOS)' == 'Darwin' " /> | ||
| <_MonoUnixDylib Include="$(PkgMono_Unix)\runtimes\osx-x64\native\libMono.Unix.dylib" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <_MonoUnixOutputDylib>$(OutputPath)\libMono.Unix.dylib</_MonoUnixOutputDylib> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="_MakeMonoUnixFatBinariesOSX" | ||
| Inputs="@(_MonoUnixDylib)" | ||
| Outputs="$(_MonoUnixOutputDylib)"> | ||
| <Exec | ||
| Command="lipo @(_MonoUnixDylib->'"%(FullPath)"', ' ') -create -output "$(_MonoUnixOutputDylib)"" | ||
| Condition=" '$(HostOS)' == 'Darwin' " | ||
| /> | ||
| <Copy | ||
| SourceFiles="@(_MonoUnixDylib)" | ||
| DestinationFolder="$(OutputPath)" | ||
| Condition=" '$(HostOS)' != 'Darwin' " | ||
| /> | ||
| </Target> | ||
|
|
||
| </Project> |
This file contains hidden or 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 hidden or 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
Submodule debugger-libs
updated
26 files
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -316,8 +316,7 @@ | |
| <Target Name="ILRepacker" | ||
| BeforeTargets="CopyFilesToOutputDirectory" | ||
| Inputs="$(MSBuildAllProjects);@(IntermediateAssembly);@(InputAssemblies)" | ||
| Outputs="$(IntermediateOutputPath)ILRepacker.stamp" | ||
| Condition=" '$(HostOS)' != 'Linux' "> | ||
|
Contributor
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. Can anyone remember the reason why we disabled this in the first place?
Contributor
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. It used to crash on Linux under Mono |
||
| Outputs="$(IntermediateOutputPath)ILRepacker.stamp" > | ||
| <ItemGroup> | ||
| <_InputAssembliesThatExist Include="@(InputAssemblies)" Condition="Exists('%(Identity)')" /> | ||
| <_NetstandardPath Include="@(ReferencePath->'%(RootDir)%(Directory)')" Condition="'%(FileName)%(Extension)' == 'netstandard.dll'" /> | ||
|
|
@@ -356,36 +355,9 @@ | |
|
|
||
| <_ExtraPackageSource Include="$(PkgMono_Unix)\lib\$(TargetFrameworkNETStandard)\Mono.Unix.dll" /> | ||
| <_ExtraPackageTarget Include="$(OutputPath)\Mono.Unix.dll" /> | ||
|
|
||
| <_ExtraPackageSource Include="$(PkgMono_Unix)\runtimes\linux-x64\native\libMono.Unix.so" /> | ||
| <_ExtraPackageTarget Include="$(OutputPath)\libMono.Unix.so" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <_MonoUnixDylib Include="$(PkgMono_Unix)\runtimes\osx-arm64\native\libMono.Unix.dylib" Condition=" '$(HostOS)' == 'Darwin' " /> | ||
| <_MonoUnixDylib Include="$(PkgMono_Unix)\runtimes\osx-x64\native\libMono.Unix.dylib" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <_MonoUnixOutputDylib>$(OutputPath)\libMono.Unix.dylib</_MonoUnixOutputDylib> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- | ||
| On operating systems other than macOS we just need to copy a single .dylib, so that pack creation works | ||
| --> | ||
| <Target Name="_MakeMonoUnixFatBinariesOSX" | ||
| Inputs="@(_MonoUnixDylib)" | ||
| Outputs="$(_MonoUnixOutputDylib)"> | ||
| <Exec | ||
| Command="lipo @(_MonoUnixDylib->'"%(FullPath)"', ' ') -create -output "$(_MonoUnixOutputDylib)"" | ||
| Condition=" '$(HostOS)' == 'Darwin' " | ||
| /> | ||
| <Copy | ||
| SourceFiles="@(_MonoUnixDylib)" | ||
| DestinationFolder="$(OutputPath)" | ||
| Condition=" '$(HostOS)' != 'Darwin' " | ||
| /> | ||
| </Target> | ||
| <Import Project="$(XamarinAndroidSourcePath)build-tools\scripts\MonoUnixNative.targets" /> | ||
|
|
||
| <!-- Copy package ref symbols for our installers. '$(Pkg*)' props are set during NuGet restore when GeneratePathProperty="true" --> | ||
| <Target Name="_CopyExtraPackageContent" | ||
|
|
||
This file contains hidden or 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
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.
Should
DOTNET_BINLOGadd the-m:1, so this is set in one place?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'm not sure if we want to set it for every
dotnetinvocation as we should only need it when building Xamarin.Android.sln.I haven't found great documentation on this parameter though. Neither the command line docs (below) or this guide mention whether or not this is a "solution only" flag, or if it also works on projects with multiple project references.
-maxCpuCount[:n] Specifies the maximum number of concurrent processes to build with. If the switch is not used, the default value used is 1. If the switch is used without a value MSBuild will use up to the number of processors on the computer. (Short form: -m[:n])The command line docs aren't consistent with what I see locally either. The Xamarin.Android.sln build fails for me in lots of weird ways if
-m:1isn't set (even though the docs suggest the default value should be 1, which I assume would be "no parallelization" ). I know we had to set this explicitly on the Windows .sln build in the past for similar reasons as well.The overall mac build job does seem faster in general in this PR, but I haven't done any digging into how much time is saved by 1) skipping the OSS zip creation, 2) using dotnet build more, or even the potential of 3) having more parallelization in some build commands by default.
My inclination is to keep it mostly as is, and only specify the
-mflag when we know something breaks without it.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.
Sounds good, we can leave
-m:1for now.