Skip to content

openjpeg: don't use vendored libs in tests#355345

Merged
emilazy merged 1 commit intoNixOS:llvm-19from
paparodeo:openjpeg-test-without-3rd-party-libs
Nov 13, 2024
Merged

openjpeg: don't use vendored libs in tests#355345
emilazy merged 1 commit intoNixOS:llvm-19from
paparodeo:openjpeg-test-without-3rd-party-libs

Conversation

@paparodeo
Copy link
Contributor

@paparodeo paparodeo commented Nov 12, 2024

the tests are re-building everything but not taking the build flags into consideration and using vendored libs which silently fail to build with clang-19 and result in failed tests due to missing binaries. Disabling 3rd party libs fixes the tests.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@emilazy

@ofborg ofborg bot requested a review from codyopel November 12, 2024 17:36
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Nov 12, 2024
@emilazy
Copy link
Member

emilazy commented Nov 13, 2024

(Going to try to spend a little time to see if it’s possible to just make CTest work normally before merging this.)

@paparodeo
Copy link
Contributor Author

paparodeo commented Nov 13, 2024

(Going to try to spend a little time to see if it’s possible to just make CTest work normally before merging this.)

I'm not super confident that the test are actually passing -- the build succeeds but I think they are just silently failing. it seems that there is a required data repo we are not downloading: https://github.com/uclouvain/openjpeg-data.

downloading the data and then adding

    "-DJPYLYZER_EXECUTABLE=${lib.getExe' jpylyzer "jpylyzer"}"
    "-DOPJ_DATA_ROOT=./data"

to the cmakeFiles has ctest emit less errors (the data files can be located) but still 10% of the tests fail.

building a "successful" test run then looking in the Testing directory shows lots of errors due to not finding the test data directory and I assume that the actual result is only 35% of the tests pass -- which is what just running ctest in the build directory shows.

@emilazy
Copy link
Member

emilazy commented Nov 13, 2024

Aha. So the primary service the Travis CI CMake file is providing to us is to swallow all the errors?

Maybe we should just leave a comment that the data repository needs downloading for the tests and some of them fail, and remove the current code and disable them entirely for now until someone else gets them working. Or we could disable the failing 10%, I guess.

@paparodeo
Copy link
Contributor Author

Aha. So the primary service the Travis CI CMake file is providing to us is to swallow all the errors?

it's weird -- like when it couldn't compile stuff due to the vendored zlib it didn't report the compile error, ran the tests, and then failed -- which is what this PR aimed to fix ( and does).

but, yeah, it seems like the test failures aren't getting reported. feel like I should've just left the tests disabled. they already were disabled for aarch64 and only were running on x64 darwin and linux.

even with 10% failing that's like 140 tests that would need to be disabled. maybe there is a regex that matches...

@paparodeo paparodeo marked this pull request as draft November 13, 2024 15:46
Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Scary to disable that many tests, but it’s not like our current package was passing them anyway. (But maybe we should just disable the jpylyzer ones unconditionally if they all fail, if that’s a thing we can do.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_TESTING is automatically set, no need to do it ourselves.

Copy link
Contributor Author

@paparodeo paparodeo Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD_TESTING is automatically set, no need to do it ourselves.

if I don't set it no tests run.

openjpeg> No tests were found!!!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. I guess they flip the default or something.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can check if these pass now on aarch64-linux if you’d like.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. I made a couple of tweaks to the cmakeFlags and removed "-DCMAKE_INSTALL_NAME_DIR=\${CMAKE_INSTALL_PREFIX}/lib" running the passthru.tests -- everything in -dev looks fine.

tests were failing with clang-19 due to vendoring an old zlib. However,
even with the compile error fixed the tests would report success even
with the majority of them failing due to a missing data directory.

download the data directory to run the tests and just run tests by
cmake. 8% of the tests do fail and are excluded
@paparodeo paparodeo marked this pull request as ready for review November 13, 2024 17:04
@emilazy emilazy merged commit 1f9a1d0 into NixOS:llvm-19 Nov 13, 2024
@paparodeo paparodeo deleted the openjpeg-test-without-3rd-party-libs branch November 14, 2024 05:41
emilazy added a commit to emilazy/nixpkgs that referenced this pull request Nov 16, 2024
emilazy added a commit to emilazy/nixpkgs that referenced this pull request Nov 18, 2024
@FliegendeWurst FliegendeWurst mentioned this pull request Nov 23, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants