From patchwork Mon May 19 09:50:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 42749 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7214827BC49; Mon, 19 May 2025 10:51:54 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F3F9627BC4D for ; Mon, 19 May 2025 10:51:50 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGx9L-0003yv-Ak; Mon, 19 May 2025 05:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uGx9J-0003yP-RC for guix-patches@gnu.org; Mon, 19 May 2025 05:51:09 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uGx9I-0001q3-QD; Mon, 19 May 2025 05:51:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=lbTmUpMeznC1BlH4SjtP8GdmpGUFySP6Pqj1HcPA1fc=; b=r1dWQG14gjrfXUjusvjhiLMlXvg5pe67hzI6703dpfuUq4TvEYVQNOV/1HCalVUA8/7Wp27F0PyCYzsUUk+S+grD9DLEP2Jd24A+wVfJaGsALS1S2ecsarh1Mh3QzYns3m5wwzQmeM5UaPPz7ZXzZKV1kyYRiedePncFokIOqTOqppMZ95pFExkb94f/Ww7qRSYYUZDgfBMMpozfKgaHcNGCs1NNVvhijOih+8707JpOtXnd4IPyWhjZ0Va813yR4zXBfopUlKd2Ho1OhaB9JFd/Chb9ocCtAUms4BMUl4TGF75fuEjbueDyf2tHxxm8QMNHzLzt+RRsuzLUDl4tGQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uGx9D-0005mE-FP; Mon, 19 May 2025 05:51:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78378] [PATCH v1 3/3] home: services: Build "files" union allowing dangling symlinks. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: sarg@sarg.org.ru, maxim.cournoyer@gmail.com, ludo@gnu.org, andrew@trop.in, hako@ultrarare.space, janneke@gnu.org, tanguy@bioneland.org, guix-patches@gnu.org Resent-Date: Mon, 19 May 2025 09:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78378 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78378@debbugs.gnu.org Cc: Sergey Trofimov , Sergey Trofimov , Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Hilton Chain , Janneke Nieuwenhuizen , Tanguy Le Carrour X-Debbugs-Original-Xcc: Sergey Trofimov , Maxim Cournoyer , Ludovic =?utf-8?q?Court=C3=A8s?= , Andrew Tropin , Hilton Chain , Janneke Nieuwenhuizen , Tanguy Le Carrour Received: via spool by 78378-submit@debbugs.gnu.org id=B78378.174764825122176 (code B ref 78378); Mon, 19 May 2025 09:51:03 +0000 Received: (at 78378) by debbugs.gnu.org; 19 May 2025 09:50:51 +0000 Received: from localhost ([127.0.0.1]:37563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGx90-0005lc-F3 for submit@debbugs.gnu.org; Mon, 19 May 2025 05:50:51 -0400 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:54406) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uGx8l-0005kQ-6m for 78378@debbugs.gnu.org; Mon, 19 May 2025 05:50:35 -0400 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-ad55d6aeb07so240878366b.0 for <78378@debbugs.gnu.org>; Mon, 19 May 2025 02:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1747648228; x=1748253028; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lbTmUpMeznC1BlH4SjtP8GdmpGUFySP6Pqj1HcPA1fc=; b=W755QXwhuvcgnwcaUgUYEEvn8K/ZcPJYV39F4qeCBVGQoqJ31L8rBrAoUaC6a6FmLO BR8kAGYm0lkefw0Ysayz9mTkC8kKDCkNk05PV/q+kCz1cJ3IML7kaQRdK31AKnJwPTkg PKmujui8eLUdbykGubHpsWKSkUWQm1TQkYGka7eZVUXUS0WZmYR+NauahS69OFE4mCX3 0tpHDWQHrziSstokQXXFFTRj/ltNZc6F97DcU3AtiTNQmdf0vAbX9BtkB/e9U1TEdOWk CFhjIKTw+2zFoaUFg79EAFrW4VcjSG3ZPtksbng1gh6pyPJF+eUryzseXKFVOJhiX70U KO3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747648228; x=1748253028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lbTmUpMeznC1BlH4SjtP8GdmpGUFySP6Pqj1HcPA1fc=; b=HyJwuJafnrwq2Bf7snwOmG7y+VP10jckGwblkkNn8f6Kew21jDeVuI26mA4gtIDycA IREK2fJPgLiize1UNwURoPMFh1URKBWeYRukfxCUDK2iWFTuy0GK6y8drApM7aXbYRqB +MO6tVCPznrK6BrHPrqHj+h5AP2u6euzOquUKkQx5Id944YghnGMYIFRqslvYOBp7LxI eaWKqIFN9biNPaUlk9kbAQY63t1gN+u1Pjkx5tepL8avJiaa7np2aUvAU46/raszYxdd THy+bFkPLZ/CywIBC9IiagxzbjcrunWbbTO4jUC7K8og9hwVqOiXQ10NeImYmtNU2D9H R1Kw== X-Gm-Message-State: AOJu0Yw9taOKpD0YxmPmO3X5HnLmTBUDMAny3IhOzTdGojXHb91XSN/G V9v+zeOB0QHIZULenU32d0TM8bbqd7lpFO85L8ShhEcXxols1ZE7jzH8Ih7tAcVjc7r2p2TBCvV hJ7T99BfFsQ== X-Gm-Gg: ASbGncs0/GcGeOYZRdF1tZJfvZdhzPJY3rAKDQYH1ZxASSKztzhxptkIQ9uLjNCA9/7 Uczwu0e+wpa7Z/7CUpT5hYTkt6J2IOpDUiCsQQ9XDEQojm8ii9aGDsr7cxZeVWq5q44euPF6jVq dlb5eiwG+XqX9QN44AcJ2BWtEX/jn6BVZPxljvIF7YuGlyRtMO30Es2hKXn6TG8dnzMjn+AgrQy lskzH/Gt+O5zHHSgdOg623wFgfCUEylMXo2Tf8rbeCt0oBXfoOBE2Dmt2cenElVZKKujBYmLALm d3H1o28p+ESdqJMq87+gldinVBLynWc8BjeLlDJbUmU8VI1pRQ== X-Google-Smtp-Source: AGHT+IEEjp9d5TSx+/lBv8rBnZt6y1NEbL4AHEU12phUK1GOf+GFAZO4aovkqsjcQSXVcAGLk7py0w== X-Received: by 2002:a17:907:e916:b0:ac7:c7cd:ac39 with SMTP id a640c23a62f3a-ad536b82a85mr899881866b.24.1747648228541; Mon, 19 May 2025 02:50:28 -0700 (PDT) Received: from localhost ([2a02:2454:a095:5600:a64e:31ff:fe38:fd6c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ad52d438384sm571442866b.106.2025.05.19.02.50.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 02:50:28 -0700 (PDT) From: Sergey Trofimov Date: Mon, 19 May 2025 11:50:10 +0200 Message-ID: X-Mailer: git-send-email 2.49.0 In-Reply-To: <40e225a93a488b887fc770effe8f856c62620d28.1747647920.git.sarg@sarg.org.ru> References: <40e225a93a488b887fc770effe8f856c62620d28.1747647920.git.sarg@sarg.org.ru> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home/services.scm (files->files-directory): Build file union without checking for existence of included items. * tests/guix-home.sh: Verify symlinking files out of store works. Change-Id: I94054003f4a6be944252ce7a397cf56f0b979554 --- gnu/home/services.scm | 3 ++- tests/guix-home.sh | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gnu/home/services.scm b/gnu/home/services.scm index 2342dc5e07..c09e6cdadd 100644 --- a/gnu/home/services.scm +++ b/gnu/home/services.scm @@ -343,7 +343,8 @@ (define (files->files-directory files) ;; leading to a build failure of "files.drv". (assert-no-duplicates files) - (file-union "files" files)) + ;; Allow symlinks to locations out of store + (file-union "files" files #:dangling-symlinks? #t)) ;; Used by symlink-manager (define home-files-directory "files") diff --git a/tests/guix-home.sh b/tests/guix-home.sh index dbfe7dbd48..b8d90196f1 100644 --- a/tests/guix-home.sh +++ b/tests/guix-home.sh @@ -73,7 +73,9 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT (list `(".config/test.conf" ,(plain-file "tmp-file.txt" - "the content of ~/.config/test.conf")))) + "the content of ~/.config/test.conf")) + + `("symlink" ,(symlink-to "")))) (service home-bash-service-type (home-bash-configuration @@ -104,6 +106,7 @@ trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT "# the content of bashrc-test-config.sh")))))))) EOF + sed -i "s,,$test_directory," home.scm echo -n "# dot-bashrc test file for guix home" > "dot-bashrc" # Check whether the graph commands work as expected. @@ -126,6 +129,7 @@ EOF guix home container home.scm -- cat '~/.config/test.conf' | \ grep "the content of" guix home container home.scm -- test -h '~/.bashrc' + guix home container home.scm -- test -h '~/symlink' test "$(guix home container home.scm -- id -u)" = 1000 guix home container home.scm -- test -f '$HOME/sample/home.scm' && false guix home container home.scm --expose="$PWD=$HOME/sample" -- \ @@ -153,6 +157,8 @@ EOF test -d "${HOME}/.guix-home" test -h "${HOME}/.bash_profile" test -h "${HOME}/.bashrc" + test -h "${HOME}/symlink" + test "$(readlink -f $HOME/symlink)" == "$test_directory" grep 'alias run="guix shell"' "$HOME/.bashrc" grep "alias path='echo \$PATH'" "$HOME/.bashrc" test "$(tail -n 2 "${HOME}/.bashrc")" == "\