From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QBxhJE5mMWNCGgEAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 10:43:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4LN0JE5mMWPrPQEA9RJhRA (envelope-from ) for ; Mon, 26 Sep 2022 10:43:58 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 379DFCA42 for ; Mon, 26 Sep 2022 10:43:58 +0200 (CEST) Received: from localhost ([::1]:38148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocjiX-0002Rv-7p for larch@yhetil.org; Mon, 26 Sep 2022 04:43:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocjhZ-0002Oh-5S for guix-devel@gnu.org; Mon, 26 Sep 2022 04:42:58 -0400 Received: from knopi.disroot.org ([178.21.23.139]:57838) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocjhW-00012k-5S for guix-devel@gnu.org; Mon, 26 Sep 2022 04:42:56 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 823D94C24D for ; Mon, 26 Sep 2022 10:42:49 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id iUvZx4OFqAT6 for ; Mon, 26 Sep 2022 10:42:48 +0200 (CEST) From: =?utf-8?B?TcOhamEgVG9tw6HFoWVr?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1664181585; bh=ddj29h5KVt7OyWEdgMnwqMfcZgpcb19YEUef5AQhfLI=; h=From:To:Subject:Date; b=QAdoRC7E0RV/L95RGeIbL8r8EJt2FaROn7Ah59VgyyoNMDbHjqRHtKxXig+dAO46z F8mtkRwPR/YKR0waUywRMe0FDsQ5n2ZonzsbtiTGdb+YRPh0VNCHBk3d50vQz5rrak GGRRjQghfU8SRpH2tHUDftnrHyoyZ9Qo9mLB3u2qrteLi5f72M/N+wecNh0GcLkQx7 jxdBylWz0wazi7faXbdKC491wJUDIRqcQyZfRhrFlqdymADTeHTVLPW+PwsUC2YSfp 23g+qG5tVcf8SCNwnFqVu90rFL8WoiZUbioQd8A4FHK3wNO9CVmVlfpYhBhi2/AywK Qmwob5T2PUYaw== To: guix-devel@gnu.org Subject: Proposal: A new build-system API Date: Mon, 26 Sep 2022 10:39:41 +0200 Message-ID: <87zgemfs1e.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=178.21.23.139; envelope-from=maya.tomasek@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664181838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=40wW3aySH6BiUv/2uZTuKpRehfdQksjFf1zCO7N1Q4c=; b=ONuxDvBkW63qi9+G0qkfUd9AJy70wccrBm/n7N7lMs8WNiFzpctJq6TQPgi1m7NtfE638D dIkhcm6P41QvbdBxJH5VNvEUejE9l95TECNKlNhMSMYkAmkllf9fobLgMbmvmzr8if1Qef btj1aL+GMinjFhj8S86SQ95a9DS9W2KZkMUkv0V/RQe0IV4NXeLLrnaFxX2OD+dX6Omdaw vSZ7BY8flLoUQIuGyZIGKCcIe40s5BWryomwk+yyb0j78YfwlcemyANwb7IuBAn0uiQuqF GURJsh6EZQLyPdmhqo6Gyg42LucyXxfIF0tjV2Zeg1ObaUC1sDq9BktrTBi+JA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664181838; a=rsa-sha256; cv=none; b=uIHXa8QDQZGQdAhfZFGTJB+cbYq0C0/E8slArkGG9mS5hqTUYRz967MIoEhNrvZ+ZlmJhW AQt0Jl24uGD5MHzBrhzt22ey8fbVHoxKjWydh9FkLiNkq87Vrs9lavBYtRn3Q2aTP8xFHR /BLDxsfTjdvbamJ/CQNLGMFQT+Mw7jK/SIwdLvSd8nDFCNKPJ125NgAmarR+5yvZwdZXCt +yNiUaQXDWn+o6mJa5AP2EPB5N0waaUIxdJjCW9Fj8poSregGs2ZTzZNUVkjr5mcKsajiP 0dGMcFZwsYSbtjGJ9lbqA3VDez+UZtj/G+I9zGY2Dj78gMgNDF4YC2AgSliw6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=QAdoRC7E; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=QAdoRC7E; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 379DFCA42 X-Spam-Score: -1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: st+5/WbIJAkp Hello guix, I have been lately trying to write a build system or two. And I have found myself in a weird situation. The current API documentation is lackluster and the API itself isn't really ergonomic. First, I need to clarify that I understand that there is a lack of documentation, it is completely acceptable, but as I didn't really get the build system API, it was hard for me to grasp the intrices. Second, I appologize if I am touching on a conversation that already happened before, but I couldn't find it in the guix devel mailing list, as there were too many hits when I searched. Third, this API change would cause breakage of the old, so it isn't without a compromise, I think it could be done with a deprecation, but it would be, in my opinion, difficult. Currently the package and build system APIs don't mesh together well. (package ... (inputs list-of-inputs) (build-system some-build-system) (arguments (list-of-quoted #:key value)) ... ) What would I propose? To design the build system API similiarly as the package API. With records. For a simple package, almost nothing would change: (package ... (inputs list-of-inputs) (build-system (some-build-system)) ... ) But for a more complex package: (package ... (inputs list-of-inputs) (build-system (some-build-system (phases new-list-of-phases) (strip-binaries? #f))) ... ) This would be the user-facing API, as for the build system developer API for a simple build system: (define-build-system some-build-system (inherit gnu-build-system) (name 'some) (description "Some build system") (phases %standard-phases) (strip-binaries? #t) ... (builder (thunked) (build-system->builder this-build-system)) ) The build-system->builder method would generate the build, with arguments properly adjusted, records translated into keyword arguments, for a standard build system, the alternative, would be to provide a (lambda (build-system) some-code-that-returns-derivation). The current system is good, but when you need to write your own build system, you needlessly need to write thins like ungexping arguments, running gexp->derivation, which is really the system by which the guix daemon operates, but which could really be abstracted away from the build system developer. The code writing for a complete build system is repetetive and complicated. I don't know, if I have missed some things, this could be a really bad proposal, and if it is, feel free to ignore it. I have tried to come up with something new, and I am not the most profficient with either guix or guile. This was my shot at trying to be helpful in something bigger than updating packages or fixing small service bugs. With wishes of the best of luck, Maya PS. I appologize for spelling errors.