[SOLVED] Need advice with 'execfile'

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
chrizztus
Posts: 16
Joined: Thu Feb 23, 2017 3:59 pm

[SOLVED] Need advice with 'execfile'

Post by chrizztus » Fri Apr 20, 2018 11:09 am

Hi,
on activating execfile option by enabling:

Code: Select all

#define MICROPY_PY_BUILTINS_EXECFILE (1)
I'm getting the following compile error:

Code: Select all

CC micropython/py/modbuiltins.c
In file included from ./micropython/py/objint.h:30:0,
                 from micropython/py/modbuiltins.c:31:
micropython/py/modbuiltins.c:657:19: error: 'MP_QSTR_execfile' undeclared here (not in a function); did you mean 'MP_QSTR_exec'?
     { MP_ROM_QSTR(MP_QSTR_execfile), MP_ROM_PTR(&mp_builtin_execfile_obj) },
                   ^
./micropython/py/obj.h:92:56: note: in definition of macro 'MP_OBJ_NEW_QSTR'
 #define MP_OBJ_NEW_QSTR(qst) ((mp_obj_t)((((mp_uint_t)(qst)) << 2) | 2))
                                                        ^~~
micropython/py/modbuiltins.c:657:7: note: in expansion of macro 'MP_ROM_QSTR'
     { MP_ROM_QSTR(MP_QSTR_execfile), MP_ROM_PTR(&mp_builtin_execfile_obj) },
       ^~~~~~~~~~~
make: *** [micropython/py/mkrules.mk:47: build/py/modbuiltins.o] Error 1
How can I get rid of this error? Do I miss something?
Regards
Christian
Last edited by chrizztus on Wed Sep 12, 2018 8:03 pm, edited 1 time in total.

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: Need advice with 'execfile'

Post by stijn » Fri Apr 20, 2018 12:58 pm

This is a known issue: you need a full rebuild to generate the qstrs again. Some technical discussion here: https://github.com/micropython/micropython/issues/2982

User avatar
chrizztus
Posts: 16
Joined: Thu Feb 23, 2017 3:59 pm

[SOLVED] Need advice with 'execfile'

Post by chrizztus » Fri Apr 20, 2018 1:55 pm

Ok, I found out by myself. Obviously it makes a difference whether the project was cleaned before enabling builtin modules. Otherwise it might lead into compile errors.
Greetings
Christian

jickster
Posts: 629
Joined: Thu Sep 07, 2017 8:57 pm

Re: [SOLVED] Need advice with 'execfile'

Post by jickster » Mon May 07, 2018 6:27 pm

chrizztus wrote:
Fri Apr 20, 2018 1:55 pm
Ok, I found out by myself. Obviously it makes a difference whether the project was cleaned before enabling builtin modules. Otherwise it might lead into compile errors.
Greetings
Christian
I noticed you marked the post I'm replying to as [SOLVED] but in order for it to show up in forum, you have to edit the title of your first post.

Post Reply