From patchwork Sun Oct 4 21:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 1376545 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=An/hn0Mx; dkim-atps=neutral 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 4C4HSC6TJZz9sSn for ; Mon, 5 Oct 2020 08:49:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7D35086FA9; Sun, 4 Oct 2020 21:49:13 +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 8IPYx5bbh9rG; Sun, 4 Oct 2020 21:49:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E37DA86FAA; Sun, 4 Oct 2020 21:49:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C8FB91BF4E4 for ; Sun, 4 Oct 2020 21:49:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C557186FAA for ; Sun, 4 Oct 2020 21:49:11 +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 NjKz7Nqzojho for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7790B86FA9 for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id l17so7276368edq.12 for ; Sun, 04 Oct 2020 14:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/puhfOby4KH+TVxAX7oygICo30kVDj1lg4fAEdQcgSg=; b=An/hn0Mx/+z3i4lBhqe5Xmfh25wP339HI/hmBxV9jcCRalQGRqD3C/vY8BeKvLj0tu NPgEVAuLES+dUsVcNiV1Sg1QFcmFLYmkdoAs3m8Iw6pRV3kQbOTzz3UHTU1E3o+xNjrq x90us8n+in4QPgyEJXj+cvGi8cWyAkElZ6zKCzzkTWg5xn3/9HJUiaBpktJnf4l+9NFQ 1gSD1tqsNpzYzosnOXWNjZAZ9rOqtGn9Luy1d28m5L0rYq5rCunpmuYk6EnGyDmxDSBu SzshpSr4chGGj0zVV13HybGg3d94L/WuoSYjrByaGbiqt+aBUT6zDxSMVauFComfflte 9OcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/puhfOby4KH+TVxAX7oygICo30kVDj1lg4fAEdQcgSg=; b=LdgO7uqD6sF87MCJPqQ6UXjTcZgVDgyDhxbX7ywIFVqyPkFaRtbmLRrZH2MKPlI/C2 hIIYGD5ZQT32ycT2hSG2i23duofv7ldqTuO14Di7PHgVYjavDby8kUQak8vu22iB9vzA u0XyUOantbBlMdTQl2KFtxYi7zd8LYz6jdg3obD/QAnctytbS06iypHudvLZ6fDfYpCU XELsBZ8TlJqqc+W22RHT/SrXozDAVGvrsNu/4lrsVEN4BAowUy5kjJGiXl5n0kkTTnTx jI0j6NsfnkEipafSHLwfv8vVeclnQzTbWs0FHFDFsTwSlnWbSNzgwsz0m7EI0cGZiVW+ infw== X-Gm-Message-State: AOAM531GS+3O0Q5f3MtoO31qVsNcPZh9eK/8FjHQ7Onpm/9u6/Wfs4+h Nc/ayTXGqniFAwnv+StwXiNRZC34jDM= X-Google-Smtp-Source: ABdhPJxWwNN/o6SJjbh/Hpf2M43UZZQ6P5SuTAuvLt6j6WKwagwszkx3ymr27LNbjKTZ9UnzlTIaMw== X-Received: by 2002:a50:9e82:: with SMTP id a2mr13774748edf.117.1601848148616; Sun, 04 Oct 2020 14:49:08 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id u29sm616203eda.13.2020.10.04.14.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 14:49:08 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.92) (envelope-from ) id 1kPBsQ-0008Pz-NO; Sun, 04 Oct 2020 23:49:06 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Sun, 4 Oct 2020 23:49:02 +0200 Message-Id: <20201004214903.32309-2-peter@korsgaard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201004214903.32309-1-peter@korsgaard.com> References: <20201004214903.32309-1-peter@korsgaard.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] python-engineio: drop asyncio files for python 2.x to fix pycompile issue 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: Peter Korsgaard , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/72c/72cfdffeb4d0fb7c3032b52f0a26a4758eea6762/ engineio has conditional logic to load asyncio files when running under Python 3.x: if sys.version_info >= (3, 5): # pragma: no cover from .asyncio_server import AsyncServer from .asyncio_client import AsyncClient from .async_drivers.asgi import ASGIApp try: from .async_drivers.tornado import get_tornado_handler except ImportError: get_tornado_handler = None else: # pragma: no cover AsyncServer = None AsyncClient = None get_tornado_handler = None ASGIApp = None pycompile unfortunately errors out on these files when running under Python 2.x: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/engineio/asyncio_socket.py", line 13 async def poll(self): ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable file from TARGET_DIR if building for python 2.x. Signed-off-by: Peter Korsgaard --- package/python-engineio/python-engineio.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package/python-engineio/python-engineio.mk b/package/python-engineio/python-engineio.mk index 36ca326877..d0e073fa95 100644 --- a/package/python-engineio/python-engineio.mk +++ b/package/python-engineio/python-engineio.mk @@ -10,4 +10,14 @@ PYTHON_ENGINEIO_SETUP_TYPE = setuptools PYTHON_ENGINEIO_LICENSE = MIT PYTHON_ENGINEIO_LICENSE_FILES = LICENSE +ifeq ($(BR2_PACKAGE_PYTHON),y) +# only needed/valid for python 3.x +define PYTHON_ENGINEIO_RM_PY3_FILES + rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/engineio/async_drivers \ + $(TARGET_DIR)/usr/lib/python*/site-packages/engineio/asyncio_*.py +endef + +PYTHON_ENGINEIO_POST_INSTALL_TARGET_HOOKS += PYTHON_ENGINEIO_RM_PY3_FILES +endif + $(eval $(python-package))