Skip to content

Commit b40a526

Browse files
committed
ci: Add 32-bit REPR_B build.
This showed up some interesting errors (hopefully all fixed now). Signed-off-by: Jeff Epler <jepler@gmail.com>
1 parent 7a3c246 commit b40a526

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/ports_unix.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,20 @@ jobs:
102102
if: failure()
103103
run: tests/run-tests.py --print-failures
104104

105+
coverage_repr_b:
106+
runs-on: ubuntu-22.04 # use 22.04 to get libffi-dev:i386
107+
steps:
108+
- uses: actions/checkout@v4
109+
- name: Install packages
110+
run: source tools/ci.sh && ci_unix_32bit_setup
111+
- name: Build
112+
run: source tools/ci.sh && ci_unix_coverage_repr_b_build
113+
- name: Run main test suite
114+
run: source tools/ci.sh && ci_unix_coverage_repr_b_run_tests
115+
- name: Print failures
116+
if: failure()
117+
run: tests/run-tests.py --print-failures
118+
105119
coverage_32bit:
106120
runs-on: ubuntu-22.04 # use 22.04 to get libffi-dev:i386
107121
steps:

tools/ci.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,14 @@ CI_UNIX_OPTS_SANITIZE_UNDEFINED=(
556556
LDFLAGS_EXTRA="-fsanitize=undefined -fno-sanitize=nonnull-attribute"
557557
)
558558

559+
CI_UNIX_OPTS_REPR_B=(
560+
VARIANT=standard
561+
CFLAGS_EXTRA="-DMICROPY_OBJ_REPR=MICROPY_OBJ_REPR_B -DMICROPY_PY_UCTYPES=0 -Dmp_int_t=int32_t -Dmp_uint_t=uint32_t"
562+
MICROPY_FORCE_32BIT=1
563+
RUN_TESTS_MPY_CROSS_FLAGS="--mpy-cross-flags=\"-march=x86 -msmall-int-bits=30\""
564+
565+
)
566+
559567
function ci_unix_build_helper {
560568
make ${MAKEOPTS} -C mpy-cross
561569
make ${MAKEOPTS} -C ports/unix "$@" submodules
@@ -898,6 +906,17 @@ function ci_unix_qemu_riscv64_run_tests {
898906
(cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython MICROPY_TEST_TIMEOUT=180 ./run-tests.py --exclude 'thread/stress_recurse.py|thread/thread_gc1.py')
899907
}
900908

909+
function ci_unix_repr_b_build {
910+
ci_unix_build_helper "${CI_UNIX_OPTS_REPR_B[@]}"
911+
ci_unix_build_ffi_lib_helper gcc -m32
912+
}
913+
914+
function ci_unix_repr_b_run_tests {
915+
# ci_unix_run_tests_full_no_native_helper is not used due to
916+
# https://github.com/micropython/micropython/issues/18105
917+
ci_unix_run_tests_helper "${CI_UNIX_OPTS_REPR_B[@]}"
918+
}
919+
901920
########################################################################################
902921
# ports/windows
903922

@@ -984,6 +1003,8 @@ function ci_alif_ae3_build {
9841003
make ${MAKEOPTS} -C ports/alif BOARD=ALIF_ENSEMBLE MCU_CORE=M55_DUAL
9851004
}
9861005

1006+
_ci_functions=
1007+
9871008
function _ci_help {
9881009
# Note: these lines must be indented with tab characters (required by bash <<-EOF)
9891010
cat <<-EOF
@@ -1005,11 +1026,18 @@ function _ci_help {
10051026
exit
10061027
}
10071028

1029+
function _ci_shell_integration {
1030+
echo "alias ci=$0; complete -W '$(grep '^function ci_' $0 | awk '{print $2}' | sed 's/^ci_//')' ci"
1031+
}
1032+
10081033
function _ci_main {
10091034
case "$1" in
10101035
(-h|-?|--help)
10111036
_ci_help
10121037
;;
1038+
(--jeff)
1039+
_ci_shell_integration
1040+
;;
10131041
(*)
10141042
cd $(dirname "$0")/..
10151043
while [ $# -ne 0 ]; do

0 commit comments

Comments
 (0)