Skip to content

Try to rehabilitate circuitpython appveyor build #1

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

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions py/argcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
void mp_arg_check_num(size_t n_args, size_t n_kw, size_t n_args_min, size_t n_args_max, bool takes_kw) {
// NOTE(tannewt): This prevents this function from being optimized away.
// Without it, functions can crash when reading invalid args.
#ifdef __GNUC__
__asm volatile ("");
#endif
// TODO maybe take the function name as an argument so we can print nicer error messages

if (n_kw && !takes_kw) {
Expand Down
1 change: 1 addition & 0 deletions py/nlr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ struct _nlr_buf_t {
#elif defined(__xtensa__)
void *regs[10];
#else
#undef MICROPY_NLR_SETJMP
#define MICROPY_NLR_SETJMP (1)
//#warning "No native NLR support for this arch, using setjmp implementation"
#endif
Expand Down
4 changes: 4 additions & 0 deletions py/persistentcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ STATIC size_t read_uint(mp_reader_t *reader) {

STATIC qstr load_qstr(mp_reader_t *reader) {
size_t len = read_uint(reader);
#ifdef __GNUC__
char str[len];
#else
char *str = alloca(len);
#endif
read_bytes(reader, (byte*)str, len);
qstr qst = qstr_from_strn(str, len);
return qst;
Expand Down
4 changes: 4 additions & 0 deletions py/stackctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

void mp_stack_ctrl_init(void) {
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
#ifdef __GNUC__
__asm volatile ("");
#endif
volatile int stack_dummy;
MP_STATE_THREAD(stack_top) = (char*)&stack_dummy;
}
Expand All @@ -41,7 +43,9 @@ void mp_stack_set_top(void *top) {
mp_uint_t mp_stack_usage(void) {
// Assumes descending stack
// Force routine to not be inlined. Better guarantee than MP_NOINLINE for -flto.
#ifdef __GNUC__
__asm volatile ("");
#endif
volatile int stack_dummy;
return MP_STATE_THREAD(stack_top) - (char*)&stack_dummy;
}
Expand Down
5 changes: 4 additions & 1 deletion tests/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ def run_tests(pyb, tests, args, base_path="."):
# run CPython to work out expected output
e = {"PYTHONPATH": os.getcwd(),
"PATH": os.environ["PATH"],
"LANG": "en_US.UTF-8"}
"LANG": "en_US.UTF-8",
"PYTHONIOENCODING": "utf-8"}
if 'SYSTEMROOT' in os.environ:
e['SYSTEMROOT'] = os.environ['SYSTEMROOT']
p = subprocess.Popen([CPYTHON3, '-B', test_file], env=e, stdout=subprocess.PIPE)
output_expected = b''
while p.poll() is None:
Expand Down