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

Enable source-build through arcade #1823

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes.
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -projects """%~dp0illink.sln""" -restore -build %*"
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*"
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ while [[ -h $source ]]; do
done

scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
"$scriptroot/eng/common/build.sh" --projects "$scriptroot/illink.sln" --build --restore $@
"$scriptroot/eng/common/build.sh" --build --restore $@
17 changes: 17 additions & 0 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<ItemGroup>

<ProjectToBuild Include="$(RepoRoot)src\linker\Mono.Linker.csproj" />
<ProjectToBuild Include="$(RepoRoot)src\ILLink.Tasks\ILLink.Tasks.csproj" />
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests\Mono.Linker.Tests.csproj" />
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests.Cases\Mono.Linker.Tests.Cases.csproj" />
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\Mono.Linker.Tests.Cases.Expectations\Mono.Linker.Tests.Cases.Expectations.csproj" />
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)src\analyzer\analyzer.csproj" />
<ProjectToBuild Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(RepoRoot)test\ILLink.Tasks.Tests\ILLink.Tasks.Tests.csproj" />
<ProjectToBuild Include="$(RepoRoot)src\ILLink.RoslynAnalyzer\ILLink.RoslynAnalyzer.csproj" />
<ProjectToBuild Include="$(RepoRoot)test\ILLink.RoslynAnalyzer.Tests\ILLink.RoslynAnalyzer.Tests.csproj" />
<ProjectToBuild Include="$(RepoRoot)src\linker\ref\Mono.Linker.csproj" />
<ProjectToBuild Include="$(RepoRoot)src\tlens\tlens.csproj" />

</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<PropertyGroup>
<GitHubRepositoryName>linker</GitHubRepositoryName>
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<UsageData>
<IgnorePatterns>
<UsagePattern IdentityGlob="*/*" />
</IgnorePatterns>
</UsageData>
5 changes: 5 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21105.12">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>938b3e8b4edcd96ca0f0cbbae63c87b3f51f7afe</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21105.12">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand All @@ -14,6 +15,10 @@
<Dependency Name="Microsoft.NET.Sdk.IL" Version="6.0.0-preview.3.21121.7">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>49cfb3507c586b539d0652814defbbc9e3073f16</Sha>
<!--
This would introduce a cyclic dependency, so it's explictly not enabled for now
<SourceBuild RepoName="runtime" />
-->
</Dependency>
</ToolsetDependencies>
</Dependencies>
16 changes: 16 additions & 0 deletions eng/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ stages:
testResultsFormat: vstest
enablePublishBuildAssets: true # generate build manifests and publish to BAR in internal builds
enableMicrobuild: true # only affects internal builds
# See https://github.com/dotnet/source-build/issues/2049
# enableSourceBuild: true

jobs:

Expand Down Expand Up @@ -84,6 +86,20 @@ stages:
${{ if eq(variables.officialBuild, 'true') }}:
displayName: Build and publish illink.sln $(_BuildConfig)

- job: SourceBuild_Managed
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should disable tests processing and publishing if they are not built

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I am lost. Can you please help me understand how to do that?

Copy link
Member

Choose a reason for hiding this comment

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

Right now, the flag comes in through here:

https://github.com/mono/linker/blob/d1bb874351fd4652edd83285f4488739ea9fda7d/eng/azure-pipelines.yml#L36-L43

and get passed thorough the jobs template into the job template here:

https://github.com/mono/linker/blob/d1bb874351fd4652edd83285f4488739ea9fda7d/eng/common/templates/jobs/jobs.yml#L40-L52

Maybe you can add a enablePublishTestResults: false to the source-build job and it would override the "outer scope" enablePublishTestResults: true parameter. But AzDO might just throw an error if it's defined twice.

A more reliable solution might be to completely remove the "outer scope" enablePublishBuildArtifacts: true, and put it on each job that should publish test results.

displayName: Source-Build (Managed)
pool:
vmImage: ubuntu-20.04
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-3e800f1-20190501005343'
workspace:
clean: all
steps:
- checkout: self
submodules: true
- template: /eng/common/templates/steps/source-build.yml
parameters:
enablePublishTestResults: true

- ${{ if eq(variables.officialBuild, 'false') }}:
- job: Linux
condition: eq(variables.officialBuild, 'false')
Expand Down