From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AmR/JU5woWBePQAAgWs5BA (envelope-from ) for ; Sun, 16 May 2021 21:19:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mHGZIE5woWBkIAAAB5/wlQ (envelope-from ) for ; Sun, 16 May 2021 19:19:42 +0000 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 D5FAD1792B for ; Sun, 16 May 2021 21:19:41 +0200 (CEST) Received: from localhost ([::1]:33382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liMIf-0003Rh-1J for larch@yhetil.org; Sun, 16 May 2021 15:19:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liL0i-00008h-Ka for help-guix@gnu.org; Sun, 16 May 2021 13:57:04 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liL0g-0003o3-4Y for help-guix@gnu.org; Sun, 16 May 2021 13:57:04 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id E390C240028 for ; Sun, 16 May 2021 19:56:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1621187817; bh=QFzTCgrPUtx6I2WnZR6qq5lsm/zNIxUmSLjTgr7bUpQ=; h=Subject:To:From:Date:From; b=lG2RP/zhKHmQr1zssMzrZfFqr8TkUu0wwUADhBwd25JhsmKiLl6eT6CkN7NfZUhvK 0Im8TJWt362k3v5vdYIolXuURStvBI+WPfMHiGLzwYo/G7rBa90lgXrYutbR4SGNkS m4x1hQjUcM3AUOnhkorc57gvt33gvSeJRO8Q0wToIXyGf5i7625uZUyw5x/62UzJLA oi67cemsrL4M2lXqgdlpag6IfBhBXV35hS+egi4HYaBx1/8dkkMe89m7qMZsvY6Xri wSENdcrGCm/oMLDyFBSirt/58Zy7Q/bqilX88uqSoCSN00ZqSrNvV4+duuIao5jx9m IjATsg1I66hUA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fjqhm72zgz6tm6 for ; Sun, 16 May 2021 19:56:56 +0200 (CEST) Subject: Re: python to support SQLite extensions To: help-guix@gnu.org References: <86tunagtsa.fsf@fsfe.org> From: Felix Gruber Message-ID: <21827a25-852c-967d-bd38-32dc819c22f2@posteo.net> Date: Sun, 16 May 2021 17:56:49 +0000 MIME-Version: 1.0 In-Reply-To: <86tunagtsa.fsf@fsfe.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=felgru@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 16 May 2021 15:19:31 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621192782; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Fqa27gdtrVZaOC8A4r+O+iQYg0s+wn7/+GwMG/KYs6o=; b=LhuPuyWTPxngKjNXV+Xy+eOaVWAUZBnBu4V0JksBNuriD4KQEw6ad8nCEVgx04OuC1E9Ns GM+7TbJCgxI4gjmDySzPsAetjaHSQzc+ZeFVfm12V+oT/b2jWPY1+GFJytbG7573mj2K1y 0FXYhdKzpJf/0VqRoU0vAuv+LszZEMe0YCYEnywYK3VQb0IVgmFRZwsKc99E08eGGOFkHS 4kGLxx2oUmVV83OYopUfSaLRX5l9rJlVYK9/4IqVxw+mMScVhudXYv6BhRdWRfo6/DX1u9 cynra5xROsLnBz8Uy5yOiYepvH6LBo53wV13CL4yAW3ebtS4QW8zAFJjrK6kxQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621192782; a=rsa-sha256; cv=none; b=hIGcw2YuHpgUoVLVNPDdTFy7vPa7WL0dHuMVactkT52H15PzH0oydSKfmcgWS7jLo7FQGa ZugsvJZnc6KbaZdVsStg9ajOx7yMXZKX+SYRWEqLDyeqWZlLAGT1qzyAlM6rXWbS3DMmNg +/+8S6+3Pkj/SO3O8WNSdCDKJTCXeV7JTrgyCYEbf4ySZFgJncl+LsCHVl/pm0tcs6EeOI qgvwQzVMsdPxr1QSQTXB433cWy1NPEWFSDaAPcq/ft/YT+CzGeOnigjtyl4aJSnlXWvsPS h/bfF+EEI3q6G6jID42nMIO4slH2hZlzO9YP/QLMSsVEkoqX8ge/vY6ofburxw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="lG2RP/zh"; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.65 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="lG2RP/zh"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: D5FAD1792B X-Spam-Score: -1.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: LmYE1PA70hGp Hi Jelle, On 5/10/21 11:31 PM, Jelle Licht wrote: > Does anybody perhaps know why my python is correctly receiving (and > subsequently ignoring) this configure flag? It seems that *something* > happens between the 'configure' script receiving the flag, and the file > in `Modules/_sqlite/connection.c' being built, it seems > SQLITE_OMIT_LOAD_EXTENSION is set to "1". > > This (seemingly) happens in setup.py, lines 1432 and on: > --8<---------------cut here---------------start------------->8--- > if '--enable-loadable-sqlite-extensions' not in sysconfig.get_config_var("CONFIG_ARGS"): > sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1")) > --8<---------------cut here---------------end--------------->8--- > > Indeed, in *any* python3 I can find on my Guix System, I see: > > --8<---------------cut here---------------start------------->8--- > #> import sysconfig > #> sysconfig.get_config_var("CONFIG_ARGS") > '--with-system-ffi' > --8<---------------cut here---------------end--------------->8--- > > Something weird is going on! > > I have no clue how to continue finding why this happens, but for my > personal problem I can just patch python's setup.py file. You're onto something with `sysconfig.get_config_var("CONFIG_ARGS")`: In the definition of the python-2.7 package from which the python package eventually derives from, a phase `'do-not-record-configure-flags` is added before `'configure`. This phase removes everything but '--with-system-ffi' from `CONFIG_ARGS`. I've successfully enabled loadable sqlite extensions with the following package definition. -------8<----------------8<----------------8<----------------8<------- (define python-with-loadable-sqlite-modules (package (inherit python) (arguments (substitute-keyword-arguments (package-arguments python) ((#:configure-flags cf) `(cons* "--enable-loadable-sqlite-extensions" ,cf)) ((#:phases phases) `(modify-phases ,phases (delete 'do-not-record-configure-flags))))))) ------->8---------------->8---------------->8---------------->8------- While this works, it might be better to modify the `'do-not-record-configure-flags` phase to keep the `--enable-loadable-sqlite-extensions` option instead of completely removing this phase. I think it might be a good idea to enable loadable sqlite extensions by default in the python package. As you've already pointed out, other distros have this option enabled which leads to surprises when trying to load sqlite extensions in guix's python. Hope that helps, Felix