Skip to content
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

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

Closed
garrigue opened this issue Sep 19, 2024 · 9 comments · Fixed by #2709
Closed

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

garrigue opened this issue Sep 19, 2024 · 9 comments · Fixed by #2709
Assignees
Labels
bug Something isn't working documentation

Comments

@garrigue
Copy link

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
Copy link
Collaborator

cuihtlauac commented Sep 19, 2024

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
Copy link
Member

dra27 commented Sep 19, 2024

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

or from PowerShell:
```powershell
(& opam env) -split '\r?\n' | ForEach-Object { Invoke-Expression $_ }
```

and
or on PowerShell
<%s! Copy_to_clipboard.small_code_snippet ~id:"powershell-activate" "(& opam env) -split '\r?\n' | ForEach-Object { Invoke-Expression $_ }" %>

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

image

?

The virus scanner part is tracked in ocaml/opam#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
Copy link
Collaborator

cuihtlauac commented Sep 19, 2024

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
Copy link
Member

dra27 commented Sep 19, 2024

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
Copy link
Collaborator

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
Copy link
Member

dra27 commented Sep 19, 2024

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
Copy link
Collaborator

@dra27

The virus scanner part is tracked in ocaml/opam#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
Copy link
Member

dra27 commented Sep 20, 2024

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
Copy link
Collaborator

cuihtlauac commented Sep 20, 2024

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.

@cuihtlauac cuihtlauac added bug Something isn't working documentation labels Sep 20, 2024
@cuihtlauac cuihtlauac self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants