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

navit: fix plugins #45687

Closed
wants to merge 1 commit into from
Closed

navit: fix plugins #45687

wants to merge 1 commit into from

Conversation

bignaux
Copy link
Contributor

@bignaux bignaux commented Aug 27, 2018

Motivation for this change

there was still some broken plugins with glibc. This fix all.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: navit

Partial log (click to expand)

shrinking /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64/navit/map/libmap_shapefile.so
shrinking /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64/navit/map/libmap_csv.so
shrinking /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64/navit/map/libmap_textfile.so
shrinking /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64/navit/map/libmap_mg.so
gzipping man pages under /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64  /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/bin
patching script interpreter paths in /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1
checking for references to /build in /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1...
moving /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib64/* to /nix/store/rbmxzzsqasgh0h2nbvxp0r8ryhbwvik1-navit-0.5.1/lib

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: navit

Partial log (click to expand)

shrinking /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/lib64/navit/graphics/libgraphics_gtk_drawing_area.so
shrinking /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/lib64/navit/font/libfont_freetype.so
shrinking /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/bin/maptool
shrinking /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/bin/navit
gzipping man pages under /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/lib64  /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/bin
patching script interpreter paths in /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1
checking for references to /build in /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1...
moving /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/lib64/* to /nix/store/zwn33kq3hzg1p368dkym7hdzhqr8m0mv-navit-0.5.1/lib

@@ -68,10 +68,10 @@ stdenv.mkDerivation rec {
'';

# TODO: fix upstream?
libPath = stdenv.lib.makeLibraryPath ([ stdenv.cc.libc ] ++ buildInputs );
Copy link
Member

Choose a reason for hiding this comment

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

I prefer not to set this kind of thing as attributes of the derivation but instead do something like:

postFixup = let
  libPath = stdenv.lib.makeLibraryPath ([ stdenv.cc.libc ] ++ buildInputs );
''
find "$out/lib" -type f -name "*.so" -exec patchelf --set-rpath ${libPath} {} \;
'';

It makes for more readable instantiated derivations.

Copy link
Member

Choose a reason for hiding this comment

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

which means, that nix variables do not become environment variables in the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oki, seems good on paper, but just doesn't work.

genesis@genlaptop:/nix/store/y27wr1g1hw6jxbrc13s1jxh52a9mk6xw-navit-0.5.2/lib]$ for f in $(find -iname "*.so"); do echo $f && ldd -v $f | grep not ; done
./navit/font/libfont_freetype.so
./navit/graphics/libgraphics_gtk_drawing_area.so
libcairo.so.2 => not found
./navit/graphics/libgraphics_opengl.so
./navit/graphics/libgraphics_sdl.so
./navit/graphics/libgraphics_null.so
./navit/gui/libgui_gtk.so
./navit/gui/libgui_internal.so
./navit/binding/libbinding_dbus.so
libglib-2.0.so.0 => not found
./navit/binding/libbinding_python.so
./navit/speech/libspeech_dbus.so
libglib-2.0.so.0 => not found
./navit/speech/libspeech_cmdline.so
./navit/vehicle/libvehicle_gpsd_dbus.so
libglib-2.0.so.0 => not found
./navit/vehicle/libvehicle_demo.so
./navit/vehicle/libvehicle_file.so
./navit/vehicle/libvehicle_pipe.so
./navit/vehicle/libvehicle_serial.so
./navit/vehicle/libvehicle_socket.so
./navit/osd/libosd_core.so
./navit/map/libmap_binfile.so
./navit/map/libmap_filter.so
./navit/map/libmap_mg.so
./navit/map/libmap_shapefile.so
./navit/map/libmap_textfile.so
./navit/map/libmap_csv.so

@bignaux bignaux closed this Aug 31, 2018
@bignaux bignaux deleted the navit branch August 31, 2018 13:32
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