From patchwork Tue Nov 17 18:02:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Gray X-Patchwork-Id: 1401734 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.136; helo=silver.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=UskJ6zex; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CbDLF5NJtz9sRR for ; Wed, 18 Nov 2020 05:02:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 46BA32152E; Tue, 17 Nov 2020 18:02:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6h4PDLRrRdao; Tue, 17 Nov 2020 18:02:23 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id EF76F214D2; Tue, 17 Nov 2020 18:02:22 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C7F27C0800; Tue, 17 Nov 2020 18:02:22 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id BA142C07FF for ; Tue, 17 Nov 2020 18:02:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9824620C41 for ; Tue, 17 Nov 2020 18:02:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9aCEY48onQpw for ; Tue, 17 Nov 2020 18:02:20 +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 [216.205.24.124]) by silver.osuosl.org (Postfix) with ESMTPS id 002B92034B for ; Tue, 17 Nov 2020 18:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605636138; 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=mib2l/zfiOWeoK9mQ+3+a5iVRZyz6f8NR8HTsgVtxjo=; b=UskJ6zexTBUYu4ypuwwwJJy/xV8h0uHWQyGeLINqiJtnxa8HpHhOV/J8v3vgf8U1tl0NzN v/+DmyRRjDcN74g6+9f/VktsAw0Bd96w2URAZByIHnjJB+BXFotL8U5eFt7knw9vuSAviO beQeCBkyjJP7ftD58iyaT2bu6MR595c= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-tPSfieTKMRiQkRDfga67GA-1; Tue, 17 Nov 2020 13:02:17 -0500 X-MC-Unique: tPSfieTKMRiQkRDfga67GA-1 Received: by mail-qk1-f198.google.com with SMTP id q25so14611908qkm.17 for ; Tue, 17 Nov 2020 10:02:17 -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=mib2l/zfiOWeoK9mQ+3+a5iVRZyz6f8NR8HTsgVtxjo=; b=c2vXLqB1SSK5IaLG7bEk4Zlw0W+rUBbVkfLc9eK9xrzKVD8Q12HNQtcnZmaWCv/kx6 sKoNHviO4NIMf1Ut35bzd2dkc4Qf67rd5Cx8Uk7EaAPFzbPtxvlvDWPKchhecAva6jfS 7Zz/ArfVJWahGO73Xupmah63CSxR+93gfVCw+S2ok6RuqJYQR56DChGfFjIt6xn26ZDW DJgvNI7n6wIXpBoaxhhCLELpL4K9/iK3sU6UEhZuk2BUl6TZT39Zbv3ArBvOez1TJzMH tS3jRaQIxBA3ejYBAcB5kqO9vvePylGi8AZlCp+jBmCAZdqbNnSWIReZwoDg71copX6l aw+A== X-Gm-Message-State: AOAM530LUuj30GmLeY0u4Ji+SYHh8JQXeLGo50nXT41DA1JgiLgakG/K hSA/0dSXWiI/5h1KA0B4ozyIA/KZI//j8F13sdgEUpnEkZY5nD1kEU6qFEfA78W5WCi9JvU2tcM SHn1yQQVapuokoBR4AvjhukwsNWjuxLSDWO3mDixpJLiVYAH4eEIJaRUkjUQFMLOJ57UGEPOknw == X-Received: by 2002:a37:2790:: with SMTP id n138mr740901qkn.324.1605636136263; Tue, 17 Nov 2020 10:02:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOrBqe7B0p4ig/GYX6tgHIekoQzM2nWrVtdbAtSDcPTdvCBb/PD+gBaOzRuOkxiu6VWoQsMQ== X-Received: by 2002:a37:2790:: with SMTP id n138mr740878qkn.324.1605636135926; Tue, 17 Nov 2020 10:02:15 -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 v6sm14595131qkh.83.2020.11.17.10.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 10:02:15 -0800 (PST) From: Mark Gray To: ovs-dev@openvswitch.org Date: Tue, 17 Nov 2020 13:02:12 -0500 Message-Id: <20201117180212.433352-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 v2] 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 lib/automake.mk | 2 +- python/automake.mk | 24 ++++++++++++------------ python/ovs/.gitignore | 2 +- python/setup.py | 9 +++++++++ tests/automake.mk | 2 +- vtep/automake.mk | 2 +- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/automake.mk b/lib/automake.mk index 8eeb6c3f676c..fad6ffb40cef 100644 --- a/lib/automake.mk +++ b/lib/automake.mk @@ -629,7 +629,7 @@ EXTRA_DIST += build-aux/extract-ofp-msgs # _server IDL OVSIDL_BUILT += lib/ovsdb-server-idl.c lib/ovsdb-server-idl.h lib/ovsdb-server-idl.ovsidl EXTRA_DIST += lib/ovsdb-server-idl.ann -lib/ovsdb-server-idl.ovsidl: ovsdb/_server.ovsschema lib/ovsdb-server-idl.ann +lib/ovsdb-server-idl.ovsidl: ovsdb/_server.ovsschema lib/ovsdb-server-idl.ann python/ovs/dirs.py $(AM_V_GEN)$(OVSDB_IDLC) annotate $(srcdir)/ovsdb/_server.ovsschema $(srcdir)/lib/ovsdb-server-idl.ann > $@.tmp && mv $@.tmp $@ INSTALL_DATA_LOCAL += lib-install-data-local 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) diff --git a/tests/automake.mk b/tests/automake.mk index 677b99a6b487..3faa7395a157 100644 --- a/tests/automake.mk +++ b/tests/automake.mk @@ -431,7 +431,7 @@ tests_test_lib_LDADD = lib/libopenvswitch.la OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann EXTRA_DIST += $(IDLTEST_IDL_FILES) tests/idltest2.ovsschema -tests/idltest.ovsidl: $(IDLTEST_IDL_FILES) +tests/idltest.ovsidl: $(IDLTEST_IDL_FILES) python/ovs/dirs.py $(AM_V_GEN)$(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp && \ mv $@.tmp $@ diff --git a/vtep/automake.mk b/vtep/automake.mk index e549922d915f..8632fb5b5b07 100644 --- a/vtep/automake.mk +++ b/vtep/automake.mk @@ -7,7 +7,7 @@ EXTRA_DIST += vtep/vtep-idl.ann VTEP_IDL_FILES = \ $(srcdir)/vtep/vtep.ovsschema \ $(srcdir)/vtep/vtep-idl.ann -vtep/vtep-idl.ovsidl: $(VTEP_IDL_FILES) +vtep/vtep-idl.ovsidl: $(VTEP_IDL_FILES) python/ovs/dirs.py $(AM_V_GEN)$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp && \ mv $@.tmp $@