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 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 zimbatm left a comment

Choose a reason for hiding this comment

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

nice!

pkgs/applications/graphics/apitrace/default.nix Outdated Show resolved Hide resolved
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 requested a review from flokli May 2, 2020 15:39
@zimbatm zimbatm merged commit b3c18fe into NixOS:master May 4, 2020
@guibou guibou deleted the fix_apitrace branch May 4, 2020 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants