aspnet / KoreBuild

OBSOLETE REPO - see readme
Other
37 stars 23 forks source link

Build KoreBuild #258

Closed natemcmaster closed 7 years ago

natemcmaster commented 7 years ago

Goals:

Implementation ideas:

cc @anurse @pakrym @pranavkm

Eilon commented 7 years ago

I will set up a short mtg to discuss.

natemcmaster commented 7 years ago

Notes for our meeting today

Background: current behavior

  1. build.ps1 download https://github.com/aspnet/KoreBuild/archive/dev.zip
  2. Extract to $repo/.build
  3. Execute .build/KoreBuild.ps1
  4. .build/KoreBuild.ps1 executes
    1. .build/dotnet/dotnet-install.ps1 to restore runtimes and SDKs
    2. dotnet msbuild /t:Restore /p:PreflightRestore=true to download task packages and reference assemblies
    3. dotnet msbuild KoreBuild.proj which runs the main lifecycle (build/test/verify)

Note: replace .ps1 with .sh for Linux builds

Versioning

Problems

AutoUpdate is not possible When extracting the GitHub source archive, the bootstrapper does not have access to the "version" (i.e. commit hash) of the code it is using. This means we cannot reliably auto-update the $repo/.build folder.

Version coherence PackageReferences within KoreBuild's code are not guaranteed to match KoreBuild's code, and may change when new packages become available. This may mean long-running builds can end up with newer packages being installed half-way through a build.

Pinning is manual and requires source changes Pinning KoreBuild to exact version requires source code changes. The bootstrapper must change its download url in build.ps1, and korebuild scripts in this repo must pin their PackageReference versions.

Eilon commented 7 years ago

Idea is approved.

We should look at some of the exact details, such as whether to use a MyGet feed, blob storage, etc.

natemcmaster commented 7 years ago

Some exact details:

  1. Azure storage blob

    I'm currently thinking a blob store will be easier to work with. If we use MyGet, we would need a NuGet client to acquire KoreBuild. That's easy on Windows with NuGet.exe, but running NuGet.exe on Linux would require Mono. AFAIK the only alternative is to write the curl + JSON code manually in bash to immitate what NuGet.exe does. Eww.

  2. Move KoreBuild code to aspnet/BuildTools. This will make it easier to ensure the console tools KoreBuild bundles use a .NET Core runtime that aligns with what KoreBuild will install.

  3. Incrementally update repos. As long as build.ps1/sh still builds the default lifecycle, we don't have to upgrade all at once.

analogrelay commented 7 years ago

Azure storage blob

Really agree here. I tested out MyGet and found this same issue. Azure Blobs are low-impact, low-cost and easy to use. Blobs support Etags automatically so we're easily able to use our auto-update mechanism.

natemcmaster commented 7 years ago

An additional detail:

natemcmaster commented 7 years ago

PR to update Universe to use the compiled KoreBuild - https://github.com/aspnet/Universe/pull/521