dgibson / dtc

Device Tree Compiler
218 stars 130 forks source link

Meson tests fail #84

Closed dgibson closed 1 year ago

dgibson commented 1 year ago

For some baffling reason I get a failing test when I build with meson:

$ meson setup build
The Meson build system
Version: 1.0.0
Source dir: /home/dwg/src/dtc
Build dir: /home/dwg/src/dtc/build
Build type: native build
Project name: dtc
Project version: 1.7.0
C compiler for the host machine: ccache cc (gcc 12.2.1 "cc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)")
C linker for the host machine: cc ld.bfd 2.38-25
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wpointer-arith: YES 
Compiler for C supports arguments -Wcast-qual: YES 
Compiler for C supports arguments -Wnested-externs: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C supports arguments -Wmissing-prototypes: YES 
Compiler for C supports arguments -Wredundant-decls: YES 
Compiler for C supports arguments -Wshadow: YES 
Compiler for C supports arguments -Wsuggest-attribute=format: YES 
Found pkg-config: /bin/pkg-config (1.8.0)
Run-time dependency yaml-0.1 found: YES 0.2.5
Run-time dependency valgrind found: YES 3.20.0
Program python3 found: YES (/usr/bin/python3)
Program swig found: YES (/bin/swig)
Found git repository at /home/dwg/src/dtc
Compiler for C supports link arguments -Wl,--version-script=/home/dwg/src/dtc/libfdt/version.lds: YES 
Program flex found: YES (/bin/flex)
Program bison found: YES (/bin/bison)
Check usable header "fnmatch.h" : YES 
Program ../setup.py found: YES (/home/dwg/src/dtc/pylibfdt/../setup.py)
Library dl found: YES
Program run_tests.sh found: YES (/home/dwg/src/dtc/tests/run_tests.sh)
Build targets in project: 84

Found ninja-1.10.2 at /bin/ninja
$ meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /bin/ninja -C /home/dwg/src/dtc/build
ninja: Entering directory `/home/dwg/src/dtc/build'
[59/346] Generating tests/dumptrees with a custom command
Tree "test_tree1.dtb", 757 bytes
Tree "bad_node_char.dtb", 92 bytes
Tree "bad_node_format.dtb", 92 bytes
Tree "bad_prop_char.dtb", 98 bytes
Tree "ovf_size_strings.dtb", 90 bytes
Tree "truncated_property.dtb", 86 bytes
Tree "truncated_string.dtb", 104 bytes
Tree "truncated_memrsv.dtb", 72 bytes
Tree "two_roots.dtb", 84 bytes
Tree "named_root.dtb", 76 bytes
[346/346] Generating pylibfdt/pylibfdt with a custom command
$ meson test -C build
ninja: no work to do.
ninja: Entering directory `/home/dwg/src/dtc/build'
ninja: no work to do.
1/1 run-test        FAIL              3.45s   exit status 1
>>> PYTHON=/usr/bin/python3 MALLOC_PERTURB_=219 PYTHONPATH=/home/dwg/src/dtc/pylibfdt /home/dwg/src/dtc/tests/run_tests.sh

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/dwg/src/dtc/build/meson-logs/testlog.txt
dgibson commented 1 year ago

From testlog.log the failing test pieces are specifically:

dtc -I dts -O dtb -o cell-overflow-results.test.dtb cell-overflow-results.dts:  FAIL Returned error code 1
dtc -I dts -O dtb -o cell-overflow.test.dtb cell-overflow.dts:  FAIL Returned error code 1
dtbs_equal_ordered cell-overflow.test.dtb cell-overflow-results.test.dtb:       Bad configuration: Couldn't open blob from "cell-overflow.test.dtb": No such file or directory

. . . 

********** TEST SUMMARY
*     Total testcases:  2100
*                PASS:  2097
*                FAIL:  2
*   Bad configuration:  1
* Strange test result:  0
**********

It looks like the second failure and "bad config" are consequences of the first failure, but I have no idea why that first one is failing. The full testsuite passes fine when run from make.

dgibson commented 1 year ago

Wait.. figured it out, patch coming.

dgibson commented 1 year ago

Fix merged`