From 5c0f8d37d5b1f3c380b49c60f3d2e5e8ab586f62 Mon Sep 17 00:00:00 2001
From: Celeste Liu <CoelacanthusHex@gmail.com>
Date: Sat, 9 Nov 2024 20:24:05 +0800
Subject: [PATCH] fix(arch-nspawn): add --timezone=off to avoid pollute build
 environment

From systemd-nspawn(1),

	--timezone=
		Configures how /etc/localtime inside of the container (i.e. local timezone synchronization from host to container) shall be handled. Takes one of "off", "copy", "bind", "symlink", "delete" or "auto". If set to "off" the /etc/localtime file in the container
		is left as it is included in the image, and neither modified nor bind mounted over. If set to "copy" the /etc/localtime file of the host is copied into the container. Similarly, if "bind" is used, the file is bind mounted from the host into the container. If
		set to "symlink", a symlink is created pointing from /etc/localtime in the container to the timezone file in the container that matches the timezone setting on the host. If set to "delete", the file in the container is deleted, should it exist. If set to
		"auto" and the /etc/localtime file of the host is a symlink, then "symlink" mode is used, and "copy" otherwise, except if the image is read-only in which case "bind" is used instead. Defaults to "auto".

		Added in version 239.

After this commit, we need to recreate all build environment to clean up
pollution already existed.

resolve #250

Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
---
 src/arch-nspawn.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/arch-nspawn.in b/src/arch-nspawn.in
index bd99adc8..6bcafa57 100644
--- a/src/arch-nspawn.in
+++ b/src/arch-nspawn.in
@@ -65,6 +65,7 @@ nspawn_args=(
 	--machine="arch-nspawn-$$"
 	--as-pid2
 	--console=autopipe
+	--timezone=off
 )
 
 if (( ${#cache_dirs[@]} == 0 )); then
-- 
GitLab