-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add install_julia function to download Julia #135
Add install_julia function to download Julia #135
Conversation
Looks good to me! And I also tested this on my windows laptop. I notice that the julia version is hard coded. I try a little for urls corresponding to different versions. It seems the url only works for recent versions. I guess we should at least to have a mechanism to grab the latest julia release information. Also, should the installation folder contain the version number? Maybe we could further test it on travis CI? So we could try to use |
Since this uses Julia_jll instead of the normal Julia download page (to get tarballs instead of installers or
I considered this, but then I thought that maybe it would be annoying for users if a new Julia version came out, we updated the version that JuliaCall looks for, and suddenly it no longer finds Julia installed when it did yesterday. We could still do this though, and check the install dir for any
Good idea! Will do. For 1 and 2, I'll try to implement them tomorrow and see how it goes. |
Good point! The problem can be alleviated since JuliaCall can remember the location of the installed julia in the prefs file. |
Another miscellaneous thing I just noticed is that on my laptop, the JuliaCall prefs and the .julia prefs are not in the same location because of the difference in determining the home directory: |
Ah, I was wondering how that would work on WIndows... Do you know how to get home directory in R? |
This works on my windows laptop, but I have no idea whether this is a robust way for windows system. |
Just tried myself and you can do Also I've deleted the AppVeyor config and replaced it with Windows on Travis, does that seem like a good idea? |
Thanks! That should work. |
So turns out Travis doesn't support R on Windows yet 🙁 |
We could look at migrating to GitHub Actions which supports all three major OS options, but maybe that can be for a separate PR. |
Yes, I have always considering migrating to GitHub action but don't have the time. And manually installation of julia really complicates the migration of CI. Hopefully the process can be made easy with the new |
I keep getting this error:
But I have the |
@christopher-dG Beyond the |
I take a further look at the travis testing log, and it is okay in general except a few notes. |
I assume the translation of this function can be used in pyjulia as well @tkf? |
I do not want to get in the way of JuliaCall devs so this is just me talking to myself. But, frankly, I'm against the approach that each X-Julia bridge library for language X implements Julia installer/manager. I tried to summarize my thoughts in JuliaPy/pyjulia#118 (comment) |
@tkf Thanks for your insightful thought! I agree that it is not a perfect approach for each X-Julia bridge library to have its own Julia installer/manager in the long run. And a general solution as proposed in JuliaPy/pyjulia#118 would be really nice. This PR gives a direct solution for the julia automatic installation problem based on current utilities, verified the feasibility of the solution, and builds up the basic corresponding logic in the JuliaCall package. |
Looks like tests finally pass. I'm wanting to add checksum/GPG verification now, is there a stdlib way to calculate an MD5 or SHA256? It looks like Maybe we can make |
For this purpose, I find The appveyor failure seems to be related to compilation. And I guess it is due to that the Rtools (compilation toolchain used by R) version does not match the new R version. There is some guidance on how to install and setup new Rtools at https://cran.r-project.org/bin/windows/Rtools/ |
Actually, now that I think about it, verifying SHA + GPG is not really doable for this since we're using the Julia_jll tarballs instead of the files from julialang.org/downloads. It'll work for Linux, but that's it (since the Windows/Mac files on the Julia downloads page are not tarballs). IMO it's not really worth it in that case. So we end up trusting GitHub to serve us the right files, which we already do a fair bit of. Thoughts? |
It seems that we could dig out the checksum from the julia_jll repo. But I guess it does not worth the effort to do this. |
Ah yeah, the hashes are indeed in Artifacts.toml. But then we need a TOML parser, and I agree it is likely not worth the effort. In that case, everything here is done minus AppVeyor, which I'm not quite sure how to fix. |
I still suspect that the error is from the compilation part. Line 72 in cec33df
But new https://cran.r-project.org/bin/windows/Rtools/ suggests that we do the following: PATH="${RTOOLS40_HOME}\usr\bin;${PATH}" So I guess this difference in \usr\bin vs bin maybe the cause for appveyor failure. Beyond that, we also don't have automatic installation of julia on appveyor.After change of this, I expect the failure to go away. But if it still persists, one way to debug the issue is to uncomment the last line of the appveyor.yml and use Remote Desktop. |
When using Command Prompt, `Rscript -e '...'` commands seem to do nothing.
I am very confused.
Plenty of progress has been made... but still no success. Julia does get installed correctly as the last step of the
Which comes from downloading the Julia tarball. |
Since I couldn't really get AppVeyor figured out, I've tried to set up GitHub Actions according to this example. But unfortunately it seems like it needs to be merged before it will run... 😬 |
@Non-Contradiction what's left to get this merged? |
Thanks for the reminder! |
Description
Adds the
install_julia
function which will install Julia for you. The user can choose where the installation will go, otherwise it will be put in the user's "data dir" e.g.~/.local/share/JuliaCall
on Linux.The installed location is remembered by adding a file
$JULIA_DEPOT_PATH/prefs/JuliaCall
which contains the install path, and that file is checked injulia_locate
.Related Issue
#116
Probably the most finicky part of this is building up the download URL, so some eyes/suggestions on that bit would be appreciated.
Still needs tests and docs, I would just like to see if the approach is okay.
Also please point out any really awful bits of code, and suggest the "right" way to do it (this is my first contribution in R).