ocaml / ocaml.org

The official OCaml website.
https://ocaml.org
Other
161 stars 320 forks source link

The commands to activate the opam switch on windows are wrong #2707

Closed garrigue closed 2 weeks ago

garrigue commented 3 weeks ago

On the page "install ocaml on windows", the first steps are fine, but the two commands to activate the switch are wrong. The one for cmd reads for /f"tokens=*" %i in ('opam env') do @%i, and it misses a space between /f and "tokens=*". The one for PoweShell reads (& opam env) -split '?' | ForEach-Object { Invoke-Expression $_ }, but the ? should be replaced with the endline code (maybe hard to put on a web page). This makes the installation confusing.

Another issue I had is that windows 10 appears to spend most of its running the antivirus. A comment about how to stop it would be welcom.

cuihtlauac commented 3 weeks ago

Thanks, Jacques, this is very useful.

I've opened PR #2709 on this.

How can we address the ? / endline code issue?

@Sudha247, @jonahbeckford, @dra27: Any views on the antivirus question?

dra27 commented 3 weeks ago

That missing space is a typo - #2709 indeed deals with that. The actual code for the PowerShell snippet is correct in the sources:

https://github.com/ocaml/ocaml.org/blob/e464efad336853c64dd0fcd74deb781724759ea0/data/tutorials/getting-started/1_00_install_OCaml.md?plain=1#L105-L109 and https://github.com/ocaml/ocaml.org/blob/e464efad336853c64dd0fcd74deb781724759ea0/src/ocamlorg_frontend/pages/install.eml#L168-L170

so what happens with the rendering? From my browser I'm getting:

image

?

The virus scanner part is tracked in https://github.com/ocaml/opam/issues/5741. The principal aim to mitigate this is to stop extracting the massive tarballs and Git repositories (which will improve opam update everywhere), but there isn't a precise timeline for when that'll land. In the meantime, placing an scanning exception on C:\Users\you\AppData\Local\opam offers some mitigation (or alternatively using a Dev Drive, but that's Windows 11, rather than 10)

cuihtlauac commented 3 weeks ago

so what happens with the rendering?

Interesting. Which browser are you using? Here is what I'm seeing in Linux/Chrome. I'm seeing the same with Linux/Firefox and iOS/Safari

image

dra27 commented 3 weeks ago

Chrome 128.0.6613.138 (it updated to 129.0.6668.59 while I was looking for the version!) and Edge 128.0.2739.79 both on Windows 10 x64. I'm also seeing it correctly in iOS on my iPhone/iPad (just to be very clear that I'm looking at https://ocaml.org/docs/installing-ocaml in each case)

cuihtlauac commented 3 weeks ago

That page is also displayed fine on my side. What about this one?

https://ocaml.org/install#windows

This is what I've made a screenshot of.

dra27 commented 3 weeks ago

Oh, I was on the wrong page. Sorry, it’s suddenly obvious - the .eml is an ML file so the \r?\n should be \\r?\\n?

cuihtlauac commented 3 weeks ago

@dra27

The virus scanner part is tracked in https://github.com/ocaml/opam/issues/5741. The principal aim to mitigate this is to stop extracting the massive tarballs and Git repositories (which will improve opam update everywhere), but there isn't a precise timeline for when that'll land. In the meantime, placing an scanning exception on C:\Users\you\AppData\Local\opam offers some mitigation (or alternatively using a Dev Drive, but that's Windows 11, rather than 10)

Can we add a few words basically saying: “Sorry, this is going to take an awful lot of time”?

dra27 commented 3 weeks ago

Yes, indeed - we altered the opam init process in 2.2 so that there is at least a status indicator (the “loading data” and “extracting” markers, which make opam look considerably less “dead”)

cuihtlauac commented 3 weeks ago

Here is the texts I've pushed in #2709:

/install

Opam initialisation may take several minutes. Start A Tour of OCaml while waiting.

/docs/installing-ocaml

Opam initialisation may take several minutes. While waiting for its installation and configuration to complete, start reading A Tour of OCaml.