Roger-luo / IonCLI.jl

The Ion CLI for Julia.
MIT License
46 stars 2 forks source link

Ion is looking for a julia executable at `bin/` #35

Closed vchuravy closed 4 years ago

vchuravy commented 4 years ago
bin/ion add FFMPEG_jll -g 
ERROR: IOError: could not spawn setenv(`/home/vchuravy/builds/ion/bin/julia --compile=min -g1 --color=yes --startup-file=no -e 'using Pkg;pkg"add FFMPEG_jll"'`,["EDITOR=nvim", "PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus", "XDG_SESSION_DESKTOP=gnome", "XDG_SESSION_TYPE=wayland", "BINARYBUILDER_STORAGE_DIR=/home/vchuravy/.cache/binarybuilder", "USER=vchuravy", "BINARYBUILDER_AUTOMATIC_APPLE=true", "JULIA_DEPOT_PATH=/home/vchuravy/builds/ion/", "USERNAME=vchuravy", "GDMSESSION=gnome", "XDG_DATA_DIRS=/home/vchuravy/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share", "SHELL=/usr/bin/fish", "MOZ_ENABLE_WAYLAND=1", "XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.3USXR0", "XDG_MENU_PREFIX=gnome-", "MOTD_SHOWN=pam", "JULIA_PKG_DEVDIR=/home/vchuravy/src", "MANAGERPID=1330", "SESSION_MANAGER=local/odin:@/tmp/.ICE-unix/1377,unix/odin:/tmp/.ICE-unix/1377", "BINARYBUILDER_USE_CCACHE=true", "HOME=/home/vchuravy", "TERM=xterm-256color", "COLORTERM=truecolor", "VTE_VERSION=6200", "WAYLAND_DISPLAY=wayland-0", "INVOCATION_ID=df5c59bbc1934ab8883d8c22296c597a", "XDG_CURRENT_DESKTOP=GNOME", "LANG=en_US.UTF-8", "LOGNAME=vchuravy", "SHLVL=2", "XDG_RUNTIME_DIR=/run/user/1000", "DESKTOP_SESSION=gnome", "GDM_LANG=en_US.UTF-8", "SSH_AUTH_SOCK=/run/user/1000/keyring/ssh", "GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/66afbf99_e92e_46f4_966f_8d9d9a79f770", "GNOME_TERMINAL_SERVICE=:1.126", "PWD=/home/vchuravy/builds/ion", "XDG_SESSION_CLASS=user", "DISPLAY=:0", "GNOME_SETUP_DISPLAY=:1", "OPENBLAS_NUM_THREADS=8", "MAIL=/var/spool/mail/vchuravy", "JOURNAL_STREAM=8:46180", "JULIA_LOAD_PATH=@", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "OPENBLAS_MAIN_FREE=1"]): no such file or directory (ENOENT)
Stacktrace:
 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:99
 [2] #585 at ./process.jl:112 [inlined]
 [3] setup_stdios(::Base.var"#585#586"{Cmd}, ::Array{Any,1}) at ./process.jl:196
 [4] _spawn at ./process.jl:111 [inlined]
 [5] run(::Cmd; wait::Bool) at ./process.jl:439
 [6] run at ./process.jl:438 [inlined]
 [7] withproject(::String, ::Bool, ::String, ::Bool) at /home/runner/.julia/packages/IonBase/aihdB/src/project.jl:22
 [8] withproject at /home/runner/.julia/packages/IonBase/aihdB/src/project.jl:4 [inlined]
 [9] #add#5 at /home/runner/.julia/packages/IonBase/aihdB/src/project.jl:48 [inlined]
 [10] command_main(::Array{String,1}) at /home/runner/.julia/packages/Comonicon/DOlLr/src/codegen/ast.jl:255
 [11] command_main at /home/runner/.julia/packages/Comonicon/DOlLr/src/codegen/ast.jl:46 [inlined]
 [12] julia_main() at /home/runner/.julia/packages/Comonicon/DOlLr/src/parse/cast.jl:315
 [13] julia_main() at ./none:30
vchuravy@odin ~/b/ion [1]> ls
vchuravy commented 4 years ago

I downloaded v0.8.1 for Linux from the release page.

Roger-luo commented 4 years ago

ah right! I was normally using it via system image, so it wasn't an issue for that. It will spawn a subprocess to install things in the global environment. I guess I should do this by calling Pkg's API instead.

Roger-luo commented 4 years ago

I realize in the context of installing Julia packages (rather than binaries), we have to make sure there is a Julia compiler binary available and resolve the versions based on that compiler version since Julia packages are not standalone. This is not a problem when IonCLI is installed normally via Pkg.add since we can just assume users are using the exact same julia compiler and use that compiler version (via Base.julia_exename()).

But this can be an issue for the Ion application, which is standalone itself. I guess there is no reliable way to detect the compiler user uses, so I'm thinking about doing it in this way:

  1. read an env variable JULIA_EXECUTABLE_PATH, so if users are using a custom executable, ion can use that instead.
  2. detect in user shell env if a command-line entry julia exists, use this if it exists

I think in the future when Ion supports #19 we can just maintain a list of Julia compilers by Ion itself to know which is which and ask for a Julia installation if it cannot find any.

Roger-luo commented 4 years ago

@vchuravy should be fixed in 0.8.4, but if you don't have a julia command in your shell environment or (it's not the compiler you want to use) you will need to set JULIA_EXECUTABLE_PATH yourself.