Skip to content

ArPow stage 1: local source-build infrastructure#51765

Merged
333fred merged 11 commits intodotnet:features/source-buildfrom
MichaelSimons:ArPow-Phase1-2
Apr 21, 2021
Merged

ArPow stage 1: local source-build infrastructure#51765
333fred merged 11 commits intodotnet:features/source-buildfrom
MichaelSimons:ArPow-Phase1-2

Conversation

@MichaelSimons
Copy link
Member

This PR adds the local build infrastructure that lets ArPow (arcade-powered source-build) run in this repo. See https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/onboarding/local-onboarding.md for more details about how it works.

To try it out locally, run this on Linux: ./build.sh -c Release --restore --build --pack /p:ArcadeBuildFromSource=true -bl

This PR should have no effect on ordinary builds, or CI. ArPow stage 2 will add source-build to CI: PR validation and official builds.

For https://github.com/dotnet/source-build/blob/master/Documentation/planning/arcade-powered-source-build/implementation-plan.md

Related to #dotnet/source-build#2071

This PR is currently blocked by the work to bring in Arcade 6.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue should get addressed before merging.

@333fred
Copy link
Member

333fred commented Mar 9, 2021

This PR should have no effect on ordinary builds, or CI. ArPow stage 2 will add source-build to CI: PR validation and official builds.

We already have a CI leg for source-build, I think we should update that in the same PR. It's this section of the YAML: https://github.com/dotnet/roslyn/blob/main/azure-pipelines.yml#L201-L223.

@333fred 333fred added the Source-Build Tracking dotnet/source-build related tasks. label Mar 9, 2021
@333fred
Copy link
Member

333fred commented Mar 9, 2021

@MichaelSimons were you actually expecting a review at this stage?

@MichaelSimons
Copy link
Member Author

were you actually expecting a review at this stage?

I'm not expecting a review until the Arcade 6.0 blocking issue is resolved. That being said I would appreciate any initial comments such the CI one @333fred made.

Conflicts:
	eng/Version.Details.xml
Conflicts:
	azure-pipelines.yml
@MichaelSimons MichaelSimons marked this pull request as ready for review April 19, 2021 21:30
@MichaelSimons MichaelSimons requested review from a team as code owners April 19, 2021 21:30
@MichaelSimons
Copy link
Member Author

@dseefeld, @333fred - this is ready for review now.

@333fred
Copy link
Member

333fred commented Apr 19, 2021

@MichaelSimons there are a large number of patches here. Why so many? At one point in the 2.2-3.0 timeframe we had removed all the patches from source-build for roslyn, but we appear to have to have added more back since then, for things that really could and should have been fixed in source directly rather than having source-build silently add patches without telling us. Some I don't really understand at all, such as the one that adds IsExternalInit: the compiler would not build without this type defined. I honestly don't feel particularly comfortable adding so many patch files that touch so much of the infrastructure directly, even if the goal is to immediately remove them.

diff --git a/src/Compilers/CSharp/Portable/Binder/LocalBinderFactory.cs b/src/Compilers/CSharp/Portable/Binder/LocalBinderFactory.cs
index 07c5b16..3522dfa 100644
--- a/src/Compilers/CSharp/Portable/Binder/LocalBinderFactory.cs
+++ b/src/Compilers/CSharp/Portable/Binder/LocalBinderFactory.cs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This touches too many files to realistically maintain for any amount of time as a patch.

@MichaelSimons MichaelSimons changed the base branch from main to features/source-build April 20, 2021 20:56
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion and one question before merging.

From: Chris Rummel <crummel@microsoft.com>
Date: Fri, 4 Sep 2020 11:50:51 -0500
Subject: [PATCH 6/6] Dirty revert of
https://github.com/dotnet/roslyn/issues/10785
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't have to be resolved right now, but @crummel what is this doing? This seems like it introduces a bug?

From ed6e61977542a2fb1f69da41eb9806a4212d4046 Mon Sep 17 00:00:00 2001
From: Davis Goodin <dagood@microsoft.com>
Date: Mon, 28 Dec 2020 18:21:27 -0600
Subject: [PATCH] Build Roslyn as net6.0 in source-build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredpar this patch may end up being a bit troublesome. Not sure what you think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this patch is problematic. It's essentially forcing us to support running on netcoreapp3.1 even though our code is developed with the assumption that this is just not possible.

What is the reasoning behind this? If we actually need to support netcoreapp3.1 then we may have to accept that. But even so I'd just add it back into the main tree. As long as it exists as a patch like this we're just going to be breaking support left and right here. It's not sustainable.

/p:TreatWarningsAsErrors=true \
/p:TestRuntimeAdditionalArguments=$test_runtime_args \
/p:DotNetBuildFromSource=$source_build \
/p:ArcadeBuildFromSource=$source_build \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this cause arcade to set the DotNetBuildFromSource environment variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DotNetBuildFromSource is still the appropriate variable to use when conditionalizing for source-build.

@MichaelSimons
Copy link
Member Author

@MichaelSimons there are a large number of patches here. Why so many? At one point in the 2.2-3.0 timeframe we had removed all the patches from source-build for roslyn, but we appear to have to have added more back since then, for things that really could and should have been fixed in source directly rather than having source-build silently add patches without telling us.

We (source-build devs and Fred from Roslyn) met on this. The pain and frustration of the patch maintenance and quality is one of the major reasons for the ArPow effort. The current source-build strategy has many flaws/downsides. After the discussion, a decision was made to use a feature branch to commit the ArPow infra and then work to remove the patches before merging to main. Source-build folks will be responsible for the ArPow infra and Roslyn folks will be responsible for the patch removal with assistance from source-build folks on understanding why patches are needed.

Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to go ahead and merge this into the feature branch for now, and we'll work on getting the patches actually merged into the repo. @MichaelSimons and @crummel, there are a couple of questions that need to be answered as well, but I'm not going to hold up the merge since we'll need to address them in follow ups anyway.

@333fred 333fred merged commit 2e0058d into dotnet:features/source-build Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure Source-Build Tracking dotnet/source-build related tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants