Open JackDunnNZ opened 4 years ago
Thanks for the feedback! I just pushed two commits, which should fix the bug. Could you try the master to see whether the fix works? Thanks!
Thanks for the quick response! Unfortunately it didn't quite work:
> JuliaCall::julia_setup()
############################################################################################################################################################# 100.0%############################################################################################################################################################# 100.0%
/Applications/Julia-1.4.0.app/Contents/Resources/julia/bin/julia: No such file or directory
Error in system2(file.path(.julia$bin_dir, "julia"), shQuote(command), :
error in running command
Here is the content of the captured output, it looks like there are some terminal escape sequences there that are messing with things:
[1] "Downloading artifact: MbedTLS"
[2] "\033[?25l\033[1A\033[2K\033[?25h/Applications/Julia-1.4.0.app/Contents/Resources/julia/bin"
Thanks for the report! I tried to find a reliable way to remove the escape sequences but failed. To avoid the problem altogether, I just pushed a commit that does twice the job. Since the artifact downloading should not affect the second result, the bug should be fixed. And it works for my windows machine. The only downside is that this adds setup time ~0.5s on my windows laptop.
Could you try the master to see whether it works? Thanks!
Thanks, it seems to work!
I was just thinking and I wonder if another solution could be to write an extra line to the output stream before the real data, to ensure that the last line is only coming from the desired command?
e.g. println("\n", JULIA_HOME)
instead of println(JULIA_HOME)
Just a thought in case you were concerned about the extra startup time. Either way, thanks for the quick fix!
In Julia 1.4, the artifact download process prints to stdout by default (a change from 1.3 where it was silent by default). This means that the first run of
julia
during the setup process might clutter stdout with other input and affect the values that are read from stdout during the setup script.As an example, I have replaced the default system image with a custom system image containing a package that depends on some artifact. If I delete
.julia/artifacts
and start Julia, the first thing it does during initialization is download the missing artifact, which pollutes stdout and corrupts the setup process.To reproduce, the steps to generate a simple system image like this are:
then remove the artifacts directory
rm -rf .julia/artifacts
and start julia again, where you get:To show how it affects JuliaCall, if I delete the artifacts directory again, and then try to run
julia_setup
I get the following:It seems like one fix might be to take the last line of the output rather than the full output, but I don't know enough about the package to know what the best fix is. It doesn't seem like there is a global flag in Julia to disable this output.