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

guile-opengl: fix dynamic loading of libraries #87281

Open
wants to merge 1 commit into
base: master
from

Conversation

@KoviRobi
Copy link
Contributor

KoviRobi commented May 8, 2020

This uses the absolute path for libraries when opening them at runtime

https://www.gnu.org/software/guile/manual/html_node/Foreign-Libraries.html#index-dynamic_002dlink

Previously, the libGL, glu and freeglut weren't dependencies, now they are

$ nix-store -q --references guile-opengl-new 
/nix/store/d0ahcim3p9dv6b01nnmx5nvx7qggnki3-libGL-1.2.0
/nix/store/cv03ly81aq91d298kjb28ykzm176z3nb-freeglut-3.2.1
/nix/store/h6daxzmqp3q515vy4mxci92y551y5cx1-glu-9.0.1
$ nix-store -q --references guile-opengl-old 

I do wonder if there is a better way we could do this (i.e. doesn't Mac OSX have different file extensions for the libraries)? Perhaps somehow we could make autoconf find the libraries, and use the path it found? (I don't know much about autoconf). But this doesn't actually matter here, as the build platforms are linux only.

Guile-opengl doesn't seem to have any referrers, so I don't think this changes anything. I'm trying to package inspekt3d (https://gitlab.com/kavalogic-inc/inspekt3d/), and spotted this problem.

Motivation for this change
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
  • 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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@KoviRobi
Copy link
Contributor Author

KoviRobi commented May 8, 2020

This package (or perhaps the guile package setup hooks, as the libraries are in lib/guile/2.2/ccache/*) has a bug where the compiled objects aren't loaded by guile, so I'll investigate that further.

In the meanwhile, you can test it with https://raw.githubusercontent.com/guildhall/guile-opengl/master/examples/particle-system/vbo.scm, e.g.

$ wget https://raw.githubusercontent.com/guildhall/guile-opengl/master/examples/particle-system/vbo.scm
$ nix-shell -p guile guile-opengl -I nixpkgs=`pwd` # wherever the checkout is
$ export GUILE_LOAD_COMPILED_PATH=${GUILE_LOAD_COMPILED_PATH/share\/guile\/site\/2.2/lib\/guile\/2.2\/ccache}
$ guile vbo.scm

(I have tested it, it now works, it didn't work previously.)

@KoviRobi
Copy link
Contributor Author

KoviRobi commented May 23, 2020

#88720 fixes the problem with the GUILE_LOAD_COMPILED_PATH

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

1 participant
You can’t perform that action at this time.