open-quantum-safe / liboqs

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

Many tests fail on FreeBSD #1090

Closed yurivict closed 2 years ago

yurivict commented 3 years ago

Log: https://people.freebsd.org/~yuri/liboqs-test-failures.txt

Version: 0.7.0 OS: FreeBSD 13

baentsch commented 3 years ago

Most errors indicate a FileNotFound error: 'build/include/oqs/oqsconfig.h' which is highly unusual after a successful build (lots depends on this file). Thus, can you please confirm the build done did complete successfully before you executed the tests? Did you run the build with the exact same parameters as in the README, or did the liboqs build maybe generate the object files in a folder other than 'build'?

yurivict commented 3 years ago

The build succeeded.

The potential difference is that I do out-of-source build. Here are cmake arguments:

-DCMAKE_C_COMPILER:STRING="cc"  -DCMAKE_CXX_COMPILER:STRING="c++"  -DCMAKE_C_FLAGS:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_C_FLAGS_DEBUG:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_CXX_FLAGS:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_CXX_FLAGS_DEBUG:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_EXE_LINKER_FLAGS:STRING="  -fstack-protector-strong "  -DCMAKE_MODULE_LINKER_FLAGS:STRING="  -fstack-protector-strong "  -DCMAKE_SHARED_LINKER_FLAGS:STRING="  -fstack-protector-strong "  -DCMAKE_INSTALL_PREFIX:PATH="/usr/local"  -DCMAKE_BUILD_TYPE:STRING="Release"  -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES  -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DOQS_DIST_BUILD:BOOL=ON -GNinja -DPython_ADDITIONAL_VERSIONS=3.8 -DBOOST_PYTHON_SUFFIX:STRING=38

They are mostly set by the FreeBSD ports framework.

baentsch commented 3 years ago

If the build directory (where all generated code, objects and headers--such as those not found-- are winding up) is at a different location than the tests (expect it), these errors are a logical consequence.

So, before starting the test you may want to set the environment variable "OQS_BUILD_DIR" to the location that is correct in your case: See the relevant code. If the assumptions stated there don't work for your case, please let us know (what your specific setup is: Where is the build directory? Where is the source/tests directory?) so we can improve this logic.

We'd obviously also be grateful for a PR from you changing suitably the liboqs "build-finding logic" to make it work also for your setup.

Edit/Add: Just saw https://github.com/freebsd/freebsd-ports/commit/c168a0df807e45f9d49ccb658d36858f9bedce26: Thanks very much for this integration!

merkys commented 3 years ago

So, before starting the test you may want to set the environment variable "OQS_BUILD_DIR" to the location that is correct in your case: See the relevant code. If the assumptions stated there don't work for your case, please let us know (what your specific setup is: Where is the build directory? Where is the source/tests directory?) so we can improve this logic.

Thanks for a great hint. By the way, build is hard-coded in tests/test_spdx.sh, it would be great if this test script would also pay attention to OQS_BUILD_DIR environment variable.

baentsch commented 3 years ago

it would be great if this test script would also pay attention to OQS_BUILD_DIR environment variable

So done & Thanks for this suggestion/pointer to the omission: A fix for this is part of #1091. After that has landed, it'd be nice if you could confirm this resolves all issues in your build environment so we can close this issue.

merkys commented 3 years ago

Thanks for the fix! This indeed resolves all issues in my (Debian) build environment. @yurivict how about you?

baentsch commented 2 years ago

@yurivict : OK to close?

baentsch commented 2 years ago

Closing assuming https://github.com/open-quantum-safe/liboqs/pull/1091#issuecomment-924994271 applies.