From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4Kc8BD33rGPTOwEAbAwnHQ (envelope-from ) for ; Thu, 29 Dec 2022 03:11:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GNUsBD33rGNLhAEA9RJhRA (envelope-from ) for ; Thu, 29 Dec 2022 03:11:09 +0100 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 DB1864160 for ; Thu, 29 Dec 2022 03:11:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pAiNX-0007hV-2D; Wed, 28 Dec 2022 21:10:43 -0500 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 1pAiNW-0007hM-0F for guix-devel@gnu.org; Wed, 28 Dec 2022 21:10:42 -0500 Received: from smtpm5.myservices.hosting ([185.26.105.236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pAiNU-0007av-AY for guix-devel@gnu.org; Wed, 28 Dec 2022 21:10:41 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpm5.myservices.hosting (Postfix) with ESMTP id E188620C8B for ; Thu, 29 Dec 2022 03:10:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 960F18009A for ; Thu, 29 Dec 2022 03:10:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U5piiXOOvRYY for ; Thu, 29 Dec 2022 03:10:33 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id D810880099 for ; Thu, 29 Dec 2022 03:10:32 +0100 (CET) Message-ID: Date: Thu, 29 Dec 2022 02:10:27 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Content-Language: en-US To: guix-devel From: mirai Subject: Improving how NGINX modules are used and built Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.26.105.236; envelope-from=mirai@makinata.eu; helo=smtpm5.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672279868; a=rsa-sha256; cv=none; b=pO82cWcMPywP47dKNz7GFdRqoHW8gZhCfpQ3br6p4PRVa5odYBopRE3lD0vP/mN617LiqX MApO1xfWnvW3Q5VYgojgmVVz5m+P6JS1izqV4iZTMjAWwLFl7SSbxtLQGDsIvonorXQNF2 Yr0ZEGn7MyW92PE+LbUaC3ThLPgdhJzJyaDSG3zfBI/rvjVrA7e1OGq4hOcW6zEGdL9IxV cVgE0x8RG3GiF8EoocAcOUP3g6gWQOTobmJ4AOEYjbVhWg9ME3Cfq0KF5TAzU2pn9qIF5Y MxI5WWhV1on9SigEkxPz+vxhKfcWJOWVYRMQd5m0BS3LMsOMOk2HGbsuy2DXRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672279868; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lZvivYeK4h4B47pXeWgUmmNqCPcoMbpJ7Wj4nOz2jJg=; b=RPItP1HLwHLcXNWKfj48NeM10JLgI9ndQYeMd6ptxbyS5XZGvP29NEvZiqOLng9klJrH6U G5wXBuY/SXMsbxkUp1Z3aMwoDiYWy/l1v/PhQ+/pfymbLZcrv364L0gjYREfcjwn6NzVDz Q8j+z/ZAgK8bfI3k7RNuSw1U6gnOZdSbhIWkOpfErZ6LLHrWZ+H0MR7C2h/ZEActJjfHOK TvOckaFZPsGCdwFcoqiA8gkpxck54CFEJIEVPdn16cXht2l0qPA7ZcNI+4m/fJashVRMsR uJCxbfc619vcsoPt37tEhcU97AVtMpW0YUyD4bE2fKg+SdCkPTXNb4GYkSKD7w== X-Spam-Score: -2.13 X-Migadu-Queue-Id: DB1864160 Authentication-Results: aspmx1.migadu.com; dkim=none; 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"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -2.13 X-TUID: GHOK/keTCaDi Consider the following nginx-configuration modules field snippet from Guix docs: --8<---------------cut here---------------start------------->8--- (modules (list (file-append nginx-accept-language-module "\ /etc/nginx/modules/ngx_http_accept_language_module.so") (file-append nginx-lua-module "\ /etc/nginx/modules/ngx_http_lua_module.so"))) --8<---------------cut here---------------end--------------->8--- It is unclear at all how an arbitrary nginx module should be added given that one needs to append the package object with a path to the modules .so file. This .so name can only be found by listing the files from the package object which adds further obscurity to what should have been: --8<---------------cut here---------------start------------->8--- (modules (list nginx-accept-language-module nginx-lua-module)) --8<---------------cut here---------------end--------------->8--- An oddity of how nginx modules are packaged in guix is that they all place the .so file under /etc/nginx/modules which is an odd directory to place library object files. Compared against other distributions, they tend to place the .so files under /usr/lib64/nginx and a .conf file under /usr/share/nginx/modules that contains --8<---------------cut here---------------start------------->8--- load_module "/usr/lib64/nginx/modules/ngx_foo_module.so"; --8<---------------cut here---------------end--------------->8--- My guess is that the intention behind (file-append nginx-foo-module "/etc/nginx/modules/ngx_foo.so") is that it was supposed to replicate the .conf behavior but inadvertently ended up being used as a place for .so files. Looking at how network-manager-configuration handles its vpn-plugins field, it seems doable that a similar approach can be used here. The existing nginx-modules should be changed to install their .so files under lib{64}/nginx instead and they should drop a etc/nginx/modules/foo_module.conf file responsible for loading the module from the .so file. Including modules through a .conf should be preferred as there's no guarantee that a module is a .so file or that it is always a _single_ .so file but in general this file should typically be a one-line .conf file containing: --8<---------------cut here---------------start------------->8--- load_module "/gnu/store/......nginx-foo-module/usr/lib64/nginx/ngx_foo_module.so"; --8<---------------cut here---------------end--------------->8--- And nginx-configuration should serialize the modules field as a series of lines including the module .conf files, that is: --8<---------------cut here---------------start------------->8--- include "/gnu/store/......nginx-foo-module/etc/nginx/modules/ngx_foo_module.conf"; include "/gnu/store/......nginx-bar-module/etc/nginx/modules/ngx_bar_module.conf"; ... --8<---------------cut here---------------end--------------->8--- (note: a directory union could be used here as an alternative) On a related note, given how nginx-modules are expected to be built and linked against the same nginx build, a new nginx-build-system for nginx modules could be considered as the few existing nginx modules in guix are for the most part a copy-paste of each other with some modifications here-and-there. Thoughts? Regards, Bruno