From patchwork Fri Oct 12 14:14:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Weber X-Patchwork-Id: 983070 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Wqbp2mFTz9s3C for ; Sat, 13 Oct 2018 01:15:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EA583887B9; Fri, 12 Oct 2018 14:14:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IjiDdbC8zYNI; Fri, 12 Oct 2018 14:14:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F2DB788649; Fri, 12 Oct 2018 14:14:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 1CB891BF48B for ; Fri, 12 Oct 2018 14:14:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1A4D586FAE for ; Fri, 12 Oct 2018 14:14:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bMcVtwUF-jKR for ; Fri, 12 Oct 2018 14:14:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1220C86F02 for ; Fri, 12 Oct 2018 14:14:50 +0000 (UTC) Received: from ofwch3n02.rockwellcollins.com (HELO crulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 12 Oct 2018 09:14:49 -0500 X-Received: from largo.rockwellcollins.com (unknown [192.168.140.76]) by crulimr01.rockwellcollins.com (Postfix) with ESMTP id 2DBA060254; Fri, 12 Oct 2018 09:14:49 -0500 (CDT) From: Matt Weber To: buildroot@buildroot.org Date: Fri, 12 Oct 2018 09:14:48 -0500 Message-Id: <1539353688-32225-1-git-send-email-matthew.weber@rockwellcollins.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH] python3: use stdlib UUID backend X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adam Duskett , Adam Duskett MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Python3 at runtime identifies the uuid backend to use to implement functions like uuid_generate_time. This search includes libc first and then other options like util-linux's libuuid. There is also an option to use an extension module, however it looks like that requires the libuuid and headers to be present (./Modules/_uuidmodule.c). The extension isn't required to make this work. - This was runtime tested by updating the python3-3.7.0/Lib/uuid.py to include debug information in the def _load_system_functions(): to print "libname". Then at runtime it was observed that libc was the selected backend. - At build time, the log was checked to confirmed the configure step didn't detect any uuid support in both the case of util-linux present and not. However, this did not prevent the uuid runtime from working. Thus the reason the patch 0031-* which adds the opt to disable uuid has no affect. This patch removes the enable/disable option as it is no longer required since python's use of libc should be possible in every system. Note: Currently the BR2_PACKAGE_PYTHON3_UUID disable doesn't work to prevent the "import uuid ; print(uuid.uuid1())" example from working at runtime. This patch drops the dependency on util-linux as the library isn't required for a working python uuid implementation. The enabling of libuuid.so in a Buildroot configuration doesn't currently have any affect on the feature, as python still uses the libc backend. Ref: http://lists.busybox.net/pipermail/buildroot/2018-October/233113.html http://lists.busybox.net/pipermail/buildroot/2018-September/231060.html http://lists.busybox.net/pipermail/buildroot/2018-October/233079.html CC: Adam Duskett CC: Adam Duskett Signed-off-by: Matthew Weber Tested-by: Carlos Santos --- ...0031-Add-an-option-to-disable-uuid-module.patch | 33 ---------------------- package/python3/Config.in | 10 ------- package/python3/python3.mk | 6 ---- 3 files changed, 49 deletions(-) delete mode 100644 package/python3/0031-Add-an-option-to-disable-uuid-module.patch diff --git a/package/python3/0031-Add-an-option-to-disable-uuid-module.patch b/package/python3/0031-Add-an-option-to-disable-uuid-module.patch deleted file mode 100644 index c429c59..0000000 --- a/package/python3/0031-Add-an-option-to-disable-uuid-module.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 1fe33c7bee9e6410f56c956ea19efd2f617176ae Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 18 Aug 2018 10:54:56 +0200 -Subject: [PATCH] Add an option to disable uuid module - -Signed-off-by: Thomas Petazzoni ---- - configure.ac | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/configure.ac b/configure.ac -index b022460e73..505b7c9be0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -3258,6 +3258,15 @@ if test "$CURSES" = "no"; then - DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _curses _curses_panel" - fi - -+AC_SUBST(UUID) -+AC_ARG_ENABLE(uuid, -+ AS_HELP_STRING([--disable-uuid], [disable uuid]), -+ [ UUID="${enableval}" ], [ UUID=yes ]) -+ -+if test "$UUID" = "no"; then -+ DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _uuid" -+fi -+ - AC_SUBST(PYDOC) - - AC_ARG_ENABLE(pydoc, --- -2.14.4 - diff --git a/package/python3/Config.in b/package/python3/Config.in index 0701d56..623fefe 100644 --- a/package/python3/Config.in +++ b/package/python3/Config.in @@ -88,16 +88,6 @@ config BR2_PACKAGE_PYTHON3_UNICODEDATA Unicode character database (used by stringprep module) (large). -config BR2_PACKAGE_PYTHON3_UUID - bool "uuid module" - select BR2_PACKAGE_UTIL_LINUX - select BR2_PACKAGE_UTIL_LINUX_LIBUUID - help - This module provides immutable UUID objects (the UUID class) - and the functions uuid1(), uuid3(), uuid4(), uuid5() for - generating version 1, 3, 4, and 5 UUIDs as specified in RFC - 4122. - config BR2_PACKAGE_PYTHON3_SQLITE bool "sqlite module" select BR2_PACKAGE_SQLITE diff --git a/package/python3/python3.mk b/package/python3/python3.mk index 0c46806..71f5226 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -94,12 +94,6 @@ ifneq ($(BR2_PACKAGE_PYTHON3_UNICODEDATA),y) PYTHON3_CONF_OPTS += --disable-unicodedata endif -ifeq ($(BR2_PACKAGE_PYTHON3_UUID),y) -PYTHON3_DEPENDENCIES += util-linux -else -#PYTHON3_CONF_OPTS += --disable-uuid -endif - ifeq ($(BR2_PACKAGE_PYTHON3_BZIP2),y) PYTHON3_DEPENDENCIES += bzip2 else