ElementsProject / libwally-core

Useful primitives for wallets
Other
281 stars 135 forks source link

test/test_bip39.py: BIP39Tests.test_all_{langs,lookups} fail with --enable-standard-secp --enable-minimal #386

Closed whitslack closed 1 year ago

whitslack commented 1 year ago
./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu \
    --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share \
    --sysconfdir=/etc --localstatedir=/var/lib \
    --disable-dependency-tracking --disable-silent-rules \
    --docdir=/usr/share/doc/libwally-core-0.8.9 \
    --htmldir=/usr/share/doc/libwally-core-0.8.9/html \
    --with-sysroot=/ --libdir=/usr/lib64 --includedir=/usr/include/libwally \
    --enable-export-all --enable-tests --disable-elements \
    --enable-standard-secp --enable-minimal --enable-asm \
    --disable-swig-java --disable-swig-python

make

make -C src check-TESTS check-libwallycore PYTHON=python3.11

PYTHONDONTWRITEBYTECODE=1 python3.11 test/test_bip39.py
.FF...
======================================================================
FAIL: test_all_langs (__main__.BIP39Tests.test_all_langs)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/net-libs/libwally-core-0.8.9/work/libwally-core-release_0.8.9/src/test/test_bip39.py", line 42, in test_all_langs
    self.assertEqual(len(all_langs), len(list(self.langs.keys())))
AssertionError: 1 != 7

======================================================================
FAIL: test_all_lookups (__main__.BIP39Tests.test_all_lookups)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/net-libs/libwally-core-0.8.9/work/libwally-core-release_0.8.9/src/test/test_bip39.py", line 64, in test_all_lookups
    self.assertEqual(word, utf8(words_list[i]))
AssertionError: b'abandon' != b'a\xcc\x81baco'

----------------------------------------------------------------------
Ran 6 tests in 0.687s

FAILED (failures=2)
jgriffiths commented 1 year ago

@whitslack Fixed in master.

If you are building for a shared install, you should not be using --enable-minimal, its intended for embedded environments and may adversely affect performance on standard systems.

whitslack commented 1 year ago

If you are building for a shared install

Gentoo doesn't distribute prebuilt binaries. Each user builds the software from sources for themselves.

you should not be using --enable-minimal, its intended for embedded environments and may adversely affect performance on standard systems.

Gentoo ebuilds typically expose all upstream-provided Autoconf feature options as USE flags that the user may toggle to customize their build as they see fit. In the case of net-libs/libwally-core, the minimal flag is disabled by default (mirroring the default in your configure.ac). I'll implement a warning to anyone enabling it. Thanks for the insight.