-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add recipe for ua-nodeset #7312
Changes from 19 commits
7f91dde
71779d1
4943e8d
436166e
029882b
20d1b52
941df87
d09c96a
b1f2beb
79fd9ed
9decffa
4e2471f
3a11220
9ab696f
7dc143f
3723652
aa96f30
094027b
fafc3b6
1aff707
b063d0e
49b808d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
sources: | ||
"1.04-2021-09-15": | ||
# This is just the latest tag on the 1.04 release branch as of 23Sep2021 | ||
url: https://github.com/OPCFoundation/UA-Nodeset/archive/refs/tags/PADIM-1.02-2021-07-21.tar.gz | ||
sha256: 05c83369ea82cd275d47ccc46a6d919c81392e2d0b7444a3e538ee3ba482dbee |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
required_conan_version = ">=1.33.0" | ||
|
||
|
||
class UaNodeSetConan(ConanFile): | ||
name = "ua-nodeset" | ||
license = "MIT" | ||
description = "UANodeSets and other normative files which are released with a specification" | ||
homepage = "https://github.com/OPCFoundation/UA-Nodeset" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
topics = ("opc-ua-specifications", "uanodeset", "normative-files", "companion-specification") | ||
|
||
no_copy_source = True | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def _extract_license(self): | ||
content = tools.load(os.path.join(self.source_folder, self._source_subfolder, "AnsiC", "opcua_clientapi.c")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see there are some sources ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These source files are just example files which could be used in combination with the official OPC Foundation reference ANSI C implementation, which is not open source. The other files, especially the NodeSet2.xml files (together with their Types.xsd and NodeId.csv) files are machine-readable descriptions of an OPC UA companion specification. The open62541 stack includes the nodeset generator, which generates C Code from these XML files, to correctly initialize an OPC UA Server with a given companion specification. That script is added in #7314 to open62541. |
||
license_contents = content[2:content.find("*/", 1)] | ||
tools.save("LICENSE", license_contents) | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version], strip_root=True, destination=self._source_subfolder) | ||
|
||
def build(self): | ||
pass | ||
|
||
|
||
def package(self): | ||
Pro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self._extract_license() | ||
self.copy("*", dst="res", src=self._source_subfolder) | ||
self.copy("LICENSE", dst="licenses") | ||
|
||
|
||
def package_info(self): | ||
self.cpp_info.libdirs = [] | ||
Mo-Tay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self.cpp_info.resdirs = ["res"] | ||
self.user_info.nodeset_dir = os.path.join(self.package_folder, "res") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from conans import ConanFile, CMake, tools | ||
import os | ||
|
||
|
||
class TestUaNodeSetConan(ConanFile): | ||
|
||
def build(self): | ||
pass | ||
|
||
def test(self): | ||
assert os.path.exists(os.path.join(self.deps_user_info["ua-nodeset"].nodeset_dir, "PLCopen")) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
versions: | ||
Mo-Tay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"1.04-2021-09-15": | ||
folder: all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to use an official release. We only allow different names when there is no official release: https://github.com/conan-io/conan-center-index/blob/master/docs/faqs.md#what-version-should-packages-use-for-libraries-without-official-releases
I understand this project is exceptional, but still we don't track branches, but releases. Please, revert to 1.02-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify:
1.04 is the current official release of the whole OPC UA NodeSets and Specification.
See for example here:
https://opcfoundation.org/developer-tools/specifications-unified-architecture/part-4-services/
You can see that the version of the specification is 1.04, i.e. the latest release.
This also matches with the Readme in UA-Nodeset repo:
The tags on the UA-Nodeset repo indicate specific versions of Sub Specifications.
E.g.,
PADIM-1.02-2021-07-21
means that this tag includes all previously released Companion Specifications, but Updates the PADIM Specification to version 1.02.Note that the PADIM Specification 1.02 still builds on top of the 1.04 Base Sepcification.
Yes I know that this is not straight forward, but unfortunately that's how the OPC Foundation decided to release their Companion Specs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we will follow any release scheme upstream uses, doesn't matter how weird and complex is it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, all clear :)
So should we then use as the version
padim-1.02-2021-07-21
(i.e., the latest tag of the 1.04 branch)?So the conan package will be
ua-nodeset/padim-1.02-2021-07-21
?Just using
ua-nodeset/1.02-2021-07-21
would not be correct, as one would assume that it is the 1.02 companion specification, and not 1.04 (which is included in the PADIM-1.02-2021-07-21).I just changed the recipe to that tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not the one who judge - you probably know better which version(s) you need.
we usually prefer latest official releases, unless there are strong reasons not to use them (e.g. breaking API changes).
if latest tag is latest release in that repository, than okay.
their versioning scheme is super confusing for the outsiders, so I would use tag name as is.
at least to distinguish base versions from PADIM versions (I have no idea what PADIM is and what's the difference from base, especially from the consumer point of view).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I completely agree that their tagging is very confusing.
IMHO using the Tag Name as version is less confusing from our side, than inventing a custom version string for conan.
SoIwpuld recommend to just use the complete tag, as it currently is 👍🏼