open-quantum-safe / liboqs

C library for prototyping and experimenting with quantum-resistant cryptography
https://openquantumsafe.org/
Other
1.69k stars 419 forks source link

ninja_runtests failing #1742

Closed baentsch closed 3 months ago

baentsch commented 3 months ago

Discussed in https://github.com/orgs/open-quantum-safe/discussions/1741

Originally posted by **yogappu** April 2, 2024 Hi all, I am trying to build and run the liboqs on windows. i am successfully able to compile it on GNU But when i run tests, some of them fail. **_========================================================================== 54 failed, 218 passed, 313 skipped in 46.37s ==========================================================================_** Failure reason is mentioned as below **_FAILED tests/test_alg_info.py::test_alg_info_sig[ML-DSA-44] - FileNotFoundError: [WinError 2] The system cannot find the file specified_** I guess the failure reason is line below ` datasheet_filename = helpers.run_subprocess(['grep', '-r', '-l', kem_name, 'docs/algorithms/kem']).splitlines()[0]` as there exist no file with name of ML-DSA-44 in docs/algorithms/kem. Are there any other way to run tests ? Am i doing something wrong ? Any help would be appreciated. Note: I am running tests without any changes in configuration, directly on master. Thanks.
bhess commented 3 months ago

Thanks for the report, I'll look into the issue.

bhess commented 3 months ago

FAILED tests/test_alg_info.py::test_alg_info_sig[ML-DSA-44] - FileNotFoundError: [WinError 2] The system cannot find the file specified

The test should open the file docs/algorithms/sig/ml_dsa.yml, which is derived from running grep -r -l ML-DSA-44 docs/algorithms/sig.

@yogappu: could you please try running the following and check if the output differs on your system?

% grep -r -l ML-DSA-44 docs/algorithms/sig
docs/algorithms/sig/ml_dsa.yml
docs/algorithms/sig/ml_dsa.md
% grep -r -l Falcon-512 docs/algorithms/sig
docs/algorithms/sig/falcon.yml
docs/algorithms/sig/falcon.md
yogappu commented 3 months ago

@bhess :i am running it on windows, so converted grep to windows command and get same output as you.

C:\Work\base_liboqs\liboqs> findstr /S /M ML-DSA-44 "docs\algorithms\sig*" docs\algorithms\sig\ml_dsa.md docs\algorithms\sig\ml_dsa.yml C:\Work\base_liboqs\liboqs> findstr /S /M Falcon-512 "docs\algorithms\sig*" docs\algorithms\sig\falcon.md docs\algorithms\sig\falcon.yml

yogappu commented 3 months ago

Uploading all logs incase it helps for investigation..

cmake_GNinja.log ninja_build.log ninja_runtests.log

bhess commented 3 months ago

Thanks for providing the logs and the details.

You indicate that 'grep' is not available on your system which points to the problem, as it is used explicitly by the test. I believe msys2, cygwin or WSL make 'grep' and other tools available to run the test successfully on Windows. I don't have a Windows box at hand at the moment so it would take me a few days to give more concrete guidance.

If this is an option for you, please note that the primary toolchain we support on Windows is VisualStudio which is used for the CI runs .

bhess commented 3 months ago

@yogappu, just tested it on Windows 11 and the mingw64 toolchain you seem to use. The tests pass (both via the windows command prompt and msys2-mingw64). Just make sure to have mingw64-grep installed. Please let me know if this helps.

yogappu commented 3 months ago

@bhess Thanks for the hint. I was missing mysys2(required for grep) and now issue seems to be resolved after installation. Please refer the logs below. @baentsch can you please close this bug ?

[gw0] [ 99%] SKIPPED tests/test_vectors.py::test_vectors_kem[BIKE-L1] [gw1] [100%] PASSED tests/test_speed.py::test_sig[SPHINCS+-SHA2-256f-simple]

========================================================================================= 272 passed, 313 skipped in 49.18s ==========================================================================================