Page 1 of 1

Error while I try to make UNix port

Posted: Fri Jul 17, 2020 12:54 pm
by zaord
Hi here ;)

I have an error while I try to build micropython unix port :

Code: Select all

CC ../../extmod/modussl_axtls.c
In file included from ../../lib/axtls/ssl/tls1.h:46,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/ssl/os_port.h:1:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
    1 | os_port_micropython.h
      |                    ^
In file included from ../../lib/axtls/crypto/crypto.h:42,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint_impl.h:89:5: error: unknown type name ‘comp’
   89 |     comp* comps;                /**< A ptr to the actual component data */
      |     ^~~~
In file included from ../../lib/axtls/crypto/crypto.h:43,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint.h:46:32: error: unknown type name ‘comp’
   46 | bigint *int_to_bi(BI_CTX *ctx, comp i);
      |                                ^~~~
make: *** [../../py/mkrules.mk:47: build-standard/extmod/modussl_axtls.o] Error 1
Did anyone solved this already ?

Best

Re: Error while I try to make UNix port

Posted: Fri Jul 17, 2020 3:33 pm
by rcolistete
Have you done these steps ?

Code: Select all

[compiling_firmware]$ git clone --recurse-submodules https://github.com/rcolistete/micropython
[compiling_firmware]$ cd micropython
[micropython]$ git submodule update --init
[micropython]$ cd ports/unix
[unix]$ make clean
[unix]$ make -j8 submodules
[unix]$ make -j8

Re: Error while I try to make UNix port

Posted: Sat Jul 18, 2020 8:45 pm
by zaord
Okay i reclean all and now its fixed :) tack !

Re: Error while I try to make UNix port

Posted: Thu Dec 17, 2020 9:39 pm
by garya@arcimoto.com
HI,
I'm having the same issue and the solution posted did not solve it.
Any other ideas are truly welcome and greatly appreciated.
Thank you in advance for your assistance.

Re: Error while I try to make UNix port

Posted: Fri Dec 18, 2020 12:52 am
by garya@arcimoto.com
Hi,
I have this same issue and I followed the recipe that was presented and I still get the following:

Code: Select all

CC ../../extmod/modussl_axtls.c
In file included from ../../lib/axtls/ssl/tls1.h:46,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/ssl/os_port.h:1:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
    1 | os_port_micropython.h
      |                    ^
In file included from ../../lib/axtls/crypto/crypto.h:42,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint_impl.h:89:5: error: unknown type name ‘comp’
   89 |     comp* comps;                /**< A ptr to the actual component data */
      |     ^~~~
In file included from ../../lib/axtls/crypto/crypto.h:43,
                 from ../../lib/axtls/ssl/tls1.h:47,
                 from ../../lib/axtls/ssl/ssl.h:75,
                 from ../../extmod/modussl_axtls.c:35:
../../lib/axtls/crypto/bigint.h:46:32: error: unknown type name ‘comp’
   46 | bigint *int_to_bi(BI_CTX *ctx, comp i);
      |                                ^~~~
make: *** [../../py/mkrules.mk:47: build/extmod/modussl_axtls.o] Error 1
I doing this under Cygwin with
$ gcc --version
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

What am I doing wrong?
Any help would be greatly appreciated!
Thanks in advance for all your help.

Re: Error while I try to make UNix port

Posted: Fri Dec 18, 2020 8:01 am
by stijn
os_port.h should be a symlink, instead it seems to be a plain text file with the name of the files it links to.
This has been discussed on github, IIRC the solution is to configure git to use symlinks. See e.g. https://github.com/micropython/micropython/issues/6519: should be sufficient to have a recent git version, set core.symlinks to true (git config --global core.symlinks true) and then clone again.

Have you done these steps?
Note that for a fresh clone these are sufficient for the unix build:

Code: Select all

git clone git@github.com:micropython/micropython.git
cd micropython/ports/unix
make submodules  # This already calls git submodule update --init --recursive
make