riebl/vanetza

Applying patch regional_extension_unions.patch fails

ozeraltun opened this issue · 5 comments

Hello all,
After the update on 18 December 2022(2 days ago), I cannot generate customized asn files.

For example;
Lets say I added a new parameter to DENM.
After adding the desired parameter to the file /asn1/EN302637-3v131-DENM.asn, executing the following commands was creating the desired .c .h:

mkdir build
cd build
cmake .. -DVANETZA_ASN1_WITH_ASN1C=ON
sudo make generate_asn1c

Now I am getting the following error message after "sudo make generate_asn1c" command:

-- Applying patch pki-64bit-types
-- Applying patch regional_extension_unions
error: vanetza/asn1/its/RegionalExtension.h: No such file or directory
CMake Error at vanetza/asn1/apply_patches.cmake:8 (message):
  Applying patch
  /vanetza/asn1/patches/regional_extension_unions.patch
  failed!
-- Applying patch security-64bit-types
make[3]: *** [vanetza/asn1/CMakeFiles/generate_asn1c.dir/build.make:143: generate_asn1c] Error 1
make[2]: *** [CMakeFiles/Makefile2:333: vanetza/asn1/CMakeFiles/generate_asn1c.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:340: vanetza/asn1/CMakeFiles/generate_asn1c.dir/rule] Error 2
make: *** [Makefile:182: generate_asn1c] Error 2
riebl commented

Hi @ozeraltun,

that is quite strange as it worked flawlessly on my machine and RegionalExtension should always be generated by generate_asn1c. Which version of asn1c are you using?
By the way, I see no reason why you need privilege escalation (sudo) for the generate_asn1c target. Is anything special in your environment that requires root access at this step?

my asn1c version:

vanetza/build$ asn1c -version
ASN.1 Compiler, v0.9.29
Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info> and contributors.

I used sudo command once to generate_asn1c. Which was a mistake since it affects read/write privileges.
Therefore, if 'sudo' used once, it required me to use it every time after that.
So there is nothing special about it.

Without root privileges it still generates same error:

Applying hot-fixes to generated asn1c files
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Applying patch pki-64bit-types
-- Applying patch regional_extension_unions
error: vanetza/asn1/its/RegionalExtension.h: No such file or directory
CMake Error at vanetza/asn1/apply_patches.cmake:8 (message):
  Applying patch
  /vanetza/asn1/patches/regional_extension_unions.patch
  failed!


-- Applying patch security-64bit-types
make[3]: *** [vanetza/asn1/CMakeFiles/generate_asn1c.dir/build.make:143: generate_asn1c] Error 1
make[2]: *** [CMakeFiles/Makefile2:315: vanetza/asn1/CMakeFiles/generate_asn1c.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:322: vanetza/asn1/CMakeFiles/generate_asn1c.dir/rule] Error 2
make: *** [Makefile:182: generate_asn1c] Error 2
riebl commented

Does the asn1c code generation work if you do not modify anything?

Yes, asn1c code generation works if I do not modify anything.

riebl commented

Can you share the exact changes which break the code generation? Maybe the modified ASN.1 is not valid anymore and hence (parts) of the code are not generated at all.