From c5f18b6eff29b472615a40bdf434717e487bbcc3 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 10 Jun 2024 09:46:12 +0200 Subject: [PATCH] Work around https://github.com/actions/runner-images/issues/9937 Another try (try every env var) for https://github.com/actions/runner-images/issues/9937 https://github.com/liske/needrestart/blob/d3e33025543cc8459e470379a38c967c362cd4df/man/needrestart.1#L71-L73 Another try with DEBIAN_FRONTEND Try to apt remove needrestart complelely --- builders/ubuntu-python-builder.psm1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/builders/ubuntu-python-builder.psm1 b/builders/ubuntu-python-builder.psm1 index 35b159c5..a81b8a2b 100644 --- a/builders/ubuntu-python-builder.psm1 +++ b/builders/ubuntu-python-builder.psm1 @@ -64,6 +64,19 @@ class UbuntuPythonBuilder : NixPythonBuilder { Execute-Command -Command "sudo apt-get update" Execute-Command -Command $tkinterInstallString + $orig_needrestart_ui = $env:NEEDRESTART_UI + $env:NEEDRESTART_UI = "NeedRestart::UI::Debconf" + + $orig_needrestart_mode = $env:NEEDRESTART_MODE + $env:NEEDRESTART_MODE = "l" # l(ist)-only + + $orig_needrestart_suspend = $env:NEEDRESTART_SUSPEND + $env:NEEDRESTART_SUSPEND = "y" + + $orig_debian_frontend = $env:DEBIAN_FRONTEND + $env:DEBIAN_FRONTEND="noninteractive" + + Execute-Command -Command "sudo apt remove needrestart" ### Install dependent packages @( "make", @@ -80,6 +93,11 @@ class UbuntuPythonBuilder : NixPythonBuilder { Execute-Command -Command "sudo apt install -y $_" } + $env:NEEDRESTART_UI = $orig_needrestart_ui + $env:NEEDRESTART_MODE = $orig_needrestart_mode + $env:NEEDRESTART_SUSPEND = $orig_needrestart_suspend + $env:DEBIAN_FRONTEND = $orig_debian_frontend + ### On Ubuntu-1804, libgdbm-compat-dev has older modules that are no longer in libgdbm-dev Execute-Command -Command "sudo apt install -y libgdbm-compat-dev" }