From 94b26ff2841b90826968386de0b71a46284d2ee0 Mon Sep 17 00:00:00 2001 From: "Owen T. Heisler" Date: Wed, 10 Dec 2025 05:31:16 +0000 Subject: [PATCH] services: oci: Fix oci-image value field handling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/containers.scm (lower-oci-image-state, oci-lowerable-image?): Remove support for gexps and correctly lower file-like objects. * doc/guix.texi: Remove gexp from oci-image value field description. Fixes: guix/guix#3818 Change-Id: Ib812d65b32dd68f8572fcb371ab4521d22e5336c Signed-off-by: Ludovic Courtès Merges: #3819 --- doc/guix.texi | 2 +- gnu/services/containers.scm | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 439c23350b457c7898731b18c4168726e8c44b97..73bd1104691d2c358722f26646a28c6255ba9014 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45481,7 +45481,7 @@ A string representing the OCI image tag. Defaults to @code{latest}. @item @code{value} (type: oci-lowerable-image) A @code{manifest} or @code{operating-system} record that will be lowered into an OCI compatible tarball. Otherwise this field's value can be a -gexp or a file-like object that evaluates to an OCI compatible tarball. +file-like object that evaluates to an OCI compatible tarball. @item @code{pack-options} (default: @code{'()}) (type: list) An optional set of keyword arguments that will be passed to the diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm index 6353960a07e2405ac2dd249570f0cf0afd594901..de91e2357da4caf1c16e5011d329b8e136173d23 100644 --- a/gnu/services/containers.scm +++ b/gnu/services/containers.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2024, 2025 Giacomo Leidi +;;; Copyright © 2025 Owen T. Heisler ;;; ;;; This file is part of GNU Guix. ;;; @@ -523,7 +524,6 @@ but ~a was found") el)))) (define (oci-lowerable-image? image) (or (manifest? image) (operating-system? image) - (gexp? image) (file-like? image))) (define (string-or-oci-image? image) @@ -558,8 +558,8 @@ the OCI image.") (value (oci-lowerable-image) "A @code{manifest} or @code{operating-system} record that will be lowered -into an OCI compatible tarball. Otherwise this field's value can be a gexp -or a file-like object that evaluates to an OCI compatible tarball.") +into an OCI compatible tarball. Otherwise this field's value can be a +file-like object that evaluates to an OCI compatible tarball.") (pack-options (list '()) "An optional set of keyword arguments that will be passed to the @@ -1080,14 +1080,13 @@ for the OCI runtime volume create command." target system grafts?)) ((? operating-system? value) (lower-operating-system value target system)) - ((or (? gexp? value) - (? file-like? value)) - value) + ((? file-like? value) + (lower-object value)) (_ (raise (formatted-message (G_ "oci-image value must contain only manifest, -operating-system, gexp or file-like records but ~a was found") +operating-system, or file-like records but ~a was found") value)))) #:target target #:system system)))