Re: [netmod] import-by-semver issue

"Rob Wilton (rwilton)" <> Sun, 24 March 2019 09:40 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9487F130E79 for <>; Sun, 24 Mar 2019 02:40:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id iSz0u8DbFLHQ for <>; Sun, 24 Mar 2019 02:40:04 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 55C29130E7F for <>; Sun, 24 Mar 2019 02:40:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=21120; q=dns/txt; s=iport; t=1553420403; x=1554630003; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=K7BBJQcC5hQboJaRgUgfmZFPR2zIvaTlngvcMhqfshk=; b=DNxHTaLLk9ksMaQMjIB7m0H3iIBThAkuwAxLa/1tKOJCDOeAyZo7TRdC copx2lHgL12qNpMt3sCs7Bmx7SYLMyKWoE++c/0ZR/GybPKesC6Bvx/pC +5a+mtcD/a5sYGyf561XzZGv995F5xK4OE86UTV+iy9iy4R78dNq+DAXA A=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BDAAAlUJdc/4ENJK1jGQEBAQEBAQE?= =?us-ascii?q?BAQEBAQcBAQEBAQGBZYEPgQJogQMnCoQEkzuCDZo1DQEBI4RJAheEZSI4EgE?= =?us-ascii?q?BAwEBCQEDAm0cDIVKAQEBBCMKXAIBCBEEAQErAgICMB0IAgQBEggTgwiBEWQ?= =?us-ascii?q?Pq1CBL4Q0AoVpBYEvizIXgUA/hCM+gmEBAQIBhGiCVwOMcIQflAcJAodhi04?= =?us-ascii?q?hk36LHIYFjSUCERWBLjYhKIEucBWDJ4sMhT9BMY5wgR8BAQ?=
X-IronPort-AV: E=Sophos;i="5.60,256,1549929600"; d="scan'208,217";a="538929163"
Received: from ([]) by with ESMTP/TLS/DHE-RSA-SEED-SHA; 24 Mar 2019 09:39:43 +0000
Received: from ( []) by (8.15.2/8.15.2) with ESMTPS id x2O9dhYs010118 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 24 Mar 2019 09:39:43 GMT
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 24 Mar 2019 04:39:42 -0500
Received: from ([]) by ([]) with mapi id 15.00.1473.003; Sun, 24 Mar 2019 04:39:42 -0500
From: "Rob Wilton (rwilton)" <>
To: Andy Bierman <>, NetMod WG <>
Thread-Topic: [netmod] import-by-semver issue
Thread-Index: AQHU4arYjIn8/1YI30euxcwhgGMsT6YahbWg
Date: Sun, 24 Mar 2019 09:39:41 +0000
Message-ID: <>
References: <>
In-Reply-To: <>
Accept-Language: en-GB, en-US
Content-Language: en-US
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: []
Content-Type: multipart/alternative; boundary="_000_892d5ab4649549698808a6150067f840XCHRCD007ciscocom_"
MIME-Version: 1.0
Archived-At: <>
Subject: Re: [netmod] import-by-semver issue
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 24 Mar 2019 09:40:07 -0000

Hi Andy,

Yes we are currently implementing the module version field, although that may change depending on what different the final solution ends up being.

Support for import-by-version is less critical for us, and hence implementation would lag.

In terms of the issue that you raise:

-        I would expect that a compiler that understands semver to preload the semver extension, possibly allow with other common YANG type files, extensions).

-        For a compile that doesn’t understand semver then it would just ignore the extension, which should be fine.

I agree that it would be nice if this extension was part of the core YANG language, but I don’t think that is necessarily required.


From: netmod <> On Behalf Of Andy Bierman
Sent: 23 March 2019 19:01
To: NetMod WG <>
Subject: [netmod] import-by-semver issue


I am wondering if there are implementations of this draft:

Specifically, implementation of the  'version' extension

IMO it is a really bad idea to put the semantics of how to import modules
in one of the modules that is imported.  Your example shows ietf-semver
imported first with no extension, but it could be last with a version extension.

          // all other imports, then last....

    import ietf-semver {

      prefix "semver";

      semver:version 1.1.2;


Translation unit parsing is something that needs to be built into the compiler.
This should be part of YANG 1.2 if it is done.

  import example-module {

     prefix exmod;

     version 1.2.0+;


To a compiler writer, the difference is huge. (ietf-semver extensions need to
be built-in statements in YANG, at least 'version')

BTW, all the import examples are missing the mandatory prefix-stmt