Extend binary installer to support the new /stable endpoint#202
Extend binary installer to support the new /stable endpoint#202Leonidas-from-XIV wants to merge 4 commits intoocaml-dune:mainfrom
/stable endpoint#202Conversation
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
|
Did you run the server locally and test the script? |
|
Yes, I ran the server and it displays the new line with the right stable version. I've also tested installation of stable and nightly versions on an |
|
@Alizter Do you have any opinion on the |
|
I think |
Perfect! In fact it could be anything else as well (e.g.
Yes, that's part of this PR. In |
This PR extends the binary install script with support for querying the
/stableendpoint and extends the website to mention it. I thought it would be neat if the website mentioned the latest release so this is exactly what it does now.I took the
sh -strick from dune-bin-install, however I am unsure how the call should look like. The waysh -sworks is it setsargv, even includingargv[0]. This means that we always have to pass some argument tosh -sto fillargv[0]before filling the rest ofargv.In the current state of this PR I just tell people to pass
-as it doesn't really matter whatargv[0]is, but arguably that's a bit ugly.dune-bin-installhandles it by pretendingargv[0]is a proper argument (instead of just the executable name) and parses the version information out of it, which allows it to avoid one argument tosh -s.As I see it there are multiple ways of handling this:
sh -s <RANDOM> <ACTUAL_ARGS>(this PR currently sets<RANDOM>to-)dune-bin-installand interpretargv[0]as version (| sh -s 3.21.1)argv[0]($0in shell) instead of the usualargv[1]($1), that way we could do| sh -s --release 3.21.1The latter two are a bit wonky because if someone downloads the script and then calls it (with
./installor so) thenargv[0]will be set to./install(or so), thus we have to handle the cases of "launch from shell" and "pipe intosh" quite differently.Your insights and ideas are greatly appreciated.