From 8b138c90318712d0a0c19732a32a4d1394f5168f Mon Sep 17 00:00:00 2001 From: Vincent Haupert Date: Wed, 29 Dec 2021 15:25:27 +0100 Subject: github-runner: Extend script to update all platform deps Runs `dotnet restore` for all supported platforms (`x86_64-linux` and `arm64-linux` at the moment) in the update script. --- .../github-runner/default.nix | 22 +++++++++++++--------- .../continuous-integration/github-runner/deps.nix | 3 +++ 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/tools/continuous-integration/github-runner/default.nix b/pkgs/development/tools/continuous-integration/github-runner/default.nix index a0aedc083a0..239d0c3430b 100644 --- a/pkgs/development/tools/continuous-integration/github-runner/default.nix +++ b/pkgs/development/tools/continuous-integration/github-runner/default.nix @@ -33,10 +33,12 @@ let ); dotnetSdk = dotnetCorePackages.sdk_6_0; - runtimeId = - if stdenv.isAarch64 - then "linux-arm64" - else "linux-x64"; + # Map Nix systems to .NET runtime ids + runtimeIds = { + "x86_64-linux" = "linux-x64"; + "aarch64-linux" = "linux-arm64"; + }; + runtimeId = runtimeIds.${stdenv.system}; fakeSha1 = "0000000000000000000000000000000000000000"; in stdenv.mkDerivation rec { @@ -276,7 +278,7 @@ stdenv.mkDerivation rec { # Script to create deps.nix file for dotnet dependencies. Run it with # $(nix-build -A github-runner.passthru.createDepsFile)/bin/create-deps-file # - # Default output path is /tmp/${pname}-deps.nix, but can be override with cli argument. + # Default output path is /tmp/${pname}-deps.nix, but can be overriden with cli argument. # # Inspired by passthru.fetch-deps in pkgs/build-support/build-dotnet-module/default.nix passthru.createDepsFile = writeShellApplication { @@ -295,8 +297,10 @@ stdenv.mkDerivation rec { mkdir nuget_pkgs - printf "\n* Restore ${pname} dotnet project\n" - dotnet restore src/ActionsRunner.sln --packages nuget_pkgs --no-cache --force --runtime ${runtimeId} + ${lib.concatMapStrings (rid: '' + printf "\n* Restore ${pname} (${rid}) dotnet project\n" + dotnet restore src/ActionsRunner.sln --packages nuget_pkgs --no-cache --force --runtime "${rid}" + '') (lib.attrValues runtimeIds)} cd "$rundir" deps_file=''${1-"/tmp/${pname}-deps.nix"} @@ -310,7 +314,7 @@ stdenv.mkDerivation rec { description = "Self-hosted runner for GitHub Actions"; homepage = "https://github.com/actions/runner"; license = licenses.mit; - maintainers = with maintainers; [ veehaitch newam kfollesdal]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + maintainers = with maintainers; [ veehaitch newam kfollesdal ]; + platforms = attrNames runtimeIds; }; } diff --git a/pkgs/development/tools/continuous-integration/github-runner/deps.nix b/pkgs/development/tools/continuous-integration/github-runner/deps.nix index 2e91387eca6..1281b9515f5 100644 --- a/pkgs/development/tools/continuous-integration/github-runner/deps.nix +++ b/pkgs/development/tools/continuous-integration/github-runner/deps.nix @@ -1,11 +1,14 @@ { fetchNuGet }: [ (fetchNuGet { pname = "Castle.Core"; version = "4.4.0"; sha256 = "0rpcbmyhckvlvp6vbzpj03c1gqz56ixc6f15vgmxmyf1g40c24pf"; }) + (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-arm64"; version = "6.0.0"; sha256 = "1315hycfqlalh6k4zvvz7pz3dylpp0sr45j1v9avcb143hjqnav6"; }) (fetchNuGet { pname = "Microsoft.AspNetCore.App.Runtime.linux-x64"; version = "6.0.0"; sha256 = "0r6jyxl3h1asj30la78skd5gsxgwjpvkspmkw1gglxfg85hnqc8w"; }) (fetchNuGet { pname = "Microsoft.AspNet.WebApi.Client"; version = "5.2.4"; sha256 = "00fkczf69z2rwarcd8kjjdp47517a0ca6lggn72qbilsp03a5scj"; }) (fetchNuGet { pname = "Microsoft.CodeCoverage"; version = "17.0.0"; sha256 = "18gdbsqf6i79ld4ikqr4jhx9ndsggm865b5xj1xmnmgg12ydp19a"; }) (fetchNuGet { pname = "Microsoft.CSharp"; version = "4.0.1"; sha256 = "0zxc0apx1gcx361jlq8smc9pfdgmyjh6hpka8dypc9w23nlsh6yj"; }) (fetchNuGet { pname = "Microsoft.IdentityModel.Logging"; version = "5.2.1"; sha256 = "1gpka9jm2gl6f07pcwzwvaxw9xq1a19i9fskn0qs921c5grhlp3g"; }) (fetchNuGet { pname = "Microsoft.IdentityModel.Tokens"; version = "5.2.1"; sha256 = "03v6145vr1winq8xxfikydicds4f10qmy1ybyz2gfimnzzx51w00"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Host.linux-arm64"; version = "6.0.0"; sha256 = "0aska6s99rfg13ngsaxr151a6sk8r68lv3mj8yv0bhvwcpln4342"; }) + (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-arm64"; version = "6.0.0"; sha256 = "146rbmk0svvqaf0c4msg67h17x4k4gd5kzsbb3iqvs14xfkli2xw"; }) (fetchNuGet { pname = "Microsoft.NETCore.App.Runtime.linux-x64"; version = "6.0.0"; sha256 = "0qaylw18flrfl3vxnbp8wsiz29znidmn6dhv7k4v4jj2za16wmji"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; }) (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1-rc2-24027"; sha256 = "1a0w5fv8slfr4q7m3mh78lb9awdwyz4zv3bb73vybkyq1f6z7lx8"; }) -- cgit 1.4.1