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

apitrace: fix to find OpenGL libraries #86475

Merged
merged 1 commit into from May 4, 2020
Merged

Conversation

@guibou
Copy link
Contributor

guibou commented May 1, 2020

Motivation for this change

Fix apitrace which was not working anymore.

  • Tracing was not working because of missing OpenGL libraries, probably due to the recent changes in OpenGL in NixOs.
  • Qt GUI to see trace was not working due to the recent QT changes in nixpkgs.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions (but need nixGL to work properly)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after) (1.1 GB versus 1.1 GB)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@guibou
Copy link
Contributor Author

guibou commented May 1, 2020

The ofborg complains about called without required argument 'mesa_drivers', does it means that ofborg does not have mesa_drivers? That's annoying, but mesa_drivers in this derivation was already a hack (see commit comment), so I'll try to find a better solution.

@guibou
Copy link
Contributor Author

guibou commented May 1, 2020

Issue with oborg is now fixed. @zimbatm @flokli could you review?

Copy link
Member

zimbatm left a comment

nice!

pkgs/applications/graphics/apitrace/default.nix Outdated Show resolved Hide resolved
@guibou guibou requested review from zimbatm and flokli May 1, 2020
@guibou guibou force-pushed the guibou:fix_apitrace branch from 6effd6c to d835e4b May 2, 2020
@guibou guibou requested a review from Mic92 May 2, 2020
@guibou guibou force-pushed the guibou:fix_apitrace branch from d835e4b to bd39403 May 2, 2020
@guibou guibou force-pushed the guibou:fix_apitrace branch from 1b2877b to 25c18fb May 2, 2020
For unknown reasons, Apitrace breaks the runpath of the traced program.
OpenGL programs on nix are looking at /run/opengl-driver/lib to find the
system OpenGL driver.

This change:

- add path /run/opengl-driver{-32} to the RPATH of the wrapper
libraries. This fixs tracing with `apitrace trace`.
- add rpath to `libglnvd` and `libGL` to the `{e}glretrace` binaries.
These libraries are loaded at runtime, but does not appears as NEEDED in
the binaries, hence the need for the explicit rpath addition. This fix
`{e}glretrace`.
- Explicitly add Qt wrapper to `qapitrace`. It fixs the GUI.

Co-authored-by: Florian Klink <flokli@flokli.de>
@guibou guibou force-pushed the guibou:fix_apitrace branch from 25c18fb to dcba727 May 2, 2020
@guibou guibou requested a review from flokli May 2, 2020
@zimbatm zimbatm merged commit b3c18fe into NixOS:master May 4, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
apitrace, apitrace.passthru.tests on aarch64-linux Success
Details
apitrace, apitrace.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="dcba727"; rev="dcba727d0d1572e3268e5507ef9830b837acad28"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@flokli
flokli approved these changes May 4, 2020
@guibou guibou deleted the guibou:fix_apitrace branch May 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.