Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode4 test consistently fails on RISC-V hardware #3579

Closed
2 tasks
Madouura opened this issue Jul 14, 2022 · 8 comments · Fixed by #3580 or #3614
Closed
2 tasks

unicode4 test consistently fails on RISC-V hardware #3579

Madouura opened this issue Jul 14, 2022 · 8 comments · Fixed by #3580 or #3614
Assignees
Labels
kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@Madouura
Copy link

Madouura commented Jul 14, 2022

Description

When compiling nlohmann_json on NixOS, on a RISC-V 64 bit system, StarFive VisionFive, the unicode4 test times out and fails the build.
This does not happen on regular x86_64 systems, so I believe a fix may be needed for either the test, or the thing being tested, regarding RISC-V compatibility.

Reproduction steps

Attempt to build nlohmann_json on a RISC-V system, either hardware or through a virtual machine like QEMU, on NixOS.
If you happen to have a StarFive VisionFive board, I suggest using this PR to reproduce: NixOS/nixpkgs#168826

Expected vs. actual results

unicode4 test should not be timing out.

Minimal code example

No response

Error messages

https://gist.github.com/Madouura/edf2ac1b06bf6e63507b9dc9bb338064

Compiler and operating system

GCC11 IIRC, NixOS

Library version

3.10.5

Validation

@falbrechtskirchinger
Copy link
Contributor

Increase the timeout then? This happens in CI sometimes as well.

@Madouura
Copy link
Author

I am very unfamiliar with this project, would you mind pointing to me where I can do that?
Is it a cmake option or something in the unit test itself?

@falbrechtskirchinger
Copy link
Contributor

See ctest --help.

--timeout = Set the default test timeout.

The default is 1500 seconds.

@falbrechtskirchinger
Copy link
Contributor

I'll look into raising the timeout for test-unicode4_cpp11 permanently.

@falbrechtskirchinger
Copy link
Contributor

falbrechtskirchinger commented Jul 14, 2022

https://github.com/NixOS/nixpkgs/blob/c199a0a796c748509019139e850485a90f4d3f60/pkgs/development/libraries/nlohmann_json/default.nix#L26-L29

Have you considered building with the CMake option JSON_FastTests=ON?

  cmakeFlags = [
    "-DBuildTests=${if doCheck then "ON" else "OFF"}"
    "-DJSON_FastTests=ON"
    "-DJSON_MultipleHeaders=ON"
  ] ++ lib.optional doCheck "-DJSON_TestDataDirectory=${testData}";

Also, BuildTests is wrong. The option is named JSON_BuildTests. As is doCheck doesn't affect unit testing.

@Madouura
Copy link
Author

Madouura commented Jul 14, 2022

I'll test it out and report back when done, thank you.

  cmakeFlags = [
    "-DJSON_BuildTests=${if doCheck then "ON" else "OFF"}"
    "-DJSON_FastTests=ON"
    "-DJSON_MultipleHeaders=ON"
  ] ++ lib.optional doCheck "-DJSON_TestDataDirectory=${testData}";

@Madouura
Copy link
Author

Successful build in my case, with FastTests.
Should I keep this issue open, since you have a PR ready?

@falbrechtskirchinger
Copy link
Contributor

Good to hear!
You can leave the issue open. I've linked it to the PR and it should be closed on merge.

@nlohmann nlohmann self-assigned this Jul 17, 2022
@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation release item: 🔨 further change labels Jul 17, 2022
@nlohmann nlohmann added this to the Release 3.11.0 milestone Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug release item: 🔨 further change solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
3 participants