tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
61 stars 8 forks source link

macOS: installer cannot find `sha512sum` #76

Closed samoht closed 2 years ago

samoht commented 2 years ago

On macOS the experience is not super smooth yet it seems :p

First try: I was confused because nothing was happened - but actually the output is mangled (notice where Password is displayed):

❯ sudo bash < <(curl -L https://github.com/tarides/ocaml-platform-installer/releases/latest/download/installer.sh)

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Password:
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  4488  100  4488    0     0   2347      0  0:00:01  0:00:01 --:--:--  5212

Second try: it goes a bit further but then fail because of a missing sha512sum:

❯ sudo bash < <(curl -L https://github.com/tarides/ocaml-platform-installer/releases/latest/download/installer.sh)
[...]
=> Download ocaml-platform-0.1.0-macos-x86_64.tar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 2820k  100 2820k    0     0  1236k      0  0:00:02  0:00:02 --:--:-- 1674k
bash: line 87: sha512sum: command not found
tmattio commented 2 years ago

Ideally, we wouldn't have to depend on external tools like sha512sum. I don't think the opam installer depends on it, right? How do they do checksums?

Julow commented 2 years ago

I have a fix for the mangled prompt and for the sha512sum command: https://github.com/tarides/ocaml-platform-installer/pull/77

The Opam installer simply don't check if the command it needs isn't available (and it uses an even more uncommon commands, openssl).

Checking the consistency of downloaded archives is a good practice but not required when using https. Skipping the check is fine but I'd be curious to know first if a distro don't have shasum (distributed with perl) installed by default.