-
Notifications
You must be signed in to change notification settings - Fork 89
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 juliaup-init installer for Windows, Linux and OSX #143
Conversation
I have written the installation script as a polyglot in order for the same script to run on
|
I tested the script on Mac.
|
Co-authored-by: Filippo Vicentini <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this could be useful, and I think it makes a lot of sense just to copy rustup's implementation. Could use a link to their source repo I guess.
The polyglot script is very entertaining but from a practical standpoint it seems more complicated than useful. Can you explain why it's better than just having two separate scripts?
README.md
Outdated
|
||
### Linux and macOS Users | ||
- Run `curl https://raw.github.com/Julialang/juliaup/master/juliaup-init.sh.cmd | sh` or [download and run](https://raw.githubusercontent.com/Julialang/juliaup/master/juliaup-init.sh.cmd) to install juliaup. | ||
- Optionally, add the `~/.juliaup/bin` binaries to your `PATH`. Preferably, add symlinks via sudo privileges: `sudo ln "$HOME/.juliaup/bin/juliaup" /usr/local/bin/juliaup -s; sudo ln "$HOME/.juliaup/bin/julialauncher" /usr/local/bin/julia -s`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should recommend linking things in $HOME
to things in /usr/local
.
/usr/local
is a system-wide install location$HOME
is specific for your user
If there's any other users on the system this won't work well for them as all the files will reside in your specific $HOME
directory with your permissions.
A better alternative is to recommend the use of the $HOME/.local/bin
directory which is part of the XDG standard:
User-specific executable files may be stored in $HOME/.local/bin. Distributions should ensure this directory shows up in the UNIX $PATH environment variable, at an appropriate place.
Perhaps juliaup
itself could be installed into $HOME/.local/bin/juliaup
and we could skip the symlinks completely? If that's not possible, we can symlink it in there.
See also https://unix.stackexchange.com/questions/316765/which-distributions-have-home-local-bin-in-path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it's messy symlinking user-level things to system-wide directories. Will think a bit about this... It might be worth asking the user if the path should be appended in ~/.bashrc like conda and rust does is. I have a strange feeling about installing it flat into $HOME/.local/bin/
, since I want to be able to delete the whole directory (such as ~/.juliaup/bin
) and not have side effects.
juliaup-init.sh.cmd
Outdated
|
||
|
||
|
||
__sh__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... this way of combining sh
and cmd
and powershell
within one script is clever and entertaining. IIUC
- In
sh
mode, this first part is treated as a heredoc and skipped. - As a cmd script, the part above is a cmd bootstrapper to run powershell with the content of the file
- As a powershell script, the whole first part is skipped and the script starts at line ~750
It's pretty amazing that can be made to work, but practically it also seems unnecessary and complicated!
Wouldn't it be cleaner just to have one script file for windows (cmd+powershell) and another for unix? I guess I just don't see the advantage in combining them. This would also reduce divergence with the original unix script at https://github.com/rust-lang/rustup/blob/master/rustup-init.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will split to julia-init.sh
and julia-init.cmd
juliaup-init.sh.cmd
Outdated
|
||
#> | ||
# ****************************************************************** | ||
# (3) juliaup-init Windows Powershell version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this script also derived from somewhere else, or is it completely new?
I'm no powershell user, but rustup had interesting commentary on their equivalent thing in rust-lang/rustup#1878, though it seems that was never merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote the script from scratch, I didn't know that there were a rustup .ps1
in the making, will have to go and see if that is a better approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see they are building a cross-platform Powershell solution with quite a discussion on using Powershell idiomatic arguments. The purpose of my Powershell implementation is to get something working on the Windows side and to mimic the .sh
script as close as possible. So I think I'll keep it as a .cmd
file, to distingue it from a cross-platform Powershell solution, and also that is can run under stringent Windows security settings (e.g. running powershell scripts directly is disabled by default on Windows).
- Add an add to path option in bash - Split bash and batch implementations
did this PR stall? I think it would be great to have it... I can contribute some work if needed |
Sorry that I sat on this so long, too many other things going on! BUT, this is fantastic! I reviewed the Windows version pretty carefully, and one problem there is that the binaries we compile right now require a MSVC runtime that I think we can not rely on being present. When we deploy via the Store, this is not a problem because we declare that we need those and then the Store installs it for us, but we won't have that for this version. One option (I think) is to compile another version of Another thing we should do is copy the install script as part of the release GitHub workflow somewhere, and then reference that location to users, i.e. not have them use the version on How about this: why don't we merge this as is for now, but remove the mention in the README? I think we should really only start to advertise this once we also have the self-update mechanism in place. But if we just merge this for now without mentioning it in the docs, then devs can try it more easily and we can improve with incremental PRs. @heetbeet if that sounds OK to you, do you just want to remove the README edits, and then I'll merge? |
Thanks for the merge, sorry this was on my todo list, but it ultimately fell off while trying to finish my academics before the end of the calendar year |
Related to #84