From patchwork Thu Nov 19 08:44:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1402800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=JwJCgofo; 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 4CcCsx5sjTz9sTR for ; Thu, 19 Nov 2020 19:44:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E426E873A2; Thu, 19 Nov 2020 08:44:50 +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 A3BAB2yJJZWu; Thu, 19 Nov 2020 08:44:50 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 1862E8738D; Thu, 19 Nov 2020 08:44:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD632C1825; Thu, 19 Nov 2020 08:44:49 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A4137C0891 for ; Thu, 19 Nov 2020 08:44:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8B4A48738D for ; Thu, 19 Nov 2020 08:44:48 +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 ie9UTDmXYp0p for ; Thu, 19 Nov 2020 08:44:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id 8272F87373 for ; Thu, 19 Nov 2020 08:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605775486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dspt6uNrmlvarpt45Nb9XrSqKAHGIFqyob/oDNOllK0=; b=JwJCgofojzJ6bMlFlCY7vMmPs/VOxBvsxRQQeYhfPsfN6D9unVpzOpVw+c43WC1xxYi1S8 8av70Mo0LgP+ggj95eNtFNNtMkYA7VpDGWRkJXri1eFBTgtIWKDZu1B8E+GZyWlQk62OJR C/RVHbvWcpzfdhZJ4DZG9SbHZhk5UFo= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-268-yM5qd6B1MUSNby6YMacsPw-1; Thu, 19 Nov 2020 03:44:43 -0500 X-MC-Unique: yM5qd6B1MUSNby6YMacsPw-1 Received: by mail-pg1-f198.google.com with SMTP id e3so3503910pgu.1 for ; Thu, 19 Nov 2020 00:44:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dspt6uNrmlvarpt45Nb9XrSqKAHGIFqyob/oDNOllK0=; b=pnhwnCh5jyXVEwg9f+6+LcrZP+S3P3zQvGexTFMgWFA5xM4jBJq8UrqHl9NkWO8fFi SQEFhauRoWzoznBNXDL9sltVn/CUEi1EY1YzZlWRW7zEKMqcfNJR5yGRsAMS1n2QfDcU y6CNg2CItRGbAfK5Eq2zk77gKMPAbxFXAOCDn7nbeBkswVQSN+79CPFn2FTLhzX0zzpq ziheJIqKVUA+Omn2nVd/V2s0jnAdpL2d2jyOEMm5cHtQwIZ5fo8T2fKSJ0fX83tnxNKC LwGoe789jXS59/rsfpdybuFyU31JFtsbquGRFf84JOxVLAJJvESvflHKFZpuXBwJ8R/w 31Mw== X-Gm-Message-State: AOAM533scxm8+TA1SlxAArNJT/sx00oZXSfwh6mE/liOFfP24cVwY3/g T8afhN+rBarfWsuLf7ekZD/uW+ClCxNq5pl2NzQBcn3q/oDib3/V9tXTif+NNVmxcwwz/b8h4c5 g3ikluimt4/YVYA1Me9LUcL14Adqb7uhJCMCDvXtbMoppJtc1TLo9sch1eDXylHYMZsK8rYh8Zg == X-Received: by 2002:a17:902:ed01:b029:d6:bb79:d46a with SMTP id b1-20020a170902ed01b02900d6bb79d46amr8504049pld.76.1605775482063; Thu, 19 Nov 2020 00:44:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJywaRNGTE9pAupyxzQiMrFL4lOatYsfT9h2iUVgAINbiaEY6g//JrwdJHz/J8cI5uCYrhN5FA== X-Received: by 2002:a17:902:ed01:b029:d6:bb79:d46a with SMTP id b1-20020a170902ed01b02900d6bb79d46amr8504025pld.76.1605775481723; Thu, 19 Nov 2020 00:44:41 -0800 (PST) Received: from wsfd-netdev77.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i26sm29110494pfq.148.2020.11.19.00.44.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Nov 2020 00:44:41 -0800 (PST) From: Mark Gray To: ovs-dev@openvswitch.org Date: Thu, 19 Nov 2020 03:44:34 -0500 Message-Id: <20201119084434.461714-1-mark.d.gray@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mark.d.gray@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v3] python: Update build system to ensure dirs.py is created X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Update build system to ensure dirs.py is created when it is a dependency for a build target. Also, update setup.py to check for that dependency. Signed-off-by: Mark Gray --- v2: Added v2 tag v3: Updated as per Ilya's comments lib/automake.mk | 2 +- ovsdb/automake.mk | 2 +- python/automake.mk | 24 ++++++++++++------------ python/ovs/.gitignore | 2 +- python/setup.py | 9 +++++++++ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/lib/automake.mk b/lib/automake.mk index 8eeb6c3f676c..380a672287ac 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -575,7 +575,7 @@ MAN_FRAGMENTS += \ OVSIDL_BUILT += lib/vswitch-idl.c lib/vswitch-idl.h lib/vswitch-idl.ovsidl EXTRA_DIST += lib/vswitch-idl.ann -lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann python/ovs/dirs.py +lib/vswitch-idl.ovsidl: vswitchd/vswitch.ovsschema lib/vswitch-idl.ann $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/vswitchd/vswitch.ovsschema $(srcdir)/lib/vswitch-idl.ann > $@.tmp && mv $@.tmp $@ lib/dirs.c: lib/dirs.c.in Makefile diff --git a/ovsdb/automake.mk b/ovsdb/automake.mk index b895f42925ef..d60f3f4ec8cb 100644 --- a/ovsdb/automake.mk +++ b/ovsdb/automake.mk @@ -106,7 +106,7 @@ CLEANFILES += $(OVSIDL_BUILT) # However, current versions of Automake seem to output all variable # assignments before any targets, so it doesn't seem to be a problem, # at least for now. -$(OVSIDL_BUILT): ovsdb/ovsdb-idlc.in +$(OVSIDL_BUILT): ovsdb/ovsdb-idlc.in python/ovs/dirs.py # ovsdb-doc EXTRA_DIST += ovsdb/ovsdb-doc diff --git a/python/automake.mk b/python/automake.mk index c4382ec60928..767512f1757f 100644 --- a/python/automake.mk +++ b/python/automake.mk @@ -74,12 +74,12 @@ ovs-install-data-local: $(MKDIR_P) python/ovs sed \ -e '/^##/d' \ - -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ - -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ - -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ - -e 's,[@]bindir[@],$(bindir),g' \ - -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ - -e 's,[@]DBDIR[@],$(DBDIR),g' \ + -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ + -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ + -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ + -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]DBDIR[@],$(DBDIR),g' \ < $(srcdir)/python/ovs/dirs.py.template \ > python/ovs/dirs.py.tmp $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/python/ovs @@ -107,12 +107,12 @@ ALL_LOCAL += $(srcdir)/python/ovs/dirs.py $(srcdir)/python/ovs/dirs.py: python/ovs/dirs.py.template $(AM_V_GEN)sed \ -e '/^##/d' \ - -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ - -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ - -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ - -e 's,[@]bindir[@],$(bindir),g' \ - -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ - -e 's,[@]DBDIR[@],$(sysconfdir)/openvswitch,g' \ + -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \ + -e 's,[@]RUNDIR[@],$(RUNDIR),g' \ + -e 's,[@]LOGDIR[@],$(LOGDIR),g' \ + -e 's,[@]bindir[@],$(bindir),g' \ + -e 's,[@]sysconfdir[@],$(sysconfdir),g' \ + -e 's,[@]DBDIR[@],$(sysconfdir)/openvswitch,g' \ < $? > $@.tmp && \ mv $@.tmp $@ EXTRA_DIST += python/ovs/dirs.py.template diff --git a/python/ovs/.gitignore b/python/ovs/.gitignore index 51030beca437..8bbcd824f472 100644 --- a/python/ovs/.gitignore +++ b/python/ovs/.gitignore @@ -1,2 +1,2 @@ version.py -dir.py +dirs.py diff --git a/python/setup.py b/python/setup.py index b7252800c1c1..d385d8372239 100644 --- a/python/setup.py +++ b/python/setup.py @@ -30,6 +30,15 @@ except IOError: file=sys.stderr) sys.exit(-1) +try: + # Try to open generated ovs/dirs.py. However, in this case we + # don't need to exec() + open("ovs/dirs.py") +except IOError: + print("Ensure dirs.py is created by running make python/ovs/dirs.py", + file=sys.stderr) + sys.exit(-1) + ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError) if sys.platform == 'win32': ext_errors += (IOError, ValueError)