mouse07410 / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
98 stars 71 forks source link

Version string is always the same even across forks! #75

Open gatopeich opened 3 years ago

gatopeich commented 3 years ago

I have been testing a few forks and branches of asn1c and it was quite confusing to distinguish which binary I am running, since they all spit the same version "ASN.1 Compiler, v0.9.29"

It would make sense to include a reference to the repo name, branch and latest commit:

$ asn1c -v
ASN.1 Compiler, v0.9.29 (mouse07410/asn1c vlm_master a6376b4)
Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info> and contributors.
mouse07410 commented 3 years ago

If you can tell me how to do it (in an easy and simple way), I'll be happy to oblige.

mouse07410 commented 3 years ago

@gatopeich ping?

This seems to be a useful feature, but I don't have enough of Git and toolchain experience to know how to do that. So, recommendations are welcome. A PR would be even better.

gatopeich commented 3 years ago

Just edit first line in root dir configure.ac: AC_INIT([asn1c],[0.9.29],[vlm@lionet.info]) Into something like AC_INIT([asn1c],[0.9.29+mouse07410/vlm_master],[mouse07410@github.com],,[https://github.com/mouse07410/asn1c])

With a bit of time we could add commit hash to the version string which I usually do, but this suffices for my needs 🙂

gatopeich commented 3 years ago

Even better (untested):

AC_INIT([asn1c], m4_esyscmd([echo `git describe --dirty --tags`/mouse07410/vlm_master]),[mouse07410@github.com],,[https://github.com/mouse07410/asn1c])

This produces version "v0.9.28-951-ga6376b40/mouse07410/vlm_master" for me, but "mouse07410/vlm_master" should come from git branch XXX somehow to make it generic, and "https://github.com/mouse07410/asn1c" should come from git remote

mouse07410 commented 3 years ago
AC_INIT([asn1c], m4_esyscmd([echo 0.9.29+mouse07410/`git describe --dirty --all`]),[mouse07410@github.com],,[https://github.com/mouse07410/asn1c])

Sorry to say, the above does not work.

AC_INIT([asn1c],[0.9.29+mouse07410/vlm_master],[mouse07410@github.com],,[https://github.com/mouse07410/asn1c])

This does not work either:

make[4]: Entering directory '/Users/ur20980/src/asn1c/tests/tests-asn1c-compiler'
FAIL: check-parsing.sh
============================================================================
Testsuite summary for asn1c 0.9.29+mouse07410/vlm_master
============================================================================
# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See tests/tests-asn1c-compiler/test-suite.log

And in the log:

$ cat tests/tests-asn1c-compiler/test-suite.log
===================================================================================
   asn1c 0.9.29+mouse07410/vlm_master: tests/tests-asn1c-compiler/test-suite.log
===================================================================================

# TOTAL: 1
# PASS:  0
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check-parsing.sh
======================

Checking ../../tests/tests-asn1c-compiler/03-enum-OK.asn1 against ../../tests/tests-asn1c-compiler/03-enum-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/03-enum-OK.asn1 against ../../tests/tests-asn1c-compiler/03-enum-OK.asn1.+-P_-fwide-types
Checking ../../tests/tests-asn1c-compiler/04-enum-SE.asn1 against ../../tests/tests-asn1c-compiler/04-enum-SE.asn1.+-E
Checking ../../tests/tests-asn1c-compiler/07-int-OK.asn1 against ../../tests/tests-asn1c-compiler/07-int-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/100-class-ref-OK.asn1 against ../../tests/tests-asn1c-compiler/100-class-ref-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1 against ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1.+-E_-F
FATAL: Unknown type "REF-ID2" referenced by "REF-ID" at line 15 in ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1
FATAL: Unknown type "REF-ID" referenced by "REF-ID2" at line 17 in ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1
FATAL: Class field REF-ID.&id lookup at line 18 in something that is not a class: REF-ID2 at line 17 in ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1
FATAL: Unknown type "REF-ID.&id" referenced by "field" at line 18 in ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1
FATAL: Unknown type "REF-ID.&Type" referenced by "params" at line 20 in ../../tests/tests-asn1c-compiler/102-class-ref-SE.asn1
Checking ../../tests/tests-asn1c-compiler/104-param-1-OK.asn1 against ../../tests/tests-asn1c-compiler/104-param-1-OK.asn1.+-E_-F_-print-class-matrix
Checking ../../tests/tests-asn1c-compiler/104-param-1-OK.asn1 against ../../tests/tests-asn1c-compiler/104-param-1-OK.asn1.+-P_-fwide-types
Checking ../../tests/tests-asn1c-compiler/105-param-2-OK.asn1 against ../../tests/tests-asn1c-compiler/105-param-2-OK.asn1.+-P_-fwide-types
Checking ../../tests/tests-asn1c-compiler/106-param-constr-OK.asn1 against ../../tests/tests-asn1c-compiler/106-param-constr-OK.asn1.+-P
Checking ../../tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1 against ../../tests/tests-asn1c-compiler/108-param-constr-3-OK.asn1.+-P_-fwide-types
Checking ../../tests/tests-asn1c-compiler/110-param-3-OK.asn1 against ../../tests/tests-asn1c-compiler/110-param-3-OK.asn1.+-P_-fcompound-names
Checking ../../tests/tests-asn1c-compiler/112-param-class-OK.asn1 against ../../tests/tests-asn1c-compiler/112-param-class-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/117-real-constraint-OK.asn1 against ../../tests/tests-asn1c-compiler/117-real-constraint-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/118-per-constraint-OK.asn1 against ../../tests/tests-asn1c-compiler/118-per-constraint-OK.asn1.+-E_-Fprint-constraints
Checking ../../tests/tests-asn1c-compiler/119-per-strings-OK.asn1 against ../../tests/tests-asn1c-compiler/119-per-strings-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/119-per-strings-OK.asn1 against ../../tests/tests-asn1c-compiler/119-per-strings-OK.asn1.+-P_-gen-UPER_-gen-APER
Checking ../../tests/tests-asn1c-compiler/121-empty-imports-OK.asn1 against ../../tests/tests-asn1c-compiler/121-empty-imports-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/123-valueassignment-OK.asn1 against ../../tests/tests-asn1c-compiler/123-valueassignment-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1 against ../../tests/tests-asn1c-compiler/124-multiconstraint-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1 against ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1 against ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.+-P
Checking ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1 against ../../tests/tests-asn1c-compiler/125-bitstring-constraint-OK.asn1.+-X
--- .tmp.check-parsing.90417.old    2021-09-26 10:49:06.000000000 -0400
+++ .tmp.check-parsing.90417.new    2021-09-26 10:49:06.000000000 -0400
@@ -1,4 +1,4 @@
-<!-- XML DTD generated by asn1c-0.9.29 -->
+<!-- XML DTD generated by asn1c-0.9.29+mouse07410/vlm_master -->

 <!-- ASN.1 module
 ModuleBitStringConstraint { iso org(3) dod(6) internet(1) private(4)
Checking ../../tests/tests-asn1c-compiler/126-per-extensions-OK.asn1 against ../../tests/tests-asn1c-compiler/126-per-extensions-OK.asn1.+-P_-gen-UPER_-gen-APER
Checking ../../tests/tests-asn1c-compiler/127-per-long-OK.asn1 against ../../tests/tests-asn1c-compiler/127-per-long-OK.asn1.+-P_-gen-UPER_-gen-APER
Checking ../../tests/tests-asn1c-compiler/129-enum-OK.asn1 against ../../tests/tests-asn1c-compiler/129-enum-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/130-enum-OK.asn1 against ../../tests/tests-asn1c-compiler/130-enum-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/131-per-empty-OK.asn1 against ../../tests/tests-asn1c-compiler/131-per-empty-OK.asn1.+-P_-gen-UPER_-gen-APER
Checking ../../tests/tests-asn1c-compiler/134-per-long-OK.asn1 against ../../tests/tests-asn1c-compiler/134-per-long-OK.asn1.+-P_-gen-UPER_-gen-APER
Checking ../../tests/tests-asn1c-compiler/136-oer-long-OK.asn1 against ../../tests/tests-asn1c-compiler/136-oer-long-OK.asn1.+-P_-gen-OER
Checking ../../tests/tests-asn1c-compiler/137-oer-string-OK.asn1 against ../../tests/tests-asn1c-compiler/137-oer-string-OK.asn1.+-P_-gen-OER
Checking ../../tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1 against ../../tests/tests-asn1c-compiler/138-oer-constraints-OK.asn1.+-P_-gen-OER
Checking ../../tests/tests-asn1c-compiler/139-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/139-component-relation-OK.asn1.+-E_-F_-print-class-matrix
Checking ../../tests/tests-asn1c-compiler/139-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/139-component-relation-OK.asn1.+-P
Generated asn_constant.h
--- .tmp.check-parsing.90417.old    2021-09-26 10:49:07.000000000 -0400
+++ .tmp.check-parsing.90417.new    2021-09-26 10:49:07.000000000 -0400
@@ -642,7 +642,7 @@
 /*** <<< asn_constant.h >>> ***/

 /*
- * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * Generated by asn1c-0.9.29+mouse07410/vlm_master (http://lionet.info/asn1c)
  */

 #ifndef _ASN_CONSTANT_H
Checking ../../tests/tests-asn1c-compiler/14-resolver-OK.asn1 against ../../tests/tests-asn1c-compiler/14-resolver-OK.asn1.+-E_-F
Checking ../../tests/tests-asn1c-compiler/140-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/140-component-relation-OK.asn1.+-E_-F_-print-class-matrix
Checking ../../tests/tests-asn1c-compiler/140-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/140-component-relation-OK.asn1.+-P
Generated asn_constant.h
--- .tmp.check-parsing.90417.old    2021-09-26 10:49:07.000000000 -0400
+++ .tmp.check-parsing.90417.new    2021-09-26 10:49:07.000000000 -0400
@@ -642,7 +642,7 @@
 /*** <<< asn_constant.h >>> ***/

 /*
- * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * Generated by asn1c-0.9.29+mouse07410/vlm_master (http://lionet.info/asn1c)
  */

 #ifndef _ASN_CONSTANT_H
Checking ../../tests/tests-asn1c-compiler/141-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/141-component-relation-OK.asn1.+-E_-F_-print-class-matrix
Checking ../../tests/tests-asn1c-compiler/141-component-relation-OK.asn1 against ../../tests/tests-asn1c-compiler/141-component-relation-OK.asn1.+-P
Generated asn_constant.h
--- .tmp.check-parsing.90417.old    2021-09-26 10:49:07.000000000 -0400
+++ .tmp.check-parsing.90417.new    2021-09-26 10:49:07.000000000 -0400
@@ -729,7 +729,7 @@
 /*** <<< asn_constant.h >>> ***/

 /*
- * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
+ * Generated by asn1c-0.9.29+mouse07410/vlm_master (http://lionet.info/asn1c)
  */

 #ifndef _ASN_CONSTANT_H
Checking ../../tests/tests-asn1c-compiler/142-anonymous-types-deco-OK.asn1 against ../../tests/tests-asn1c-compiler/142-anonymous-types-deco-OK.asn1.+-P_-fcompound-names
Checking ../../tests/tests-asn1c-compiler/143-inner-parameterization-OK.asn1 against ../../tests/tests-asn1c-compiler/143-inner-parameterization-OK.asn1.+-P
Checking ../../tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1 against ../../tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1.+-P
WARNING: Parameterized type MYID expected for MYID at line 30 in ../../tests/tests-asn1c-compiler/144-ios-parameterization-OK.asn1
.  .  .  .  .
Checking ../../tests/tests-asn1c-compiler/98-attribute-class-OK.asn1 against ../../tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.+-E_-F_-print-class-matrix
Checking ../../tests/tests-asn1c-compiler/98-attribute-class-OK.asn1 against ../../tests/tests-asn1c-compiler/98-attribute-class-OK.asn1.+-P
FATAL: Inappropriate value {3 2 1} for type raf
FATAL: Inappropriate value {3 2 2} for type rcf
Checking ../../tests/tests-asn1c-compiler/99-class-sample-OK.asn1 against ../../tests/tests-asn1c-compiler/99-class-sample-OK.asn1.+-E_-F_-print-class-matrix
Error while processing ../../tests/tests-asn1c-compiler/50-constraint-OK.asn1.+-P_-gen-UPER_-gen-APER (from ../../tests/tests-asn1c-compiler/50-constraint-OK.asn1)
FAIL check-parsing.sh (exit status: 1)
mouse07410 commented 3 years ago

@gatopeich perhaps you'd like to submit a PR?

gatopeich commented 3 years ago

I'd love to, but I am terribly busy :-( Maybe try replacing special symbols "+" and "/" with "-" I will have a look on next chance...

mouse07410 commented 3 years ago

I'd love to, but I am terribly busy :-(

I hate to admit it, but I'm also quite busy - and the proposed change is outside of my area of expertise/experience. :-(