Julia2Nix.jl icon indicating copy to clipboard operation
Julia2Nix.jl copied to clipboard

The artifacts solution for Julia project

Open GTrunSec opened this issue 2 years ago • 7 comments

@samuela

As one of Julia's nix users, I have some questions for you.

  • What do you think about the artifacts issue?
  • The pathelf can only relieve some pain, but how to path them automatically in different - projecl.toml paths that are still an issue.
  • What are your thoughts on how to replace artifacts with nix-store?

GTrunSec avatar May 21 '22 21:05 GTrunSec

What is the "artifacts issue"? I don't have any context for what's going on here

samuela avatar May 22 '22 20:05 samuela

Also what's the relation between this issue and https://github.com/olynch/scientific-fhs/issues/6#event-6655419832?

samuela avatar May 22 '22 20:05 samuela

I'm looking for a solution when Julia packages download pre-built binaries. like https://discourse.nixos.org/t/system-with-nixos-how-to-add-another-extra-distribution/5767/22 mentioned.

Currently, I try to use julia2nix.jl which is like Crane to provide a way to build julia project with nix.

Also, You can try the following command to understand this behavior.

nix build github:JuliaCN/Julia2Nix.jl#packages.x86_64-linux.build-project --print-build-logs

Or nix run. Totally building and running with nix.

 nix run github:JuliaCN/Julia2Nix.jl#packages.x86_64-linux.build-project -- -e "import Julia2Nix" 
  • But You can't run any artifacts.
./result/artifacts/02d9b78ed041cc654102f58897ae46fac83ca63f/bin/openssl 
zsh: no such file or directory: ./result/artifacts/02d9b78ed041cc654102f58897ae46fac83ca63f/bin/openssl

GTrunSec avatar May 22 '22 20:05 GTrunSec

Also what's the relation between this issue and olynch/scientific-fhs#6 (comment)?

sorry to bother you, but this question should be here. (related to https://github.com/olynch/scientific-fhs/issues/5)

GTrunSec avatar May 22 '22 20:05 GTrunSec

This was a crude approach to solve the pathelf issue with artifacts.

GTrunSec avatar May 22 '22 20:05 GTrunSec

Ahh, ok. Hmm, I'm not sure I know exactly what to do, but I would try creating some kind of derivation that does patchelf --add-needed and then uses autoPatchelfHook to resolve things.

I don't know that there's a great way to do this. It looks like https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations would also be a useful ingredient

samuela avatar May 22 '22 23:05 samuela

I don't know that there's a great way to do this. It looks like https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations would also be a useful ingredient

Agreed. It looks like we need a mapping of nixpkgs to the current hashes of artifacts.

GTrunSec avatar May 23 '22 00:05 GTrunSec