-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use arcade power source build infra #58651
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
cc @ViktorHofer & @wfurt to look at the change. |
@@ -128,7 +128,7 @@ | |||
</ItemGroup> | |||
|
|||
<!-- Support for deploying msquic --> | |||
<ItemGroup Condition="'$(TargetsWindows)' == 'true' and | |||
<ItemGroup Condition="'$(_hostOS)' == 'windows' and |
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.
That's an internal property. Don't we have a better one to use? cc @am11
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.
Would also be good to add a comment explaining why TargetsWindows can't be used here. I don't know that either yet.
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.
Note that Targets{OSName}
properties in top level Directory.Build.props do not get set for src/libraries, we set them in eng/targetframeworksuffix.props
. It would be nice to get rid of whole SkipInferTargetOSName
mechanism and just use the top-level Directory.Build.props, unless it is impossible to consolidate (which I don't think is the case).
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 can add the comment. but the explaination is
The non portable build triggers all config build which build this project for net6.0-windows
on linux, hence targetsWIndows
is true but the runtime is linux so all the BinPlaceDir
are linux directories and thee file gets binplaced with the linux runtime.
i think we want to binplace it in the runtime when we arre building on windows, i added @wfurt to verify that
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.
comment would be always good. We should package this only for Windows runtime - regardless where this is build. if _hostOS
is the right variables I'm fine with that.
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.
That's an internal property.
Correct, properties with _
indicate "do no use outside of this file" and can break in the future. We have managed to avoid using these internal properties elsewhere. Since this is the first use-case of HostOS outside of Directory.Build.props
, we can (unconditionally) define <HostOS>$(_hostOS)</HostOS>
between these two lines:
Lines 20 to 21 in 1cd5033
<_hostOS Condition="'$(TargetOS)' == 'Browser'">Browser</_hostOS> | |
<TargetOS Condition="'$(TargetOS)' == ''">$(_hostOS)</TargetOS> |
and then in the following lines of Directory.Build.props and here, use
$(HostOS)
.
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.
Why can't we use TargetOS
here instead?
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 it's because of the non-portable build which @Anipik alluded above: #58651 (comment)
But is this the only place in the entire build infra where it is applicable? If not, what is the alternative way of solving it, maybe we should use that approach to keep it consistent?
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.
But the sourcebuild leg sets the OS to Linux in the yml, why would the TargetOS be "Windows" then?
osGroup: Linux |
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.
TargetsWindows = true
is true in the innerbuilds when we dispatch innerbuild from net6.0-windows.
- template: /eng/common/templates/steps/source-build.yml | ||
parameters: | ||
platform: | ||
buildScript: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) |
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.
Is that the right command to invoke? cc @MichaelSimons
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 so. This is just the build script, the template defaults to specify all of the correct args.
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.
And is the _sclEnableCommand still needed?
value: scl enable llvm-toolset-7.0 -- |
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.
yes otherwise we get clang failures.
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.
With these changes, will the Microsoft.SourceBuild.Intermediates.* packages get published during internal CI runs?
This was the first step, i was thinking of adding it a separate change but i think i can push the change here only |
corressponding internal build |
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 don't have an in-depth knowledge of the runtime pipelines but the source-build specific parts LGTM.
src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
Outdated
Show resolved
Hide resolved
@@ -128,7 +128,8 @@ | |||
</ItemGroup> | |||
|
|||
<!-- Support for deploying msquic --> | |||
<ItemGroup Condition="'$(TargetsWindows)' == 'true' and | |||
<!-- Native msquic assemblies should only be binplaced while running on windows. --> | |||
<ItemGroup Condition="'$(HostOS)' == 'windows' and |
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.
This is a bit of conflation. Nothing about building on a Windows machine means that these files are present. Targeting is the right concept. Can we instead just exclude this from source build? Since presumably the reason this isn't available is because we aren't building the dependent package as part of source build.
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 actually surprised that the PackageReference worked but this didn't. What failed that led you to add this?
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 actually surprised that the PackageReference worked but this didn't. What failed that led you to add this?
sourcebuild leg failed.
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.
Of course something failed, how did it fail and why?
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.
Can we instead just exclude this from source build?
SourceBuild leg if run on windows will not contain this file in the targeting pack.
Targeting is the right concept.
why is the targeting the right concept here, we are binplacing the file in the runtime folders, shouldnt we check the runtime we are running on before binplacing ?
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.
Of course something failed, how did it fail and why?
the missing fileVersion error.
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.
shouldnt we check the runtime we are running on before binplacing ?
The runtime we're running on has nothing to do with the product we are building, though it is sometimes related. We could technically build all of libraries for Linux from a windows machine (and we used to do so at the start of .NETCore).
BinPlacing is supposed to involve a calculation on "best applicable configuration". Typically we only binplace when the configuration being built is the best for a given target. https://github.com/dotnet/arcade/blob/22d90b34fe210ca9f85ea1896eda29f2de55f826/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/BinPlace.targets#L122
It looks like this project is bypassing that by directly defining BinPlaceDir items. In that case, this condition needs to do the work that would have been done by ChooseBestTargetFrameworksTask: the concept shouldn't be "host OS" but should be "target runtime for the vertical". It looks like this should be TargetOS
.
I'm still dubious about MSQuic packagereference though. @MichaelSimons does this package even get built in source build repos? Shouldn't we exclude the PackageReference?
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 still dubious about MSQuic packagereference though. @MichaelSimons does this package even get built in source build repos? Shouldn't we exclude the PackageReference?
It does not get produced by source-build today. Additionally system.net.msquic.transport
is showing up as a prebuilt. Excluding the PackageReference seems like the good approach for source-build.
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.
The runtime we're running on has nothing to do with the product we are building, though it is sometimes related. We could technically build all of libraries for Linux from a windows machine
i thought this applied to managed assemblies, i thought we cant build the native assemblies cross platform ?
@@ -101,7 +101,8 @@ | |||
<PackageReference Include="System.Net.MsQuic.Transport" | |||
Version="$(SystemNetMsQuicTransportVersion)" | |||
PrivateAssets="all" | |||
GeneratePathProperty="true" /> | |||
GeneratePathProperty="true" | |||
Condition="'$(DotNetBuildFromSource)' != 'true'" /> |
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 this same condition be applied to the target which consumes the file from this package?
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.
its used for interop calls mostly, no specific target uses this file
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.
LGTM modulo the one comment about the target condition
@@ -129,7 +130,7 @@ | |||
|
|||
<!-- Support for deploying msquic --> | |||
<ItemGroup Condition="'$(TargetsWindows)' == 'true' and | |||
('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86')"> | |||
('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'x86') and '$(DotNetBuildFromSource)' != 'true'"> | |||
<BinPlaceDir Include="$(MicrosoftNetCoreAppRuntimePackNativeDir)" ItemName="NativeBinPlaceItem" /> |
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.
Not for this PR, but something to consider moving forward is that this fails silently if that quic package changes it's shape. It might be good to avoid a wildcard here. We should be explicit about things which we end up shipping in the shared framework.
Failure is a known xunit bug, |
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1235139018 |
Related to #54573