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

can not run Julia2Nix successfully on MacBook M1

Open alan-zhang-22 opened this issue 2 years ago • 12 comments

When I followed the instructions on my MacBook M1 Pro, I got the error messages as below:

warning: input 'nix-filter' has an override for a non-existent input 'nixpkgs' error: attribute 'julia-17-release-aarch64-darwin' missing

   at /nix/store/shndcj46cdfmb1kibdjrhvryc7mxksh4-nix/julia2nix/overlays/installApp.nix:19:12:

       18|   inherit version;
       19|   inherit (julia-sources."julia-${version}-${system}") pname src;
         |            ^
       20|
   Did you mean julia-18-release-aarch64-darwin?

(use '--show-trace' to show detailed location information) /nix/store/19lf3x5r6z169wg98m6m40y8v8fy4bj9-source/direnv_lib.sh:58: /Users/alan/projects/Julia2Nix/.std/julia2nix/devshells/default/shell-profile/entrypoint: No such file or directory

alan-zhang-22 avatar Aug 30 '22 07:08 alan-zhang-22

  • Only julia-18-release-aarch64-darwin available on aarch64-darwin; please try https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L27 package = pkgs.julia_bin-18 or package = julia2nix.packages.${system}.julia_18-bin; instead. 0:2: tmux  -  NixOS   2022-08-30 01-34-40

GTrunSec avatar Aug 30 '22 08:08 GTrunSec

Furthermore, Could you share your flake config here?

GTrunSec avatar Aug 30 '22 08:08 GTrunSec

Hi GuangTao,

There is only one line of flake configuration in the file ~/.config/nix/nix.conf

experimental-features = nix-command flakes

alan-zhang-22 avatar Aug 30 '22 08:08 alan-zhang-22

  • Only julia-18-release-aarch64-darwin available on aarch64-darwin; please try https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L27 package = pkgs.julia_bin-18 or package = julia2nix.packages.${system}.julia_18-bin; instead. 0:2: tmux  -  NixOS   2022-08-30 01-34-40

I got the same error as before. It seems that the variable version of Julia is not correct.

alan-zhang-22 avatar Aug 30 '22 08:08 alan-zhang-22

Fixed by https://github.com/JuliaCN/Julia2Nix.jl/commit/00d692aed5d2411c234dda58a1dca3bccc30ce41#diff-0aa872778243091e122dbd95590392267ea6e0cf66890d6e1543ed2606e1ee57R27 you can try again.

 nix flake lock --update-input julia2nix
nix develop --command julia --version

Notice: Maybe the 1.8 version cannot be used to generate julia2nix.toml under darwin, and the relevant code needs to be updated. PR is welcome

GTrunSec avatar Aug 30 '22 11:08 GTrunSec

I changed the Julia version in the area of line 14-18 of the file Julia2Nix/nix/julia2nix/devshellProfiles/packages.nix, and I can successfully run the commands you shared above. Before the changes, I got the same error as before.

image

alan-zhang-22 avatar Aug 30 '22 12:08 alan-zhang-22

I changed the Julia version in the area of line 14-18 of the file Julia2Nix/nix/julia2nix/devshellProfiles/packages.nix, and I can successfully run the commands you shared above. Before the changes, I got the same error as before.

image

Here is the running results:

image

alan-zhang-22 avatar Aug 30 '22 12:08 alan-zhang-22

Fixed by 00d692a#diff-0aa872778243091e122dbd95590392267ea6e0cf66890d6e1543ed2606e1ee57R27 you can try again.

 nix flake lock --update-input julia2nix
nix develop --command julia --version

Notice: Maybe the 1.8 version cannot be used to generate julia2nix.toml under darwin, and the relevant code needs to be updated. PR is welcome

Now I can run the Julia2Nix at the root folder level by following the commands you shared. I am curios how could I use the dev template? Is there a light way of using the template for creating a Julia enabled project? Could you please share the guideline of using the template with me?

Thanks!

alan-zhang-22 avatar Aug 30 '22 12:08 alan-zhang-22

you can create the template by the flake-init.

https://github.com/JuliaCN/Julia2Nix.jl#default

GTrunSec avatar Aug 30 '22 22:08 GTrunSec

Thanks for your information. Just test the template on MacBook Pro M1, and got the error message as below.

image

alan-zhang-22 avatar Aug 30 '22 22:08 alan-zhang-22

I didn't add the GR of aarch64-darwin. Please set it to false. https://github.com/JuliaCN/Julia2Nix.jl/blob/main/templates/dev/flake.nix#L35.

Adding multi-platform support is currently a bit of a hassle. I don't have the enough energy to add support for all platforms. I hope there is a complete artifacts solution in the future.

GTrunSec avatar Aug 30 '22 22:08 GTrunSec

Thank you GuangTao,

Now I am able to run the template devshell very well on aarch64-darwin.

image

alan-zhang-22 avatar Aug 31 '22 08:08 alan-zhang-22

@alan-zhang-22 @GTrunSec is this issue now closed?

samrose avatar Jun 29 '23 13:06 samrose