Open jpffitch opened 3 years ago
Hi @jpffitch!
It looks like you did the build in the same directory as the source. We haven't tested in that way since restructuring our unit test directory and replacing our "split" test files with encrypted test files. It seems we have a bug with the new layout when building and testing in the source directory. Specifically the failure is because the encrypted *.xor
test files end up co-located with the unencrypted ones after the build, and then the tests complain that there are more test files than expected:
74a1eb4ee73b:~/clamav-0.104.0 # ls unit_tests/input/clamav_hdb_scanfiles/
clam-aspack.exe clam-upx.exe clam.bin-be.cpio clam.ea06.exe clam.exe.rtf.xor clam.odc.cpio clam.zip
clam-aspack.exe.xor clam-upx.exe.xor clam.bin-be.cpio.xor clam.ea06.exe.xor clam.exe.szdd clam.odc.cpio.xor clam.zip.xor
clam-fsg.exe clam-v2.rar clam.bin-le.cpio clam.exe clam.exe.szdd.xor clam.ole.doc clam_IScab_ext.exe
clam-fsg.exe.xor clam-v2.rar.xor clam.bin-le.cpio.xor clam.exe.binhex clam.exe.xor clam.ole.doc.xor clam_IScab_ext.exe.xor
clam-mew.exe clam-v3.rar clam.bz2.zip clam.exe.binhex.xor clam.exe_and_mail.tar.gz clam.pdf clam_IScab_int.exe
clam-mew.exe.xor clam-v3.rar.xor clam.bz2.zip.xor clam.exe.bz2 clam.exe_and_mail.tar.gz.xor clam.pdf.xor clam_IScab_int.exe.xor
clam-nsis.exe clam-wwpack.exe clam.cab clam.exe.bz2.xor clam.impl.zip clam.ppt clam_ISmsi_ext.exe
clam-nsis.exe.xor clam-wwpack.exe.xor clam.cab.xor clam.exe.html clam.impl.zip.xor clam.ppt.xor clam_ISmsi_ext.exe.xor
clam-pespin.exe clam-yc.exe clam.chm clam.exe.html.xor clam.iso clam.sis clam_ISmsi_int.exe
clam-pespin.exe.xor clam-yc.exe.xor clam.chm.xor clam.exe.mbox.base64 clam.iso.xor clam.sis.xor clam_ISmsi_int.exe.xor
clam-petite.exe clam.7z clam.d64.zip clam.exe.mbox.base64.xor clam.mail clam.tar.gz clam_cache_emax.tgz
clam-petite.exe.xor clam.7z.xor clam.d64.zip.xor clam.exe.mbox.uu clam.mail.xor clam.tar.gz.xor clam_cache_emax.tgz.xor
clam-upack.exe clam.arj clam.ea05.exe clam.exe.mbox.uu.xor clam.newc.cpio clam.tnef clamjol.iso
clam-upack.exe.xor clam.arj.xor clam.ea05.exe.xor clam.exe.rtf clam.newc.cpio.xor clam.tnef.xor clamjol.iso.xor
Sorry about the confusion, and thanks for submitting this bug report!
We would have to store the encrypted test files in a different location to resolve this issue. Best practice is to do the build in a different directory anyways, like a subdirectory, or a directory outside of the source directory. So I'm not sure if it's worth fixing, but we should at least put a check during the build to stop people from running into this issue and to require doing the build in a different directory.
I did not intend buildinfd in the source directory. I issued mkdir build; cd build; cmake ..
and tere were no file in build and the last mesage was that ir had copied files into the parent directory of build. So I wenr back a level andram make.
That was wjhat I wastrying to express as "odd build"
What should I have done?
PS I tried the debian package but I failed to work out how to imstall it; another oddity but then I do not know whether I could specify the user/grpup
Hi sorry I missed your response earlier.
CMake can be a little funny. If you do cmake .
in the source directory once, it creates a CMakeFiles
directory and and CMakeCache.txt
file that store your configuration. Then if you try doing it again from a subdirectory like mkdir build && cd build && cmake ..
, it will just build in the source directory where you configured from rather than re-configure in your current directory. So if you do ls
in your current build
directory, you'll find it's still empty. And if you do make
from that empty build
subdirectory, you'll get:
❯ make
make: *** No targets specified and no makefile found. Stop.
What you want to do is start over. Either delete the CMakeFiles
directory and and CMakeCache.txt
file, or better yet untar a fresh copy of the source. Then try again, this time only ever running cmake
from a build
subdirectory. You can follow these instructions: https://docs.clamav.net/manual/Installing/Installing-from-source-Unix.html#build-clamav
To-do for the clamav team: Let's either:
Buit 0.104 frm sources. Only oddity is tat it ignored te build directory
transcipt
and more thesame until