The `thread/thread_gc1.py` test is a constant source of spurious failures
in Github CI.
This commit adds it to the list of tests skipped when running on Github CI
using either macos, qemu_riscv64, qemu_mips, or qemu_arm, to help reduce
the overall false positive rate and improve the predictive value of the
test fail indication.
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
This commit lets CI extend the testing scope of the QEMU Arm target, by
letting it perform the usual battery of tests (interpreter and natmods)
also on hardfp targets.
The default board for Arm testing lacks hardware floating point support,
so natmods weren't tested in that specific configuration. With the
introduction of the "MPS_AN500" QEMU target, now this is made possible
as said board emulates a Cortex-M7 machine with a single- and
double-precision floating point unit.
To reduce the impact on build times, the "ci_qemu_build_arm_thumb" CI
step was split in two: "ci_qemu_build_arm_thumb_softfp" and
"ci_qemu_build_arm_thumb_hardfp" - so hopefully those can run in
parallel whenever possible.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Clang and gcc>=14 can use __has_feature() to detect if a sanitizer
is enabled, but older GCC has no mechanism - need to set a macro
explicitly for this to be recognised.
Necessary for increasing some resource limits in sanitizer builds.
Important not to use to avoid real issues!
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Also rewrite the sanitizer argument variables to not assume a variant.
longlong variant currently fails in this config, due to a bug fixed
in follow-up commit.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Updates the Zephyr port build instructions and CI to use the latest
Zephyr release tag.
Tested on max32690fthr and frdm_k64f.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
This is a patch release of the IDF. Comparing with 5.4.1, firmware size is
up by about 1.5k on ESP32 and 9k on ESP32-S3. But IRAM usage (of the IDF)
is down by about 500 byte on ESP32 and DRAM usage is down by about 20k on
ESP32 and 10k on ESP32-S3.
Testing on ESP32, ESP32-S2, ESP32-S3 and ESP32-C3 shows no regressions,
except in BLE MTU ordering (the MTU exchange event occuring before the
connect event).
Signed-off-by: Damien George <damien@micropython.org>
The `run-perfbench.py` test is run as part of CI, but the actual
performance results are not used. Rather, the test is just testing that
all the performance tests run correctly.
So there's no need to run with the default averaging of 8 (which runs each
test 8 times and takes the average time for the performance result) which
can take a lot of time for slower builds, eg unix sanitize, settrace and
stackless builds.
This commit changes the averaging to just 1.
Signed-off-by: Damien George <damien@micropython.org>
This test passes sometimes and fails other times. Eventually that should
be fixed, but for now just skip this test.
Signed-off-by: Damien George <damien@micropython.org>
This test passes sometimes and fails other times. Eventually that should
be fixed, but for now just skip this test.
Signed-off-by: Damien George <damien@micropython.org>
Stackless mode makes `tests/thread/stress_aes.py` slow, around 75 seconds
for this CI job (probably due to contention among the many threads for the
GC lock, to allocate frames for function calls). So increase the timeout
to allow this test to pass.
Signed-off-by: Damien George <damien@micropython.org>
The qemu emulation introduces enough overhead that the
`tests/thread/stress_aes.py` test overruns the default timeout. So
increase it to allow this test to pass.
Signed-off-by: Damien George <damien@micropython.org>
This commit fixes building the "btree" example natmod on RV32 when
Picolibc is being used and uses thread-local storage for storing the
errno variable.
The fix is surprisingly simple: Picolibc allows overriding the function
that will provide a pointer to the "errno" variable, and the btree
natmod integration code already has all of this machinery set up as part
of its library integration. Redirecting Picolibc to the already
existing pointer provider function via a compile-time definition is
enough to let the module compile and pass QEMU tests.
This workaround will work on any Picolibc versions (Arm, RV32, Xtensa,
etc.) even if TLS support was not enabled to begin with, and will
effectively do nothing if the toolchain used will rely on Newlib to
provide standard C library functions.
Given that the btree module now builds and passes the relevant natmod
tests, said module is now part of the QEMU port's natmod testing
procedure, and CI now will build the btree module for RV32 as part to
its checks.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
There have been recent build failures in build_renesas_ra_board. It
appears to be the case that a security update for this package was recently
issued by Ubuntu for CVE-2025-4565 and the buggy version is no longer on
package servers. However, it is still referred to by the cached apt
metadata in the GitHub runners.
Add `apt-get update` to fix this, and audit for other sites in `ci.sh`
where it might also be necessary.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This removes the need for an explicit `sys_settrace_features.py.exp` file.
This means that people testing locally will also need to install Python
3.11 in some way, such as with pyenv or uv, and use it during
`make VARIANT=coverage test`, or they will get failures.
When using Python from GitHub actions/setup-python, pip3 can't be wrapped
by sudo, because this invokes the operating system python instead.
Signed-off-by: Jeff Epler <jepler@gmail.com>
The additional overhead of the settrace profiler means that the
`aes_stress.py` test was running too slowly on GitHub CI. Double the
timeout to 60 seconds.
Signed-off-by: Jeff Epler <jepler@gmail.com>
This check, runtime-enabled by default in gcc 13 (and existing at least
since gcc 12, but runtime-disabled) changes the stack layout in ways that
are not compatible with assumptions spread across the core code (nlr, gc,
and stack checking).
Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit fixes CI test runs for the `nanbox` target, which were
broken by the unconditional native emitter code output changes in the
test runner.
The `nanbox` configuration does not enable native emitters of any kind,
and with a full test run that includes executing emitted native code
things would break when doing CI runs.
This is worked around by introducing a common subset of tests that do
not involve the native emitter, and a more comprehensive set of tests
that include both non-emitter and emitter tests. The `nanbox` CI test
run will stop at the first subset, whilst other configurations will run
that and execute further tests.
Function names have been kept the same for steps that involve native
code, with the `nanbox` subset having another one. This should not
trigger any breakage in existing CI configurations or external scripts.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit takes the QEMU/Arm CI build and test step and splits it into
three separate steps (bigendian, sabrelite, thumb), to allow them to run
in parallel.
Currently the QEMU/Arm CI build step would take up to 16 minutes, often
being the last step blocking a full test run. With this commit, when
the steps run in parallel the time it takes to complete the QEMU/Arm
build and test procedure is cut in half - taking between 8 to 9 minutes
depending on the CI runner load.
The existing `ci_build_and_test_arm` function has been removed, in
favour of having three separate functions - one per configuration. They
are called `ci_build_and_test_arm_bigendian`,
`ci_build_and_test_arm_sabrelite`, and `ci_build_and_test_arm_thumb`.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit fixes a small yet harmless issue that occurs when invoking
`ci_native_mpy_modules_build` on a persistent environment, as only X64
MPY files would be removed by the cleaning process.
Now the correct architecture is passed at all times when cleaning before
building a natmod for a particular architecture, forcing a full build of
all files to better simulate the CI environment (where there's no state
persisted between runs for this step).
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit lets the CI pipeline build all natmods for the Xtensa
target, now that ROM symbols can be used in the linking process.
The restriction was put in place due to build failures on certain
natmods for Xtensa, as ROM symbols would not be used, causing undefined
symbol errors at build time.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This version of the IDF uses about 1KB more IRAM and 1KB more DRAM on most
boards, but 6.5KB more DRAM usage on the S3. It seems that's due to a lot
of small increases in many components.
Signed-off-by: Ihor Nehrutsa <Ihor.Nehrutsa@gmail.com>
Updates the Zephyr port build instructions. The CI is updated to use
Zephyr docker image 0.27.4, SDK 0.17.0 and the latest Zephyr release
tag.
Tested on max32690fthr and frdm_k64f.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>
Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
If picotool is not installed, it's fetched and built when compiling each
rp2 board. And the "develop" branch of picotool is used instead of a
release. Installing it manually using the "master" branch means the latest
released version is used (instead of a possibly unstable development
version), and also makes building each rp2 board a little faster.
Signed-off-by: Damien George <damien@micropython.org>
This commit removes the assumption made by the CI scripts that the
system-provided python executable is simply named "python". The scripts
will now look for a binary called "python3" first, and then fall back to
"python" if that is not found.
Whilst this is currently the case for the CI environment, there are no
guarantees for this going forward. For example minimal CI environments
set up by some developers, using the same base OS, have their python
executable called "python3".
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit expands the CI tests by checking whether the example native
modules are able to be built for the Xtensa architecture.
This was made possible by the changes to mpy_ld that allow symbol
resolution across standard compiler-provided libraries.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit introduces an additional symbol resolution mechanism to the
natmod linking process. This allows the build scripts to look for required
symbols into selected libraries that are provided by the compiler
installation (libgcc and libm at the moment).
For example, using soft-float code in natmods, whilst technically possible,
was not an easy process and required some additional work to pull it off.
With this addition all the manual (and error-prone) operations have been
automated and folded into `tools/mpy_ld.py`.
Both newlib and picolibc toolchains are supported, albeit the latter may
require a bit of extra configuration depending on the environment the build
process runs on. Picolibc's soft-float functions aren't in libm - in fact
the shipped libm is nothing but a stub - but they are inside libc. This is
usually not a problem as these changes cater for that configuration quirk,
but on certain compilers the include paths used to find libraries in may
not be updated to take Picolibc's library directory into account. The bare
metal RISC-V compiler shipped with the CI OS image (GCC 10.2.0 on Ubuntu
22.04LTS) happens to exhibit this very problem.
To work around that for CI builds, the Picolibc libraries' path is
hardcoded in the Makefile directives used by the linker, but this can be
changed by setting the PICOLIBC_ROOT environment library when building
natmods.
Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
Co-authored-by: Alessandro Gatti <a.gatti@frob.it>
This allows running mpy-tool using MicroPython itself.
An appropriate test is added to CI to make sure it continues to work.
Signed-off-by: Volodymyr Shymanskyy <vshymanskyi@gmail.com>
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Changing runner OS can change Python version, and ESP-IDF installs are
keyed on ESP-IDF and Python version together.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit adds the natmod tests for the MPS2_AN385 board running
inside QEMU to the CI pipeline. Now natmod tests capabilities are equal
between the Arm and RV32 platforms for the QEMU port.
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
This commit brings the natmod tests in the CI build process for the RV32
platform. Not all example natmods are tested at the moment, as
`features` requires soft-float support, and `btree` needs thread-local
storage support in `mpy_ld.py` when built with the CI's toolchain.
Co-authored-by: Damien George <damien@micropython.org>
Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Similar to the ESP32 builds, but needs additional step to pass the
ccache directory through to the Zephyr container.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
This image is 15GB so in theory this may be faster, although
in testing the improvement is either non-existent or marginal.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Can save several minutes downloading the Zephyr docker image and/or cloning
repo from GitHub. Cache keyed on the Zephyr version, which AFAIK is the
only determinant for the workspace contents.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Reasons to remove this:
- GitHub's macOS runners install this package by default nowadays.
- Brew renamed this package to 'pkgconf' so installing the old name on top
of the new package name has started failing.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
Previously to this commit, running the test suite on a bare-metal board
required specifying the target (really platform) and device, eg:
$ ./run-tests.py --target pyboard --device /dev/ttyACM1
That's quite a lot to type, and you also need to know what the target
platform is, when a lot of the time you either don't care or it doesn't
matter.
This commit makes it easier to run the tests by replacing both of these
options with a single `--test-instance` (`-t` for short) option. That
option specifies the executable/port/device to test. Then the target
platform is automatically detected.
The `--test-instance` can be passed:
- "unix" (the default) to use the unix version of MicroPython
- "webassembly" to test the webassembly port
- anything else is considered a port/device to pass to Pyboard
There are also some shortcuts to specify a port/device, following
`mpremote`:
- a<n> is short for /dev/ttyACM<n>
- u<n> is short for /dev/ttyUSB<n>
- c<n> is short for COM<n>
For example:
$ ./run-tests.py -t a1
Note that the default test instance is "unix" and so this commit does not
change the standard way to run tests on the unix port, by just doing
`./run-tests.py`.
As part of this change, the platform (and it's native architecture if it
supports importing native .mpy files) is show at the start of the test run.
Signed-off-by: Damien George <damien@micropython.org>