← index #15662Issue #8356
Related · high · value 0.831
QUERY · ISSUE

Frozen modules in the embed port does not generate frozen_content.c

openby tailoredsoftopened 2024-08-14updated 2024-08-14
bug

Port, board and/or hardware

embed

MicroPython version

1.23.0

Reproduction

make -f micropython_embed.mk

This file is part of the MicroPython project, http://micropython.org/

The MIT License (MIT)

Copyright (c) 2022-2023 Damien P. George

Set the location of the top of the MicroPython repository.

MICROPYTHON_TOP = ../upstream

add the custom modules to the build

SRC_QSTR += modules/.c
SRC_QSTR += modules/
/.c
//SRC_QSTR += modules_poc/
.c
//SRC_QSTR += modules_poc//.c

#add the uwb applicatioon folder as an include
CFLAGS += -I../../devkit-uwb-ses/uwbiot-top/apps/app_sunway_devkit

FROZEN_MANIFEST = manifest.py

Include the main makefile fragment to build the MicroPython component.

include $(MICROPYTHON_TOP)/ports/embed/embed.mk

Expected behaviour

frozen_content.c should be generated in the BUILD folder

Observed behaviour

When building on a Windows PC the manifest.py does not get invoked. I know this because added a syntax error and there is no complaint so it never got invoked.

Additional Information

I managed to find that bug which is down to requiring a make variable defining mpy-cross instead of mpy-cross.exe.
I can generate the frozen_content.c and it builds into my firmware but it always gets to fail the import

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

mpy-cross: Build process broken.

closedby robert-hhopened 2022-02-25updated 2022-02-28
tools

Since the update of mpy-cross with v1.18-155 I get compile errors in the generated frozen-content.c file. See the dump below. The file contains indeed syntax errors. The build target does not matter. mpy-cross is fresh built.
The file that cannot be frozen is pye.py https://github.com/robert-hh/Micropython-Editor/blob/master/pye.py
It contains some escape sequences. A short excerpt from this file which provokes an error:

oops = "\n\x1b["
build-TEENSY40/frozen_content.c:4341:1: error: stray '\33' in program
 4341 | [
      | ^
build-TEENSY40/frozen_content.c:4342:9: error: expected ']' before ',' token
 4342 |     0x16,0x03, // STORE_NAME oops
      |         ^
      |         ]
build-TEENSY40/frozen_content.c:4345:1: error: expected expression before '}' token
 4345 | };
      | ^
build-TEENSY40/frozen_content.c:4394:12: error: 'raw_code_tipp_over__lt_module_gt_' undeclared here (not in a function); did you mean 'fun_data_tipp_over__lt_module_gt_'?
 4394 |     .rc = &raw_code_tipp_over__lt_module_gt_,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |            fun_data_tipp_over__lt_module_gt_
build-TEENSY40/frozen_content.c:4336:19: error: 'fun_data_tipp_over__lt_module_gt_' defined but not used [-Werror=unused-const-variable=]
 4336 | static const byte fun_data_tipp_over__lt_module_gt_[9] = {
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../py/mkrules.mk:77: build-TEENSY40/build-TEENSY40/frozen_content.o] Fehler 1

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied