Skip to content

Commit d5f808d

Browse files
omajidcrummel
authored andcommitted
Build all corefx packages (#653)
* Build all corefx packages CoreFX includes a number of packages that are not built when using source-build. For example, Microsoft.NETCore.Platforms is not built. It is consumed via NuGet. This causes two issues: 1. The bits included in the final cli build are not all compiled from source. This goes against overall goal of source-build. 3. Any changes made to such packages in corefx do not flow through. As an example, this means additional runtime IDs added to Microsoft.NETCore.Platforms are not included in the final built cli. Fix that by passing a flag to indicate all of CoreFX should be built. Fixes #650 * Add separate folder for previously source-built packages that are used earlier in the build than they are produced. * Update the prebuilt baseline.
1 parent 9fc93c1 commit d5f808d

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

build-source-tarball.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ rm -rf $TARBALL_ROOT/Tools/configuration/configuration.props
110110
cp $SCRIPT_ROOT/support/tarball/build.sh $TARBALL_ROOT/build.sh
111111

112112
mkdir -p $TARBALL_ROOT/prebuilt/nuget-packages
113+
mkdir -p $TARBALL_ROOT/prebuilt/source-built
113114
find $SCRIPT_ROOT/packages -name '*.nupkg' -exec cp {} $TARBALL_ROOT/prebuilt/nuget-packages/ \;
114115
find $SCRIPT_ROOT/bin/obj/x64/Release/nuget-packages -name '*.nupkg' -exec cp {} $TARBALL_ROOT/prebuilt/nuget-packages/ \;
115116

@@ -129,6 +130,13 @@ do
129130
fi
130131
done
131132

133+
echo 'Copying source-built packages to tarball to replace packages needed before they are built...'
134+
135+
for built_package in $(find $SCRIPT_ROOT/bin/obj/x64/Release/blob-feed/packages/ -name '*.nupkg')
136+
do
137+
cp $built_package $TARBALL_ROOT/prebuilt/source-built/
138+
done
139+
132140
echo 'WORKAROUND: Overwriting the source-built roslyn-tools MSBuild files with prebuilt so that roslyn-tools can successfully build in the tarball... (https://github.com/dotnet/source-build/issues/654)'
133141

134142
ROSLYN_TOOLS_PACKAGE='RoslynTools.RepoToolset'

dir.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<SourceBuiltPackagesPath>$(SourceBuiltBlobFeedDir)packages/</SourceBuiltPackagesPath>
5858
<SourceBuiltAssetsDir>$(SourceBuiltBlobFeedDir)assets/</SourceBuiltAssetsDir>
5959
<PrebuiltPackagesPath>$(ProjectDir)prebuilt/nuget-packages/</PrebuiltPackagesPath>
60+
<PrebuiltSourceBuiltPackagesPath>$(ProjectDir)prebuilt/source-built/</PrebuiltSourceBuiltPackagesPath>
6061
<SourceBuiltTarBallPath>$(OutputPath)</SourceBuiltTarBallPath>
6162
<TargetInfoProps>$(IntermediatePath)TargetInfo.props</TargetInfoProps>
6263
<RestoreSourcePropsPath>$(IntermediatePath)RestoreSources.props</RestoreSourcePropsPath>

repos/corefx.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<OverrideTargetRid Condition="'$(TargetOS)' == 'OSX'">osx-x64</OverrideTargetRid>
1010

1111
<BuildArguments>-$(Configuration) -buildArch=$(Platform) -portable=$(OverridePortableBuild) -BuildTests=false -PackageRid=$(OverrideTargetRid)</BuildArguments>
12-
<BuildCommand>$(ProjectDirectory)/build$(ShellExtension) $(BuildArguments) -- /bl</BuildCommand>
12+
<BuildCommand>$(ProjectDirectory)/build$(ShellExtension) $(BuildArguments) -- /p:BuildAllPackages=true /bl</BuildCommand>
1313
<BuildCommand Condition="$(Platform.Contains('arm'))">$(ArmEnvironmentVariables) $(BuildCommand)</BuildCommand>
1414
<PackagesOutput>$(ProjectDirectory)/bin/packages/$(Configuration)</PackagesOutput>
1515
<CleanCommand>$(ProjectDirectory)/clean$(ShellExtension)</CleanCommand>

repos/dir.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@
140140
SourcePath="$(PrebuiltPackagesPath)"
141141
Condition="'$(OfflineBuild)' == 'true'" />
142142

143+
<AddSourceToNuGetConfig NuGetConfigFile="%(NuGetConfigFiles.Identity)"
144+
SourceName="previously-source-built"
145+
SourcePath="$(PrebuiltSourceBuiltPackagesPath)"
146+
Condition="'$(OfflineBuild)' == 'true'" />
147+
143148
<AddSourceToNuGetConfig NuGetConfigFile="%(NuGetConfigFiles.Identity)"
144149
SourceName="source-built"
145150
SourcePath="$(SourceBuiltPackagesPath)" />
@@ -211,6 +216,7 @@
211216
<ItemGroup>
212217
<_DotNetRestoreSources Include="$(SourceBuiltPackagesPath)" />
213218
<_DotNetRestoreSources Include="$(PrebuiltPackagesPath)" Condition="'$(OfflineBuild)' == 'true'"/>
219+
<_DotNetRestoreSources Include="$(PrebuiltSourceBuiltPackagesPath)" Condition="'$(OfflineBuild)' == 'true'"/>
214220
</ItemGroup>
215221
<WriteRestoreSourceProps RestoreSources="@(_DotNetRestoreSources)"
216222
OutputPath="$(RestoreSourcePropsPath)" />

tools-local/prebuilt-baseline-offline.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,13 @@
176176
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.0-preview1-26116-01" />
177177
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.0-preview2-26406-04" />
178178
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.1-servicing-26722-02" />
179-
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.1" />
180179
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.0.5" />
181180
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.0.7" />
182181
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.1.1" />
183182
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.1.2" />
184183
<Usage Id="Microsoft.NETCore.Targets" Version="1.0.1" />
185184
<Usage Id="Microsoft.NETCore.Targets" Version="1.0.3" />
186185
<Usage Id="Microsoft.NETCore.Targets" Version="1.1.0" />
187-
<Usage Id="Microsoft.NETCore.Targets" Version="2.0.0" />
188186
<Usage Id="Microsoft.NETCore.Targets" Version="2.1.0-preview2-26406-04" />
189187
<Usage Id="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
190188
<Usage Id="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-alpha-003" />
@@ -711,4 +709,4 @@
711709
<Usage Id="xunit.runner.visualstudio" Version="2.3.0" />
712710
<Usage Id="xunit.runner.visualstudio" Version="2.3.1" />
713711
</Usages>
714-
</UsageData>
712+
</UsageData>

tools-local/prebuilt-baseline-online.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.0-preview1-26116-01" />
169169
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.0-preview2-26406-04" />
170170
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.1-servicing-26722-02" />
171-
<Usage Id="Microsoft.NETCore.Platforms" Version="2.1.1" />
172171
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.0.5" />
173172
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.0.7" />
174173
<Usage Id="Microsoft.NETCore.Runtime.CoreCLR" Version="1.1.1" />
@@ -177,7 +176,6 @@
177176
<Usage Id="Microsoft.NETCore.Targets" Version="1.0.1" />
178177
<Usage Id="Microsoft.NETCore.Targets" Version="1.0.3" />
179178
<Usage Id="Microsoft.NETCore.Targets" Version="1.1.0" />
180-
<Usage Id="Microsoft.NETCore.Targets" Version="2.0.0" />
181179
<Usage Id="Microsoft.NETCore.Targets" Version="2.1.0-preview2-26406-04" />
182180
<Usage Id="Microsoft.NETCore.Windows.ApiSets" Version="1.0.1" />
183181
<Usage Id="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-alpha-003" />
@@ -709,4 +707,4 @@
709707
<Usage Id="xunit.runner.visualstudio" Version="2.3.0" />
710708
<Usage Id="xunit.runner.visualstudio" Version="2.3.1" />
711709
</Usages>
712-
</UsageData>
710+
</UsageData>

0 commit comments

Comments
 (0)