with this patch:
ODP API version: 1.0.4
ODP implementation version: linux-generic 1.0.4-0 (v1.0.4) May 12
2015 13:31:28
ODP version: linux-generic 1.0.4-0 (v1.0.4) May 12 2015 13:31:28
without this patch:
ODP API version: 1.0.4
ODP implementation version: linux-generic 1.0.4-0 (v1.0.4) May 12
2015 13:32:53
I also think that new call is not needed. I think only thing we need is
test version number is case
if we do not change linux-generic implementation.
So final version formula is
$GEN.$MAJ.$MIN.$IMPL.$TEST - that version goes to packages, like debian.
This is numeric code which goes to packaging linux-generic. so it will
be opendataplane-1.1.0.0.tar.gz and deb files
according it line libodp-110.0.0.deb. I.e. in linux-generic we maintain
implementation number.
Verbose version sting can be the same + some generated value:
Like:
linux-generic 1.0.4.1 (v1.0.4) May 6 2015 07:54:33
1) "-" has to be "." to better match versions in packages.
2) "May 6 2015 07:54:33" has to be date of the tag or date of the latest
commit in ./platform/linux-generic/ directory.
C preprocessor __DATE__ will not work here, because this time will be
always different and useless.
I think we need to substitute commiter date for the latest commit in
rfc. Output from that command:
git log -1 --pretty="%cD"
(debian change log has the same date format.)
For one build data has to be the the same for all x86, arm, mips and etc
builds which we are going to ship as binaries.
3) From other point it we provide hash, like:
linux-generic 1.0.4.1 (v1.0.4) May 6 2015 07:54:33
https://git.linaro.org/lng/odp.git hash 812ea78445
Then time stamp is useless due to it always matches hash. But it's more
readable.
4) in some case if we change only test we add additional number at the
and. So it will be:
linux-generic 1.0.4.1.0 (v1.0.4) May 6 2015 07:54:33
https://git.linaro.org/lng/odp.git hash 812ea78445
linux-generic 1.0.4.1.1 (v1.0.4) May 6 2015 07:54:33
https://git.linaro.org/lng/odp.git hash 812ea78445
linux-generic 1.0.4.1.3 (v1.0.4) May 6 2015 07:54:33
https://git.linaro.org/lng/odp.git hash 812ea78445
So my vote is for following format:
linux-generic 1.0.4.1.0 (v1.0.4) May 6 2015 07:54:33
https://git.linaro.org/lng/odp.git hash 812ea78445
Thanks,
Maxim.
On 05/12/2015 11:14, Savolainen, Petri (Nokia - FI/Espoo) wrote:
Hi,
I may have missed some mail but ... don't get why the third string is needed.
API string (odp_version_api_str()) is the API version number in string format
(in addition to macros in numeric format). Implementation string
(odp_version_impl_str()) is a free form string containing whatever information
the implementation decides to put there. I’d expect a user to print out both of
those into a log or bug report.
What would be the use case for the third one? I expect odp_version_impl_str()
include all information needed to identify an implementation, including the
build number.
Examples of odp_version_impl_str():
linux-generic 1.0.4-0 (v1.0.4) May 6 2015 07:54:33
linux-generic 1.0.4-13 (v1.0.4) July 12 2015 08:23:09
linux-generic 1.0.4-22 (v1.0.4) Oct 1 2015 18:01:34
https://git.linaro.org/lng/odp.git hash 812ea78445
odp-for-xyz 1.0.4 build 1826 (API version 1.0.4) May 6 2015 07:54:33
odp-foo-bar 1.0.1-17 https://git.foo.org/foo_bar.git hash 75ed2758902
User would not compare or expect any format on the implementation specific
strings. The intention is that each implementation release/build would produces
a unique string, which helps then identify bugs,etc ... but implementation
decides.
-Petri
From: lng-odp [mailto:[email protected]] On Behalf Of ext Mike
Holmes
Sent: Monday, May 11, 2015 7:45 PM
To: Bill Fischofer
Cc: LNG ODP Mailman List
Subject: Re: [lng-odp] [API-NEXT PATCH] api: version.h: add odp_version_str
Thanks Bill.
Just need Petri or Robbies confirmation that 1.1 forward will use the
implementation version as a number and not a long string, essentially as it was
before but we failed to take advantage of it.
Mike
On 11 May 2015 at 12:40, Bill Fischofer <[email protected]> wrote:
On Fri, May 8, 2015 at 10:47 AM, Mike Holmes <[email protected]> wrote:
Signed-off-by: Mike Holmes <[email protected]>
Reviewed-by: Bill Fischofer <[email protected]>
---
include/odp/api/version.h | 17 +++++++++++++++++
platform/linux-generic/odp_impl.c | 16 ++++++++++++++++
test/miscellaneous/odp_api_from_cpp.cpp | 1 +
test/validation/common/odp_cunit_common.c | 1 +
test/validation/odp_init.c | 1 +
test/validation/odp_init_abort.c | 1 +
test/validation/odp_init_log.c | 1 +
7 files changed, 38 insertions(+)
diff --git a/include/odp/api/version.h b/include/odp/api/version.h
index 027095d..f64e4ef 100644
--- a/include/odp/api/version.h
+++ b/include/odp/api/version.h
@@ -50,6 +50,8 @@ extern "C" {
/**
* Returns ODP API version string
+ * @sa odp_version_impl_str()
+ * @sa odp_version_str()
*/
const char *odp_version_api_str(void);
@@ -61,10 +63,25 @@ const char *odp_version_api_str(void);
* of the API changing, this function returns that indication string.
* @note This string is implementation specific.
* @sa odp_version_api_str()
+ * @sa odp_version_str()
*
* @return null terminated implementation specific version identifier string
*/
const char *odp_version_impl_str(void);
+
+/**
+ * Returns ODP version string
+ *
+ * Verbosely describe the build in use, typicaly for use in log file.
+ * @note This string is implementation specific.
+ * @sa odp_version_api_str()
+ * @sa odp_version_impl_str()
+ *
+ * @return null terminated implementation specific version string
+ */
+const char *odp_version_str(void);
+
+
/**
* @}
*/
diff --git a/platform/linux-generic/odp_impl.c
b/platform/linux-generic/odp_impl.c
index 46d0e40..26ee3f9 100644
--- a/platform/linux-generic/odp_impl.c
+++ b/platform/linux-generic/odp_impl.c
@@ -38,6 +38,22 @@ const char *odp_version_impl_str(void)
return ODP_VERSION_IMPL_STR;
}
+#define ODP_VERSION_STR \
+ ODP_VERSION_TO_STR(PLATFORM) " " \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) "-" \
+ ODP_VERSION_TO_STR(ODP_VERSION_IMPL) " (v" \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_GENERATION) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MAJOR) "." \
+ ODP_VERSION_TO_STR(ODP_VERSION_API_MINOR) ") " \
+ __DATE__ " " __TIME__ " " \
+ ODP_VERSION_TO_STR(GIT_HASH)
+
+const char *odp_version_str(void)
+{
+ return ODP_VERSION_STR;
+}
#ifdef __cplusplus
}
#endif
diff --git a/test/miscellaneous/odp_api_from_cpp.cpp
b/test/miscellaneous/odp_api_from_cpp.cpp
index e62ef8d..f044f92 100644
--- a/test/miscellaneous/odp_api_from_cpp.cpp
+++ b/test/miscellaneous/odp_api_from_cpp.cpp
@@ -7,6 +7,7 @@ int main(int argc, const char *argv[])
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+ printf("\tODP version: %s\n", odp_version_str());
return 0;
}
diff --git a/test/validation/common/odp_cunit_common.c
b/test/validation/common/odp_cunit_common.c
index 2af4410..315a902 100644
--- a/test/validation/common/odp_cunit_common.c
+++ b/test/validation/common/odp_cunit_common.c
@@ -55,6 +55,7 @@ int main(void)
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+ printf("\tODP version: %s\n", odp_version_str());
if (0 != odp_init_global(NULL, NULL)) {
fprintf(stderr, "error: odp_init_global() failed.\n");
diff --git a/test/validation/odp_init.c b/test/validation/odp_init.c
index 82f8849..08e0b08 100644
--- a/test/validation/odp_init.c
+++ b/test/validation/odp_init.c
@@ -37,6 +37,7 @@ int main(void)
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+ printf("\tODP version: %s\n", odp_version_str());
CU_set_error_action(CUEA_ABORT);
diff --git a/test/validation/odp_init_abort.c b/test/validation/odp_init_abort.c
index ceb82b5..7844066 100644
--- a/test/validation/odp_init_abort.c
+++ b/test/validation/odp_init_abort.c
@@ -42,6 +42,7 @@ int main(void)
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+ printf("\tODP version: %s\n", odp_version_str());
CU_set_error_action(CUEA_ABORT);
diff --git a/test/validation/odp_init_log.c b/test/validation/odp_init_log.c
index 275d343..f905850 100644
--- a/test/validation/odp_init_log.c
+++ b/test/validation/odp_init_log.c
@@ -48,6 +48,7 @@ int main(void)
printf("\tODP API version: %s\n", odp_version_api_str());
printf("\tODP implementation version: %s\n", odp_version_impl_str());
+ printf("\tODP version: %s\n", odp_version_str());
CU_set_error_action(CUEA_ABORT);
--
2.1.4
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp