asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Add version and origin URL to binary and generated sources

Open gatopeich opened this issue 1 year ago • 6 comments

asn1c identifies itself and its generated sources with the latest release/tag name, commit hash, and date of the last commit. Also shows the URL from git remote get-url origin so it is easy to trace it back to the specific fork that was used.

$ asn1c -v
ASN.1 Compiler, v2023.5-0-g47a234a0-dirty-2023-05-18 from https://github.com/mouse07410/asn1c
Copyright (c) 2003-2017 Lev Walkin <[email protected]> and contributors.

And in the C sources:

/*
 * Generated by asn1c-v2023.5-0-g47a234a0-dirty-2023-05-18 from https://github.com/mouse07410/asn1c
 * From ASN.1 module "F1AP-Containers"
 * 	found in "f1ap-v15.10.asn"
 */

gatopeich avatar Jun 02 '23 16:06 gatopeich

@mouse07410 this is my first PR, let's start by distinguishing the version we are using... should adjust automatically for any fork cloned via git. Afterwards we'll look into more interesing fixes...

gatopeich avatar Jun 02 '23 16:06 gatopeich

@mouse07410 this is my first PR,

Certainly. First, welcome in!

let's start by distinguishing the version we are using... should adjust automatically for any fork cloned via git.

Yes. My apologies for delay in getting to this - other things piled up.

Let's see what the CI has to say. I suspect we (you ;-) would need to do more changes, as I seem to recall that ASN.1 compiler version is hard-coded in the tests (rather unfortunate, but I "inherited" this vast body of tests from the upstream).

Afterwards we'll look into more interesting fixes...

Absolutely!

Update

@gatopeich if you could take a look at the tests and why they fail? E.g., run make check on your fork?

Update 2

Please merge the current vlm_master into your branch before running the tests.

mouse07410 avatar Jun 15 '23 17:06 mouse07410

@gatopeich could you please try to address the CI failure in your PR?

mouse07410 avatar Aug 05 '23 01:08 mouse07410

I haven't forgotten, will do it on next chance

gatopeich avatar Aug 27 '23 00:08 gatopeich

Hey guys. I agree, this is a very useful feature. In my system, with a freshly cloned repo (from gatopeich:o-ran), the version command outputs:

$ asn1c -v
ASN.1 Compiler, v18f84280-2023-05-18 from https://github.com/gatopeich/asn1c
Copyright (c) 2003-2017 Lev Walkin <[email protected]> and contributors.

I suggest keeping some sort of incremental versioning (like SemVer), as package systems usually rely on an incremental system to correctly do updates.

v0-e avatar Oct 12 '23 07:10 v0-e

Standing by for a PR that provides the necessary functionality and passes CI. 😉

mouse07410 avatar Oct 12 '23 10:10 mouse07410