From patchwork Mon Jan 28 01:38:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Nelson X-Patchwork-Id: 216093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 1F46C2C0090 for ; Mon, 28 Jan 2013 12:40:43 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 781448A8ED; Mon, 28 Jan 2013 01:40:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w7rdpu9+I84N; Mon, 28 Jan 2013 01:40:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D90484AAF; Mon, 28 Jan 2013 01:40:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id EF43C8F74B for ; Mon, 28 Jan 2013 01:40:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CCAE282809 for ; Mon, 28 Jan 2013 01:40:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bMxMRPkjRUqf for ; Mon, 28 Jan 2013 01:40:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by whitealder.osuosl.org (Postfix) with ESMTPS id 13B9F84AAF for ; Mon, 28 Jan 2013 01:40:33 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id hz1so1200789pad.26 for ; Sun, 27 Jan 2013 17:40:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=PgjG0T6ZUN5dg40tO2V0wq57+mHOrm+pUNOEpCwGKsE=; b=Jgi+uBB4F74qvQrNaHOf/RJvh1FtwUa/u9JZMTDE4orSb6PisBPHnq22WDiZv8noj5 HcjbQLBIS1xm02MRaOSgi2/eR6Gwy+Zrqj4cgP29NtsMlFQsHExYEWW9kgzPvGCFMZph QNkHlk53N3Ud4k7ImL3fm8ECmOl/QxjpRlheCu283EXN+GtwhF5tgy5Vhk7GiVB56YYn Sn+sUIkdIcZy0T7NHjfTeNEZcKNJfuaEFxVh1RWI0hYT8dscYo9+1WvHp4mXHwLD1gy9 z02lUVqCW/uW+/3OrKHqqXPeaGLyW+rguCgjO4qF+CVHUZO3EmeevSz3fTEkdQlnC0ez B7lA== X-Received: by 10.66.74.197 with SMTP id w5mr32177607pav.60.1359337232421; Sun, 27 Jan 2013 17:40:32 -0800 (PST) Received: from moss.sigpwr.com (c-24-4-98-26.hsd1.ca.comcast.net. [24.4.98.26]) by mx.google.com with ESMTPS id i6sm5654446paw.19.2013.01.27.17.40.30 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 27 Jan 2013 17:40:31 -0800 (PST) From: Daniel Nelson To: buildroot@busybox.net Date: Sun, 27 Jan 2013 17:38:56 -0800 Message-Id: <1359337136-14157-1-git-send-email-daniel@sigpwr.com> X-Mailer: git-send-email 1.8.1 In-Reply-To: <1359313382-2257-1-git-send-email-daniel@sigpwr.com> References: <1359313382-2257-1-git-send-email-daniel@sigpwr.com> Cc: maxime.ripard@free-electrons.com Subject: [Buildroot] [PATCHv2] python3: Fix pyc-only related runtime exceptions X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Python3 changes the pyc lookup strategy, ignoring the __pycache__ directory if the .py file is missing. Change install location to enable use of .pyc without their parent .py See http://www.python.org/dev/peps/pep-3147 Signed-off-by: Daniel Nelson Acked-by: Arnout Vandecappelle (Essensium/Mind) (untested) --- .../python3/python3-3.3-012-old-stdlib-cache.patch | 53 ++++++++++++++++++++++ package/python3/python3.mk | 4 ++ 2 files changed, 57 insertions(+) create mode 100644 package/python3/python3-3.3-012-old-stdlib-cache.patch diff --git a/package/python3/python3-3.3-012-old-stdlib-cache.patch b/package/python3/python3-3.3-012-old-stdlib-cache.patch new file mode 100644 index 0000000..23171d5 --- /dev/null +++ b/package/python3/python3-3.3-012-old-stdlib-cache.patch @@ -0,0 +1,53 @@ +--- python3-3.3.0/configure.ac 2013-01-27 16:35:52.429067797 -0800 ++++ python3-3.3.0/configure.ac 2013-01-27 16:43:43.528601443 -0800 +@@ -1827,6 +1827,23 @@ + LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; + esac + ++STDLIB_CACHE_FLAGS= ++AC_MSG_CHECKING(for --enable-old-stdlib-cache) ++AC_ARG_ENABLE(old-stdlib-cache, ++ AS_HELP_STRING([--enable-old-stdlib-cache], [enable pre-pep3147 stdlib cache]), ++[ ++ if test "$enableval" = "yes" ++ then ++ STDLIB_CACHE_FLAGS="-b" ++ else ++ STDLIB_CACHE_FLAGS="" ++ fi ++], ++[ ++ STDLIB_CACHE_FLAGS="" ++]) ++AC_SUBST(STDLIB_CACHE_FLAGS) ++ + AC_MSG_CHECKING(for --enable-framework) + if test "$enable_framework" + then +--- python3-3.3.0/Makefile.pre.in 2013-01-27 16:35:52.422067642 -0800 ++++ python3-3.3.0/Makefile.pre.in 2013-01-27 16:37:03.710650439 -0800 +@@ -143,6 +143,9 @@ + # Options to enable prebinding (for fast startup prior to Mac OS X 10.3) + OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@ + ++# Option to enable old-style precompiled stdlib ++STDLIB_CACHE_FLAGS=@STDLIB_CACHE_FLAGS@ ++ + # Environment to run shared python without installed libraries + RUNSHARED= @RUNSHARED@ + +@@ -1079,12 +1082,12 @@ + fi + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ ++ -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \ + -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ + $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ ++ -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt diff --git a/package/python3/python3.mk b/package/python3/python3.mk index e7c0983..7551a7b 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -70,6 +70,10 @@ else PYTHON3_CONF_OPT += --with-expat=none endif +ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY),y) +PYTHON3_CONF_OPT += --enable-old-stdlib-cache +endif + ifeq ($(BR2_PACKAGE_PYTHON3_SQLITE),y) PYTHON3_DEPENDENCIES += sqlite endif