JuliaLang / JuliaLang/juliaup

Add juliaup as an Ubuntu "snap"?

Open
#349 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.3k
Forks
116
Avg merge
12h 34m
Merged PRs (30d)
19

Description

Hi,

I see only a "prerelease version" is available on Linux Now considered "considered production ready" not just on Windows.

I did NOT manage to use juliaup on Ubuntu 22.04 LTS the first time around (i.e. with the "snap" curl, but then but then with curl from apt...).

A)
I can see that you would be wary of supporting juliaup as a snap, given the problem below (which I managed to fix; I keeping the (mostly) outdated) info in C) to show potential problem). With supporting juliaup as a snap, at least you would avoid the curl issue.

B)
> "Julia will look for a new version of Juliaup itself every 1440 seconds when you start julia."

That's intriguing, and a nice touch. It seems to have (only) 177.6-175.4 = 2.2 ms. (1.3%) overhead over:

```
$ hyperfine '/home/ubuntu/.julia/juliaup/julia-1.7.3+0.x64/bin/julia -e ""'
Benchmark 1: /home/ubuntu/.julia/juliaup/julia-1.7.3+0.x64/bin/julia -e ""
Time (mean ± σ): 199.6 ms ± 19.3 ms [User: 177.8 ms, System: 99.8 ms]
Range (min … max): 175.4 ms … 225.7 ms 13 runs
```

despite the large 3986584-byte size of julialauncher (so I'm not too concerned with improving the overhead/reducing the file-size, until startup of Julia itself if better... comparable to perl or Python). Since I'm rather obsessed with timing, and the the Julia startup, I will keep in mind bypassing the julialauncher. You might want to document it for benchmarkers (if not done already), how; when it actually looks for an update the overhead is larger, does it print out something to show that it's checking? That would help, but still hidden by hyperfine...

C)
Note, I'm running from an Ubuntu from a USB stick, and thought it might be a simple permission (or capacity) problem for /tmp, but seem to have ruled that out.

When/if Ubuntu is supported, would you be open to have juliaup as the default "snap" for julia (and/or juliaup)?

Right now you get:

```
ubuntu@ubuntu:~$ julia
Command 'julia' not found, but can be installed with:
sudo snap install julia
```

so newbies are likely to do that, and now even on rather new 22.04 you get Julia 1.0.4, not even the latest (then supported) 1.0.5, which is of course bad, and while maybe useful to some, or as a first step, it's bad since it's a 32-bit version (even on 64-bit), and thus you get cryptic error when using with PyCall (i.e. for interopting with 64-bit Python or I guess other 64-bit code).

I like to get rid of julia as a snap, not even replacing with Julia 1.6 LTS, for many reasons, it only gets one julia version, and Julia is a moving target, and I do not trust snap that much (others have written against it, could dig it up; in Linux Mint community if I recall).

So could juliaup be a drop-in replacement? Note for Julia you need to add "--classic" because of "classic confinement", and I'm not sure if that's a problem for juliaup. I think without that (or at least with) juliaup could work, and even though juliaup would be a snap, it would download regular non-snap julia, as we would want.

Since I've not tried it I'm not sure, but the installation procedure would for sure install juliaup, and I'm not sure if be default (but would be helpful to all, not just snap users, where kind of a requirement), install a default julia (latest non-LTS?).

I did try straight up ./juliaup.sh (and also this way, same error, except for prefix):
```
$ bash --debugger juliaup.sh
juliaup.sh: /usr/share/bashdb/bashdb-main.inc: No such file or directory
juliaup.sh: warning: cannot start debugger; debugging mode disabled

info: downloading installer
curl: (23) Failure writing output to destination
juliaup: command failed: downloader https://julialang-s3.julialang.org/juliaup/bin/juliainstaller-1.6.12-x86_64-unknown-linux-gnu /tmp/tmp.dDqzCuc4wU/juliainstaller x86_64-unknown-linux-gnu
```

That's rather strange as it made the dir, but not the file, and I could do that with touch, and edit the file:

$ touch /tmp/tmp.7GVYWDjIYM/juliainstaller

Note, curl was not installed, and I could do "snap install curl" without sudo, that was suggested... (with apt, where sudo was also suggested (and would get older curl), it was really required). I don't think it was a self-made mess because I (intentionally) skipped sudo, at least uninstalling and then installing with sudo snap install didn't help. I'm also thinking of some users that do not have sudo rights (and curl installed, likely rare to have neither).

https://askubuntu.com/questions/1387141/curl-23-failure-writing-output-to-destination

> After a very long research I found a useful hint.
>
> [Can't write to a hidden path using Curl](https://askubuntu.com/questions/1356327/cant-write-to-a-hidden-path-using-curl)
>
> Basically snap curl is useless. Uninstall it properly. Get the proper apt curl, and everything works like a charm.

One way would be to recommend using wget (rather than curl), that's actually installed in Ubuntu, or change your README to recommend apt for getting curl if it's not installed and/or explain the error "curl: (23) Failure writing output to destination" pointing to the URL above.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the juliaup.sh installer entry point and the README installation instructions, then reproduce the reported Ubuntu 22.04 curl and snap behavior. Determine whether a juliaup snap is feasible and whether the documentation should recommend apt-provided curl or wget; done means one clearly scoped, tested installation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
ubuntu
Domain
cli, devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.