8000 py/mkrules.mk: Add link to build troubleshooting on failure. by jimmo · Pull Request #9302 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

py/mkrules.mk: Add link to build troubleshooting on failure. #9302

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 19, 2022

Conversation

jimmo
Copy link
Member
@jimmo jimmo commented Sep 14, 2022

This is to help with the transition for #8813. It prints out a message with a link to the wiki if the compile fails (see example below that is typical of what happens after #8813 with old type definitions).

I think this will be particularly useful for #8813 but hopefully will help address a whole class of issues that people run into (wrong IDF version, out of date submodules, etc).

I would like to implement this for CMake too, but figured I'd get feedback on the idea first before having to figure out how to do it in CMake.

machine_spi.c:154:6: error: 'mp_obj_type_t' {aka 'const struct _mp_obj_type_t'} has no member named 'locals_dict'
  154 |     .locals_dict = (mp_obj_dict_t *)&mp_machine_spi_locals_dict,
      |      ^~~~~~~~~~~
machine_spi.c:154:20: error: initialization of 'unsigned char' from 'mp_obj_dict_t *' {aka 'struct _mp_obj_dict_t *'} makes integer from pointer without a cast [-Werror=int-conversion]
  154 |     .locals_dict = (mp_obj_dict_t *)&mp_machine_spi_locals_dict,
      |                    ^
machine_spi.c:154:20: note: (near initialization for 'machine_hard_spi_type.slot_index_call')
machine_spi.c:154:20: error: initializer element is not computable at load time
machine_spi.c:154:20: note: (near initialization for 'machine_hard_spi_type.slot_index_call')
cc1: all warnings being treated as errors
See https://github.com/micropython/micropython/wiki/Build-Troubleshooting           <-------------------
make: *** [../../py/mkrules.mk:80: build-PYBV11/machine_spi.o] Error 1

This work was funded through GitHub Sponsors.

@jimmo jimmo force-pushed the build-troubleshooting branch from a384bc4 to 630ef53 Compare September 14, 2022 00:03
@jimmo
Copy link
Member Author
jimmo commented Sep 14, 2022

I realised that this was quite easy to do for the CMake builds if we do it in our wrapper Makefile, so added commits for rp2 and esp32.

py/mkrules.mk Outdated
@@ -53,7 +53,7 @@ $(BUILD)/%.o: %.s

define compile_c
$(ECHO) "CC $<"
$(Q)$(CC) $(CFLAGS) -c -MD -o $@ $<
$(Q)$(CC) $(CFLAGS) -c -MD -o $@ $< || (echo -e "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m" && false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth making the string a (make) variable in this file, so it doesn't need to be repeated?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jimmo jimmo force-pushed the build-troubleshooting branch from b82a368 to 79c825c Compare September 15, 2022 01:13
Also update the submodules help text to match.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
@jimmo jimmo force-pushed the build-troubleshooting branch from 79c825c to ca51d63 Compare September 15, 2022 02:22
@dpgeorge dpgeorge added the py-core Relates to py/ directory in source label Sep 19, 2022
@dpgeorge dpgeorge merged commit ca51d63 into micropython:master Sep 19, 2022
@dpgeorge
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py-core Relates to py/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0