codedownio / julia2nix

Generate Nix expressions for building a Julia depot with a set of packages
53 stars 6 forks source link

Does anyone solved the GR Build with Julia2nix? #11

Closed GTrunSec closed 2 years ago

GTrunSec commented 3 years ago

Thanks, any idea here or patch: image

Test with https://github.com/GTrunSec/my-julia2nix-env/blob/main/shell.nix I did a patch to solve it without nix-store in Jupyter IJulia. So, just a discussion here.

thomasjm commented 3 years ago

Solving GR is the only entry in the wiki right now :)

https://github.com/thomasjm/julia2nix/wiki#grjl

GTrunSec commented 3 years ago

Thanks for your wiki. please, let this issue still open while my shell testing to julia2nix.

GTrunSec commented 3 years ago

Done to integrated into Jupyter kernel.

GTrunSec commented 3 years ago
 Building Thrift ───→ `/nix/store/mkkqb6gy2k3cglfp9mj86sr97r5zpnxi-julia-depot/packages/Thrift/Xjowa/deps/build.log`   
┌ Error: Error building `Thrift`:                                                                                        
│ [ Info: Downloading https://github.com/tanmaykm/JuliaThriftBuilder/releases/download/julia1.0-thrift0.11.0/JuliaThriftB
uilder.v0.2.0.x86_64-linux-gnu.tar.gz to /nix/store/mkkqb6gy2k3cglfp9mj86sr97r5zpnxi-julia-depot/packages/Thrift/Xjowa/de
ps/usr/downloads/JuliaThriftBuilder.v0.2.0.x86_64-linux-gnu.tar.gz...                                                    
│ ERROR: LoadError: Could not download https://github.com/tanmaykm/JuliaThriftBuilder/releases/download/julia1.0-thrift0.
11.0/JuliaThriftBuilder.v0.2.0.x86_64-linux-gnu.tar.gz to /nix/store/mkkqb6gy2k3cglfp9mj86sr97r5zpnxi-julia-depot/package
s/Thrift/Xjowa/deps/usr/downloads/JuliaThriftBuilder.v0.2.0.x86_64-linux-gnu.tar.gz:                                     
│ ErrorException("")                                                                                                     
│ Stacktrace:                                                                                                            
│  [1] error(::String) at /nix/store/svx6pb30q7r7grsjwiyqyzbvwr0f3687-julia-1.5.3
thomasjm commented 3 years ago

Yeah, it looks like a similar situation as for GR.jl. For example, Snappy looks like it will try to download libsnappy if it doesn't find it: https://github.com/bicycle1885/Snappy.jl/blob/master/deps/build.jl.

On the bright side, a similar fix should work (put libsnappy in the extraLibs section).

Would you be interested in contributing fixes for these packages to the wiki?

GTrunSec commented 3 years ago

unworking-patch, any idea here? thanks

{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
  src = fetchurl {
    url = "https://github.com/davidanthoff/SnappyBuilder/releases/download/v1.1.7%2Bbuild.2/Snappy.x86_64-linux-gnu.tar.gz";
    sha256 = "sha256-4xvDcStCDLG5kdCFeXP0U9IAR5k5UhRvjvl4qank0sg=";
  };

in
runCommand "libsnappy-1.7.0" { inherit src; } ''
  tar -xf $src .
  mkdir -p $out
  cp -r include $out/.
  cp -r lib $out/.
''
thomasjm commented 3 years ago

Oh I'd just use the snappy in Nixpkgs. Does it work to just put extraLibs = [snappy]; in default.nix?

GTrunSec commented 3 years ago

Oh I'd just use the snappy in Nixpkgs. Does it work to just put extraLibs = [snappy]; in default.nix?

it does not work.

│ [ Info: Directory /nix/store/2kifk7k58kxjqkz0a60qm87z1garsz56-julia-depot/packages/Snappy/O2CHr/deps/usr/lib does not e
xist!                                 

looks link need to link the ${libsnappy}/lib to depot/Snappy/*/usr/lib?

thomasjm commented 3 years ago

I think you just need to convince BinaryProvider.jl to find the library. I was hoping that putting it on LD_LIBRARY_PATH would be enough.

Oh, are you on a Mac by any chance? In that case it would need to be DYLD_LIBRARY_PATH. This library doesn't distinguish by platform yet but you could try it manually.

GTrunSec commented 3 years ago

I think you just need to convince BinaryProvider.jl to find the library. I was hoping that putting it on LD_LIBRARY_PATH would be enough.

Oh, are you on a Mac by any chance? In that case it would need to be DYLD_LIBRARY_PATH. This library doesn't distinguish by platform yet but you could try it manually.

I'm on Linux. also I did a checklist for LD_LIB. looks like nothing wrong.(still failed) image

GTrunSec commented 3 years ago

I did a dirty hack to fix that.

thomasjm commented 2 years ago

GR works fine in recent versions, and is tested in CI now.