-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Msvc build fix #1034
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
Msvc build fix #1034
Conversation
- Use a single file env.props for defining the main directories used when building. env.props resolves the base directory and defines overridable output directories, and is used by all other build files. - Fix the build currently failing, basically because the preprocessing command for generating qstrdefs uses different include directories than the build itself does. (specifically, qstrdefs.h uses #include "py/mpconfig.h" since the fixes for micropython#1022 in 51dfcb4, so we need to use the base directory as include directory, not the py dir itself). So define a single variable containing the include directories instead and use it where needed.
The compiler treats `if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE)` as a normal statement and generates assembly for it in degug mode as if MICROPY_ERROR_REPORTING is an actual symbol instead of a preprocessor definition. As such linking fails because mp_arg_error_terse_mismatch is not defined when MICROPY_ERROR_REPORTING_TERSE is detailed or normal.
Remove some duplication in the code for generating qstrdefs.generated.h and py-version.h
@@ -139,7 +139,7 @@ void mp_arg_parse_all_kw_array(mp_uint_t n_pos, mp_uint_t n_kw, const mp_obj_t * | |||
mp_arg_parse_all(n_pos, args, &kw_args, n_allowed, allowed, out_vals); | |||
} | |||
|
|||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE | |||
#if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE || _MSC_VER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange that it needs this... even with no optimisation and debugging enabled, unix version doesn't complain about mp_arg_error_terse_mismatch not existing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has to be a gcc optimization. In debug mode cl compiles if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE)
into xor eax,eax
followed by a jump which is always skipped of course. In release mode it gets rid of everything, yet still wants the function definition to be available. Might be a bug or 'feature'
This creates a common safe mode mechanic that ports can share. As a result, the nRF52 now has safe mode support as well. The common safe mode adds a 700ms delay at startup where a reset during that window will cause a reset into safe mode. This window is designated by a yellow status pixel and flashing the single led three times. A couple NeoPixel fixes are included for the nRF52 as well. Fixes micropython#1034. Fixes micropython#990. Fixes micropython#615.
Fix msvc build, some cleanup in the msbuild files
#include "py/mpconfig.h"
instead of just ```mpconfig.h`