The package rpms/micropython.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/micropython.git/commit/?id=007ea5....
Change:
+ExclusiveArch: %{arm} %{ix86} x86_64
Thanks.
Full change:
============
commit 007ea5d59566b880e44fb217de7d25cafe8315b2
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Sun Jan 13 13:43:35 2019 +0100
Enable i686, fix a FTBFS (#1556924)
diff --git a/c97607db5ccc03afbccacf853f2cd06305c28251.patch
b/c97607db5ccc03afbccacf853f2cd06305c28251.patch
new file mode 100644
index 0000000..ae6dd9c
--- /dev/null
+++ b/c97607db5ccc03afbccacf853f2cd06305c28251.patch
@@ -0,0 +1,63 @@
+From c97607db5ccc03afbccacf853f2cd06305c28251 Mon Sep 17 00:00:00 2001
+From: Damien George <damien.p.george(a)gmail.com>
+Date: Tue, 15 May 2018 11:17:28 +1000
+Subject: [PATCH] py/nlrx86: Use naked attribute on nlr_push for gcc 8.0 and
+ higher.
+
+gcc 8.0 supports the naked attribute for x86 systems so it can now be used
+here. And in fact it is necessary to use this for nlr_push because gcc 8.0
+no longer generates a prelude for this function (even without the naked
+attribute).
+---
+ py/nlrx86.c | 26 +++++++++++++++++++++-----
+ 1 file changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/py/nlrx86.c b/py/nlrx86.c
+index 23882cc307..59b97d8ee6 100644
+--- a/py/nlrx86.c
++++ b/py/nlrx86.c
+@@ -39,15 +39,29 @@ unsigned int nlr_push_tail(nlr_buf_t *nlr)
asm("nlr_push_tail");
+ __attribute__((used)) unsigned int nlr_push_tail(nlr_buf_t *nlr);
+ #endif
+
++#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
++// Since gcc 8.0 the naked attribute is supported
++#define USE_NAKED (1)
++#define UNDO_PRELUDE (0)
++#elif defined(__ZEPHYR__) || defined(__ANDROID__)
++// Zephyr and Android use a different calling convention by default
++#define USE_NAKED (0)
++#define UNDO_PRELUDE (0)
++#else
++#define USE_NAKED (0)
++#define UNDO_PRELUDE (1)
++#endif
++
++#if USE_NAKED
++__attribute__((naked))
++#endif
+ unsigned int nlr_push(nlr_buf_t *nlr) {
++ #if !USE_NAKED
+ (void)nlr;
++ #endif
+
+ __asm volatile (
+- // Check for Zephyr, which uses a different calling convention
+- // by default.
+- // TODE: Better support for various x86 calling conventions
+- // (unfortunately, __attribute__((naked)) is not supported on x86).
+- #if !(defined(__ZEPHYR__) || defined(__ANDROID__))
++ #if UNDO_PRELUDE
+ "pop %ebp \n" // undo function's prelude
+ #endif
+ "mov 4(%esp), %edx \n" // load nlr_buf
+@@ -61,7 +75,9 @@ unsigned int nlr_push(nlr_buf_t *nlr) {
+ "jmp nlr_push_tail \n" // do the rest in C
+ );
+
++ #if !USE_NAKED
+ return 0; // needed to silence compiler warning
++ #endif
+ }
+
+ NORETURN void nlr_jump(void *val) {
diff --git a/micropython.spec b/micropython.spec
index d9fa797..dfc46b5 100644
--- a/micropython.spec
+++ b/micropython.spec
@@ -4,7 +4,7 @@
Name: micropython
Version: 1.9.4
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Implementation of Python 3 with very low memory footprint
# micorpython itself is MIT
@@ -21,7 +21,7 @@ Source1:
https://github.com/pfalcon/axtls/archive/%{axtls_commit}/axtls-%{
Source2:
https://github.com/pfalcon/berkeley-db-1.xx/archive/%{berkley_commit}/ber...
# Other arches need active porting
-ExclusiveArch: %{arm} x86_64
+ExclusiveArch: %{arm} %{ix86} x86_64
BuildRequires: gcc
BuildRequires: python3-devel
@@ -46,6 +46,8 @@ Patch0: python37_tests.patch
%global cpython_version_tests 3.7
BuildRequires: %{_bindir}/python%{cpython_version_tests}
+#
https://github.com/micropython/micropython/issues/3637
+Patch1:
https://github.com/micropython/micropython/commit/c97607db5ccc03afbccacf8...
Provides: bundled(axtls)
Provides: bundled(libdb) = 1.85
@@ -100,6 +102,9 @@ install -pm 755 ports/unix/micropython %{buildroot}%{_bindir}
%{_bindir}/micropython
%changelog
+* Sun Jan 13 2019 Miro Hronok <mhroncok(a)redhat.com> - 1.9.4-2
+- Enable i686, fix a FTBFS (#1556924)
+
* Wed Aug 01 2018 Miro Hronok <mhroncok(a)redhat.com> - 1.9.4-1
- Update to 1.9.4 (#1577187)
- Use CPython 3.6 in tests that compare results due to PEP479 (#1604827)
commit e318ff577ef0f5b4fe87ae04c6cd658cb6125ffa
Author: Miro Hronok <miro(a)hroncok.cz>
Date: Fri Aug 17 11:39:01 2018 +0200
Add upstream fix for running tests with CPython 3.7
diff --git a/micropython.spec b/micropython.spec
index fac62f5..d9fa797 100644
--- a/micropython.spec
+++ b/micropython.spec
@@ -40,7 +40,10 @@ BuildRequires: openssl-devel
# MICROPY_CPYTHON3 environment variable.
# Normal %%{__pytohn3} is used anywhere else.
# There is no runtime dependency on this CPython (or any other).
-%global cpython_version_tests 3.6
+# This is fixed upstream now, but we keep the macros for future use
+#
https://github.com/micropython/micropython/compare/4f9842ad...828f771
+Patch0: python37_tests.patch
+%global cpython_version_tests 3.7
BuildRequires: %{_bindir}/python%{cpython_version_tests}
@@ -51,7 +54,7 @@ Provides: bundled(libdb) = 1.85
Implementation of Python 3 with very low memory footprint
%prep
-%setup -q -n %{name}-%{version}
+%autosetup -p1 -n %{name}-%{version}
# git submodules
rmdir lib/axtls
diff --git a/python37_tests.patch b/python37_tests.patch
new file mode 100644
index 0000000..1cd1a3b
--- /dev/null
+++ b/python37_tests.patch
@@ -0,0 +1,278 @@
+From 96e1fd480d6bc31b8c2954b20477cac262d1f1e5 Mon Sep 17 00:00:00 2001
+From: Damien George <damien.p.george(a)gmail.com>
+Date: Fri, 17 Aug 2018 15:42:51 +1000
+Subject: [PATCH 1/4] tests/basics/set_pop.py: Sort set before printing for
+ consistent output.
+
+---
+ tests/basics/set_pop.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/basics/set_pop.py b/tests/basics/set_pop.py
+index 5e1196c9f0..e951ca5931 100644
+--- a/tests/basics/set_pop.py
++++ b/tests/basics/set_pop.py
+@@ -15,4 +15,4 @@
+ print(s.pop()) # last pop() should trigger the optimisation
+ for i in range(N):
+ s.add(i) # check that we can add the numbers back to the set
+-print(list(s))
++print(sorted(s))
+
+From 0988b14cd6d5fdbcc3fe3e65c6bdb6af1e906597 Mon Sep 17 00:00:00 2001
+From: Damien George <damien.p.george(a)gmail.com>
+Date: Fri, 17 Aug 2018 15:43:47 +1000
+Subject: [PATCH 2/4] tests/basics/int_big_error.py: Use bytearray to test for
+ int overflow.
+
+In Python 3.7 "1 >> (big int)" is now allowed, it no longer raises an
+OverflowError. So use bytearray to test big-int conversion overflow.
+---
+ tests/basics/int_big_error.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/basics/int_big_error.py b/tests/basics/int_big_error.py
+index e036525d1b..79809aef11 100644
+--- a/tests/basics/int_big_error.py
++++ b/tests/basics/int_big_error.py
+@@ -17,9 +17,9 @@
+ except TypeError:
+ print("TypeError")
+
+-# overflow because rhs of >> is being converted to machine int
++# overflow because arg of bytearray is being converted to machine int
+ try:
+- 1 >> i
++ bytearray(i)
+ except OverflowError:
+ print('OverflowError')
+
+
+From 8979ce167101dec95c4cf994b3652debd6c8da6c Mon Sep 17 00:00:00 2001
+From: Damien George <damien.p.george(a)gmail.com>
+Date: Fri, 17 Aug 2018 15:46:04 +1000
+Subject: [PATCH 3/4] tests: Modify tests that print repr of an exception with
+ 1 arg.
+
+In Python 3.7 the behaviour of repr() of an exception with one argument
+changed: it no longer prints a trailing comma in the argument list. See
+https://bugs.python.org/issue30399
+
+This patch modifies tests that rely on this behaviour to not rely on it.
+And the python34.py test is updated to include a test for this behaviour
+with a .exp file.
+---
+ tests/basics/dict1.py | 2 +-
+ tests/basics/exception1.py | 1 -
+ tests/basics/generator_return.py | 2 +-
+ tests/basics/python34.py | 6 +++++-
+ tests/basics/python34.py.exp | 1 +
+ tests/basics/subclass_native3.py | 4 ++--
+ tests/basics/try_as_var.py | 2 +-
+ tests/misc/sys_exc_info.py | 2 +-
+ 8 files changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/tests/basics/dict1.py b/tests/basics/dict1.py
+index 20fa9def31..0cec51173a 100644
+--- a/tests/basics/dict1.py
++++ b/tests/basics/dict1.py
+@@ -27,7 +27,7 @@
+ try:
+ {}[0]
+ except KeyError as er:
+- print('KeyError', er, repr(er), er.args)
++ print('KeyError', er, er.args)
+
+ # unsupported unary op
+ try:
+diff --git a/tests/basics/exception1.py b/tests/basics/exception1.py
+index 739dd32753..d83764cb93 100644
+--- a/tests/basics/exception1.py
++++ b/tests/basics/exception1.py
+@@ -1,7 +1,6 @@
+ print(repr(IndexError()))
+ print(str(IndexError()))
+
+-print(repr(IndexError("foo")))
+ print(str(IndexError("foo")))
+
+ a = IndexError(1, "test", [100, 200])
+diff --git a/tests/basics/generator_return.py b/tests/basics/generator_return.py
+index a3ac88575e..5814ce8379 100644
+--- a/tests/basics/generator_return.py
++++ b/tests/basics/generator_return.py
+@@ -7,4 +7,4 @@ def gen():
+ try:
+ print(next(g))
+ except StopIteration as e:
+- print(repr(e))
++ print(type(e), e.args)
+diff --git a/tests/basics/python34.py b/tests/basics/python34.py
+index 36531f11cf..4030db143c 100644
+--- a/tests/basics/python34.py
++++ b/tests/basics/python34.py
+@@ -1,4 +1,4 @@
+-# tests that differ when running under Python 3.4 vs 3.5/3.6
++# tests that differ when running under Python 3.4 vs 3.5/3.6/3.7
+
+ try:
+ exec
+@@ -36,3 +36,7 @@ def test_syntax(code):
+ import sys
+ print(sys.version[:3])
+ print(sys.version_info[0], sys.version_info[1])
++
++# from basics/exception1.py
++# in 3.7 no comma is printed if there is only 1 arg (in 3.4-3.6 one is printed)
++print(repr(IndexError("foo")))
+diff --git a/tests/basics/python34.py.exp b/tests/basics/python34.py.exp
+index 590fc364f4..8480171307 100644
+--- a/tests/basics/python34.py.exp
++++ b/tests/basics/python34.py.exp
+@@ -11,3 +11,4 @@ SyntaxError
+ SyntaxError
+ 3.4
+ 3 4
++IndexError('foo',)
+diff --git a/tests/basics/subclass_native3.py b/tests/basics/subclass_native3.py
+index bd99ab0d6a..6745b77bb2 100644
+--- a/tests/basics/subclass_native3.py
++++ b/tests/basics/subclass_native3.py
+@@ -7,12 +7,12 @@ class MyExc(Exception):
+ print(e.args)
+
+ try:
+- raise MyExc("Some error")
++ raise MyExc("Some error", 1)
+ except MyExc as e:
+ print("Caught exception:", repr(e))
+
+ try:
+- raise MyExc("Some error2")
++ raise MyExc("Some error2", 2)
+ except Exception as e:
+ print("Caught exception:", repr(e))
+
+diff --git a/tests/basics/try_as_var.py b/tests/basics/try_as_var.py
+index 0a92f1caee..4f02f9c106 100644
+--- a/tests/basics/try_as_var.py
++++ b/tests/basics/try_as_var.py
+@@ -1,7 +1,7 @@
+ try:
+ raise ValueError(534)
+ except ValueError as e:
+- print(repr(e))
++ print(type(e), e.args)
+
+ # Var bound in except block is automatically deleted
+ try:
+diff --git a/tests/misc/sys_exc_info.py b/tests/misc/sys_exc_info.py
+index 4bb2c61e89..bf9438e462 100644
+--- a/tests/misc/sys_exc_info.py
++++ b/tests/misc/sys_exc_info.py
+@@ -9,7 +9,7 @@ def f():
+ print(sys.exc_info()[0:2])
+
+ try:
+- 1/0
++ raise ValueError('value', 123)
+ except:
+ print(sys.exc_info()[0:2])
+ f()
+
+From 828f771e327b932afc4865dbec53ce567dce45f5 Mon Sep 17 00:00:00 2001
+From: Damien George <damien.p.george(a)gmail.com>
+Date: Fri, 17 Aug 2018 15:50:21 +1000
+Subject: [PATCH 4/4] tests/basics: Provide .exp files for generator tests that
+ fail PEP479.
+
+PEP479 (see
https://www.python.org/dev/peps/pep-0479/) prohibited raising
+StopIteration from within a generator (it is turned into a RuntimeError).
+This behaviour was introduced in Python 3.5 and in 3.7 was made compulsory.
+Until uPy implements PEP479, this patch adds .py.exp files for the relevant
+tests so they can be run under Python 3.7.
+---
+ tests/basics/gen_yield_from.py.exp | 14 ++++++++++++++
+ tests/basics/gen_yield_from_close.py.exp | 20 ++++++++++++++++++++
+ tests/basics/gen_yield_from_throw.py.exp | 6 ++++++
+ tests/basics/generator_close.py.exp | 10 ++++++++++
+ 4 files changed, 50 insertions(+)
+ create mode 100644 tests/basics/gen_yield_from.py.exp
+ create mode 100644 tests/basics/gen_yield_from_close.py.exp
+ create mode 100644 tests/basics/gen_yield_from_throw.py.exp
+ create mode 100644 tests/basics/generator_close.py.exp
+
+diff --git a/tests/basics/gen_yield_from.py.exp b/tests/basics/gen_yield_from.py.exp
+new file mode 100644
+index 0000000000..507f2b9caf
+--- /dev/null
++++ b/tests/basics/gen_yield_from.py.exp
+@@ -0,0 +1,14 @@
++here1
++3
++here2
++[1, 2]
++here1
++None
++here2
++[1, 2]
++here1
++123
++here2
++[1, 2]
++444
++[0, 1, 2]
+diff --git a/tests/basics/gen_yield_from_close.py.exp
b/tests/basics/gen_yield_from_close.py.exp
+new file mode 100644
+index 0000000000..a44d1353df
+--- /dev/null
++++ b/tests/basics/gen_yield_from_close.py.exp
+@@ -0,0 +1,20 @@
++-1
++1
++StopIteration
++-1
++1
++2
++leaf caught GeneratorExit and swallowed it
++delegating caught GeneratorExit
++StopIteration
++-1
++1
++2
++leaf caught GeneratorExit and raised StopIteration instead
++delegating caught GeneratorExit
++StopIteration
++123
++RuntimeError
++0
++1
++close
+diff --git a/tests/basics/gen_yield_from_throw.py.exp
b/tests/basics/gen_yield_from_throw.py.exp
+new file mode 100644
+index 0000000000..6ce97ad86e
+--- /dev/null
++++ b/tests/basics/gen_yield_from_throw.py.exp
+@@ -0,0 +1,6 @@
++1
++got ValueError from upstream!
++str1
++got TypeError from downstream!
++123
++got StopIteration from downstream!
+diff --git a/tests/basics/generator_close.py.exp b/tests/basics/generator_close.py.exp
+new file mode 100644
+index 0000000000..fcd5839357
+--- /dev/null
++++ b/tests/basics/generator_close.py.exp
+@@ -0,0 +1,10 @@
++None
++StopIteration
++1
++None
++StopIteration
++[1, 2]
++None
++StopIteration
++None
++ValueError