Re: [netmod] import-by-semver issue

"Rob Wilton (rwilton)" <> Sun, 24 March 2019 14:07 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 395D512788C for <>; Sun, 24 Mar 2019 07:07:21 -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 cxfG2twZeQha for <>; Sun, 24 Mar 2019 07:07:18 -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 7B88912426E for <>; Sun, 24 Mar 2019 07:07:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=30210; q=dns/txt; s=iport; t=1553436438; x=1554646038; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=WEo+2IWsZngl0VwwoCMQ/t1t286NoEpYt7qdjpyW35o=; b=MjV/f1ZX16197vyhuOUU7nxMWlXWHmpAbijf6SVZZIfN3ZQtvf81wfQ4 aJPR7DQlYksxAbfhhCDuhQ9PgP+XE6gbls+dvVLPikTuiemfl7PKCaX7l i/7VD1e7XOGRnsyORYZX1qwW/zpyvmCH1P3HavRkyxeTee6a1HlM8BOwU 0=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0APAACMjpdc/4YNJK1jGQEBAQEBAQE?= =?us-ascii?q?BAQEBAQcBAQEBAQGBVAEBAQEBAQsBgQ6BAmiBAycKhASVSJo1DQEBI4RJAhe?= =?us-ascii?q?EZSI3Bg0BAQMBAQkBAwJtHAyFSgEBAQQjCkwQAgEIEQQBASEHAwICAjAUCQg?= =?us-ascii?q?CBA4FCBODCIERZA+sIoEvhDQChWkFgS8BizEXgUA/hCM+gmEBAQIBghSCVIJ?= =?us-ascii?q?XA4xwhB+UBwkCh2GLTiGTfpEhjSUCERWBLjUiKIEucBWDJ4sMhT9BMY50gR8?= =?us-ascii?q?BAQ?=
X-IronPort-AV: E=Sophos;i="5.60,256,1549929600"; d="scan'208,217";a="249629734"
Received: from ([]) by with ESMTP/TLS/DHE-RSA-SEED-SHA; 24 Mar 2019 14:07:16 +0000
Received: from ( []) by (8.15.2/8.15.2) with ESMTPS id x2OE7GmY009454 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 24 Mar 2019 14:07:16 GMT
Received: from ( by ( with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 24 Mar 2019 09:07:16 -0500
Received: from ([]) by ([]) with mapi id 15.00.1473.003; Sun, 24 Mar 2019 09:07:15 -0500
From: "Rob Wilton (rwilton)" <>
To: Andy Bierman <>
CC: NetMod WG <>
Thread-Topic: [netmod] import-by-semver issue
Thread-Index: AQHU4arYjIn8/1YI30euxcwhgGMsT6YahbWggABuJwD//9uzgA==
Date: Sun, 24 Mar 2019 14:07:15 +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_4c0a8dca338f4ca384dea933f046511eXCHRCD007ciscocom_"
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 14:07:21 -0000

Hi Andy,

There are many ways to write and design compilers.

Compilers that don’t understand import-by-semver just ignore the extension, no deviation is required.  They just import whichever arbitrary revision that they would have imported anyway, as specified by YANG 1.1.  The import-by-semver statement just reduces the set of valid modules revisions that can be used for import.


From: Andy Bierman <>
Sent: 24 March 2019 12:07
To: Rob Wilton (rwilton) <>
Cc: NetMod WG <>
Subject: Re: [netmod] import-by-semver issue

On Sun, Mar 24, 2019 at 2:40 AM Rob Wilton (rwilton) <<>> wrote:
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.

Try to find even 1 compiler in the world that works this way.
Yes you can specially hack the extension implementation as if it were a built-in keyword.

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.

I don't think any of semver is required for anything.
IMO it provides a minor improvement to  people familiar with the MAJOR.MINOR.PATCH numbering.
This improvement is lost as soon as extra letters are added and the string is no longer familiar.

Import-by-semver seems like it is part of the base module (no if-feature on the extension-stmt is even possible)
so skipping the implementation of it needs a deviation (oh wait, YANG 1.1 can't do that either).



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