asn1scc icon indicating copy to clipboard operation
asn1scc copied to clipboard

split runtime into c modules

Open vgheo opened this issue 7 years ago • 9 comments

cf. https://github.com/ttsiodras/asn1scc/issues/67

RTL modularsation Introduce proper modules (header/source code file pairs). Existing code is grouped into cohesive modules.

The idea is to have clean modules in the source code (as I understand the design intention) :

  • asn1crt_core.h - fundamental definitions
  • asn1crt_util.h, util.c - basic utilities for other
  • asn1crt_real.h, real.c
  • BitStream.{h,c}, ByteStream.{h,c} - base abstractions
    • use core, util
  • encodings
    • asn1crt_xer.h, xer.c
    • ans1crt_ber.h, ber.c
    • asn1crt_acn.h, acn.c

See refactoring.xlsx for the description of the included code changes.

vgheo avatar Oct 29 '16 22:10 vgheo

Can't merge this - as you can see it breaks the build.

ttsiodras avatar Oct 30 '16 09:10 ttsiodras

Hi, I see. It is related to the new file names of the c runtime library source code. I'll try to fix the build.

vgheo avatar Oct 30 '16 10:10 vgheo

I have trouble re-generating Resource1.Designer.cs from Resource1.resx. Also, I cannot seem to do the build on my station, as I have Ubuntu 16.04, and the mono version seems not compatible for asn1scc builds. I could try to setup a docker instance with ubuntu 14.04, to get the compatible dev environment. Any hints ?

vgheo avatar Oct 30 '16 21:10 vgheo

Before going the Docker or the VM way, try

 xbuild /p:TargetFrameworkVersion="v4.6"

...or whatever version you have installed in your system.

T.

ttsiodras avatar Oct 31 '16 09:10 ttsiodras

I have the build now on ubuntu 14.04 (using docker) and ubuntu16.04, with xbuild /p:TargetFrameworkVersion="v4.5" Great.

Now I get the same errors as in the circleCI official build.

I have zero (now .. one day) experience with csharp/fsharp.

Talking about bad design.. I understand that the file Resource1.resx gets translated into Resource1.Designer.cs. I do not understand why is this not generated during the build, and therefore not included (as it is now) under version control. In any case, I would expect that if the source file resx is newer than the generated file, the build system would detect this and auto-generate it. Do I really need an IDE to do that ??

(But hey, this is 1970-style design, and no fancy gui needed ... maybe there are good reasons why I have zero experience with ms stuff...)

I've also installed monodevelop, it seems to attempt to generate the thing, but it fails with an error. ( I'll maybe look at it further - the forums indicate that monodevelop does not handle '' charaters in resource paths.. but is it acceptable to switch it to unix-style '/' ?)

In any case - how am I suppose to generate this thing ? What is the required tool environment for a asn1scc developer ? Could you maybe kindly do it for me and spare me the ordeal ?

Best Regards Vlad

vgheo avatar Oct 31 '16 20:10 vgheo

Not an ms guy either :-) The last time I touched MS build systems was more than a decade ago, and I remember (vividly) that the experience made me appreciate good old Makefiles even more. I am afraid I can't help you there (also, neck-deep in work - don't expect to resurface for at least two-three weeks).

ttsiodras avatar Oct 31 '16 20:10 ttsiodras

OK, got it to build and pass all tests on my machine. (I'll probably get it too on CI) Now - are you fine with the 16 files of the runtime, that end up in the users' projects ? I've tried to avoid name clashes by using the asn1scc_prefix on them - but still it's a significant change..

vgheo avatar Oct 31 '16 21:10 vgheo

Dear Thanassis, What are the chances of you having a look at this soon ? Best regards Vlad

vgheo avatar Dec 12 '16 18:12 vgheo

Hi Vlad - drowning right now, TBH (just came back from a 10h day at work).

More importantly, there's a major refactoring being done by George which may impact this - he is attempting to merge the AST processing so that the same "magic" behind SPARK/Ada will be used for the emission of the C code as well. This will make the code emitted by the C backend pass silently through all major static analyzers - which is of key importance in our target niche (safety-critical embedded targets).

He is aware of your pull request - so your feedback here will be taken into account in the new refactoring (it may even end up being used in large parts as-is).

I will keep you posted here when there's a change - for now, since I understand you have some urgency, I recommend you fork the repo on your account and work from there (until we merge the new functionality in).

Thanks again for your feedback - it is well appreciated!

Kind regards, Thanassis.

ttsiodras avatar Dec 12 '16 20:12 ttsiodras