boxtron icon indicating copy to clipboard operation
boxtron copied to clipboard

FAIL: test_verify_preconfig

Open xiota opened this issue 1 year ago • 4 comments

Attempting to build using aur/boxtron and aur/boxtron-git.

FAIL: test_verify_preconfig (test_preconfig.TestPreconfig.test_verify_preconfig)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/main-builder/pkgwork/src/boxtron/tests/test_preconfig.py", line 44, in test_verify_preconfig
    self.assertEqual(preconfig.CHECKSUM, preconfig.__checksum__())
AssertionError: 'c0452d6addcde172b71cac7b339e074f5f13a7ad83f2ee4736d47025dcbc760e' != '17bf9cedc6e694983eb2a49c2add264b0e84c4efd3b1fba307cfcab5e21843e5'
- c0452d6addcde172b71cac7b339e074f5f13a7ad83f2ee4736d47025dcbc760e
+ 17bf9cedc6e694983eb2a49c2add264b0e84c4efd3b1fba307cfcab5e21843e5

xiota avatar Sep 27 '23 23:09 xiota

Same problem here; however, putting unpacked tarball to compatibilitytools.d worked like a charm.

Kristinaa78 avatar Sep 28 '23 23:09 Kristinaa78

Hey guys, I had the same problem with hash mismatch. After some investigation I think that I found the solution. I've tried some different approaches to solve it. First of all I've thought that just changing the CHECKSUM constant from the preconfig.py file could solve it, but actually, after testing in different operational systems, the tests passed in one of them, but not in the other. So, I went more deeply in the code, and after some time I've figured out that maybe the problem here is the tar version. I've tested with the version 1.35 and this one produced the wrong HASH, but the version 1.34 raised the correct result.

So, there're two possible approaches to solve it:

  1. downgrade the tar version
  2. update the hash constant

Before a pull request, to pass the test, either change the constant from

CHECKSUM = 'c0452d6addcde172b71cac7b339e074f5f13a7ad83f2ee4736d47025dcbc760e'

to

CHECKSUM = '17bf9cedc6e694983eb2a49c2add264b0e84c4efd3b1fba307cfcab5e21843e5'

or downgrade the tar command. To do that, just download the version 1.34 from here, and the compile all the source code. You can follow the INSTALL guide that comes with the source but, for a simpler example, just do the following:

  1. download the .tar.xz file from the GNU website
  2. unpack it
tar xvf tar-1.34.tar.xz
cd ./tar-1.34
  1. build it
mkdir -p $HOME/old-tar
mkdir -p $HOME/tar-1.34

sudo mv /usr/bin/tar $HOME/old-tar

./configure --prefix=$HOME/tar-1.34
make
make install

sudo ln -s $HOME/tar-1.34/bin/tar /usr/bin
  1. And finally, go to the boxtron directory and run
make test

Actually to solve it permanently it's a little tricky, once it depends of the user system, I have two ideas in mind:

  1. Change the constant in the code and put the exact used version of tar in the README.md.
  2. add the tar binary together with the code, then, for building, use it instead of the user's system one.

Dpbm avatar Oct 02 '23 00:10 Dpbm

Is this a tar bug that needs to be reported to them?

xiota avatar Oct 02 '23 01:10 xiota

I actually don't know if it's a bug, or they just improved their compression algorithm and, because of it, it's causing a hash mismatch. Might the problem here is to use tar instead of others, like zip, rar, etc.

Dpbm avatar Oct 02 '23 11:10 Dpbm