One more: actually build the packages from source. The bootstrap tool takes a set of prebuilt images, replaces a few things and declares it a new image. That means we can't fix bugs in some components because those are not built when this package is built using the bootstrap tool.
@omajid Then we wouldn't need the rover tool?
I saw that you build the payload for RHEL, can you please give me some basic steps for this?
Then we wouldn't need the rover tool?
I believe that we wouldn't need the rover tool for that particular version (or further bugfixes to that version). I don't know if we could use 1.0 to build 1.1, for example. In my experience, .NET Core often needs exact versions to be able to build itself.
These are the rough steps I used for 1.0. From what I understand, there are changes happening upstream (the term they are using is "vertical build" or some such) to make this whole thing easier.
Some of the numbers (such as the BuildIds) are still magic to me, so I am not sure how those work (they are computed from the date). Parts were built only on Windows.
BuildId
Most projects will download a .NET Core build, so you will have to go into the build scripts and patch them to use the version built by rover.
I used the following tags/branches:
The build is done in 3 stages (4 in your case, I suppose):
coreclr
corefx
ApplicationInsights-dotnet
NuGet.Client
Newtonsoft.Json
roslyn
roslyn-analyzers
symreader
PlatformAbstractions
core-setup
cli
For all the stages, I let everything download whatever it wants from NuGet for build-only dependencies. So if an artifact doesn't end up in the final built cli image, I don't bother building it. This is not acceptable for Fedora, of course, but should be fine for copr.
You can control what NuGet packages each build has access to by overriding NuGet.Config files. For stages 2 and 3, I let it only access a local repository where I manually placed the packages I built in stage 1.
NuGet.Config
./build.sh release clean skiptests 2>&1 | tee build.log ./build-packages.sh release 2>&1 | tee build-packages.log
Take the nuget packages and put it into a repository for stage 2.
./build.sh managed skiptests /t:GenerateVersionHeader /p:GenerateNativeVersionInfo=true /p:OfficialBuildId=20160627-01 ./build.sh skiptests release /p:BuildTests=false /p:GenerateNativeVersionInfo=true /p:OfficialBuildId=20160627-01 ./build-packages.sh /p:ConfigurationGroup=Release
It needs to be built on Windows too:
.\clean.cmd /all .\sync.cmd /p .\build.cmd managed /t:GenerateVersionHeader /p:GenerateNativeVersionInfo=true /p:OfficialBuildId=20160627-01 .\build.cmd /p:Platform=AnyCPU /p:ConfigurationGroup=Release /p:BuildTests=false /p:BuildPackages=false t/p:RestoreDuringBuild=false .\build-packages.cmd /p:ConfigurationGroup=Release
Take all the nuget packages and put it into a repository for stage 2. Let the windows-built packages override the Fedora-built packages.
.\buildRelease.cmd
Build it on Windows.
This requires some local changes. First, you will need to find a pre-built Newtonsoft.Json.dll from NuGet.org, and extract the delayed signing key. Use a command like sn -e your.dll <path-to-output> to extract the key.
sn -e your.dll <path-to-output>
Then place it somewhere where Build\\Build.ps1 can find it. Also add "/p:DelaySign=true" to the build command and "delaySign" = $true; to the $options variable in Build.ps1.
Build\\Build.ps1
"/p:DelaySign=true"
"delaySign" = $true;
$options
Build.ps1
Use the build scripts in Build directory.
Build
Extract the key (using a command similar to that in Newtonsoft.Json). Then
.\build.ps1 -Configuration Release -ReleaseLabel beta2 -BuildNumber 1484 -SkipTests -SkipCSProj -MSPFXPath <full-path-to-NuGet.Client.snk>
Modify cibuild.cmd to pass /p:OfficialBuild=true and /t:Build to the invocation of MSBuild for BuildAndTest.proj
/p:OfficialBuild=true
/t:Build
.\cibuild.cmd /release mkdir .\Binaries\Packages .\Binaries/Release/csi.exe build/BuildNuGets.csx Binaries/Release 1.3.0 Binaries\Packages
.\src\.nuget\NuGet.exe Enable -Name https://www.nuget.org/api/v2 cibuild.cmd /release
set Configuration=Release & build.cmd
./build.sh --configuration Release --targets Init,Compile,Package
It should produce a dotnet-$distro-x64-*.tar.gz file.
dotnet-$distro-x64-*.tar.gz
This is actually a hack. I feel dirty just writing it out. Here's what I did: take a prebuilt libuv from your distro, grab the libuv NuGet package, unzip it, replace the libuv.so with your distro's libuv.so and zip it back up.
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true # (this prevents dotnet from doing some extraction into a package cache you don't want it to do) export DOTNET_CLI_FRAMEWORK_HOST_COMPRESSED_FILE=<path to local package source>/dotnet-<distro>-x64.1.0.0.tar.gz ./build.sh --configuration Release --targets Init,Prepare,Compile,Package
The second export is very important. Otherwise cli will download prebuilt binary for core-setup. The build should produce a dotnet-dev-$distro.*.tar.gz file. That's the .NET Core binary.
export
dotnet-dev-$distro.*.tar.gz
First of all, thank you so much for this info. Really means a lot.
It's really complicated this build process isn't it, especially since we have to build parts on Windows. :(
"vertical build"
This is it, right?
https://github.com/dotnet/corefx/issues/14592
https://github.com/dotnet/corefx/issues/14492
I can confirm this, 1.1 didn't want to build with 1.0 payload.
Please bring this comment up next dotnet-sig meeting to see what should we do, we are still so far away it seems.
Thank you so much, again.
RIL issue fixed in the latest build.
Metadata Update from @rhea: - Issue untagged with: package
Metadata Update from @rhea: - Issue tagged with: package
Metadata Update from @rhea: - Issue status updated to: Closed (was: Open)
Metadata Update from @rhea: - Issue tagged with: f25, package