From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gFn+Cd03tWAMYAEAgWs5BA (envelope-from ) for ; Mon, 31 May 2021 21:24:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sJBQBd03tWAgZAAAbx9fmQ (envelope-from ) for ; Mon, 31 May 2021 19:24:13 +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 762ED22337 for ; Mon, 31 May 2021 21:24:12 +0200 (CEST) Received: from localhost ([::1]:34096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnnWE-0005y2-Ab for larch@yhetil.org; Mon, 31 May 2021 15:24:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnnVE-0005Kd-Pe for help-guix@gnu.org; Mon, 31 May 2021 15:23:08 -0400 Received: from mail1.fsfe.org ([2001:aa8:ffed:f5f3::151]:46752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnnVB-0005qJ-RX for help-guix@gnu.org; Mon, 31 May 2021 15:23:08 -0400 From: Jelle Licht To: Felix Gruber , help-guix@gnu.org Subject: Re: python to support SQLite extensions In-Reply-To: <21827a25-852c-967d-bd38-32dc819c22f2@posteo.net> References: <86tunagtsa.fsf@fsfe.org> <21827a25-852c-967d-bd38-32dc819c22f2@posteo.net> Date: Mon, 31 May 2021 21:22:58 +0200 Message-ID: <865yyybtd9.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:aa8:ffed:f5f3::151; envelope-from=jlicht@fsfe.org; helo=mail1.fsfe.org X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1622489052; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=TC/hnUukBXy8BTzFvWc2g1DTLRPpSFiUqKHVilsDI4Q=; b=th2NIvnPk1IWNfh5Zlgt2uNYMq8vTD5DWqqpUx4SVAlTG32BvJdjwlUKM3ATYoobMM4Kfz TuUrQFN88DEQ/QNbdCRMl5XvhIhBW7V59RPxJY/7oWw0CxH206//tNn/hYMshLRZYzhMTE mKyscBXZByqz9WNHoapkyl1mkKVPnOJtkA0Q+PTnIW1ZJ92z5tTBQb4S7yjXO/u+ZSvJuX 8GURNDwpSVLw1Sz9WsIChYWU0NEaaIHPhEn4Z2BAZNGN8BYvbu2p2IzG5Oh+2JGRDt6VW+ bKndhYjOGTABKy1u8tvLnEg078xHolfndR56tTYgATbNl5aIr5CTxYB+IO7KtQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622489052; a=rsa-sha256; cv=none; b=hmGmiqFIHdcDfqUZeXD6LKyHP9LItJnIOtaRoY/BEKchqxwU84ka4GjP/C5qzpc/3DVvQB 990p5F6oeXKmd2Ws8rZ3Y3zLl2G99wJqR9WMlFmDK+JECJ1ujUBPt+KlCK56bCQN9yWDFX zdGAaCBMmKIikohPCuTgcoUhv8k2vZk+QHEkAdNgB0+rOs75Bo4BqULIX+dlgw9kmEchlS MlA+znT884Mam5+29KaCYc2SHzXXywUjVc81attv96xANy9Xy0IaE14mjUQrSkSmHA3neu le35nfUXK6F6Wsur1QH+aA+I72p2dgtldnR/0EOdV/gPI6QDn/uKFu14hCCdvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsfe.org (policy=none); 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: -2.33 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsfe.org (policy=none); 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: 762ED22337 X-Spam-Score: -2.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6/1976y4AKYK Hey Felix, Felix Gruber writes: > 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------- This works well-enough for me atm, thanks for getting me to understand the missing part here :). > 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. Makes sense, but I am no python guru. I'll open a separate ticket for this discussion, because there might be more flags that have similar issues that we might want to support. Thanks again, Jelle