-
Notifications
You must be signed in to change notification settings - Fork 359
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
opam init
breaks fish shell with configuration
#2255
Comments
Can you give the precise opam version ? ( The output of manually running Thanks for reporting! |
Here's the config report
I've talked to people on the mailing list about this and come up with a fix thanks to Zanchey on fish shell IRC. The proper configuration would have the following files: config.fish
init.fish
The above two files have a semicolon before the "or true" variables.fish
The above file doesn't have double quotes around the $PATH and the $MANPATH I've been looking at the repository and couldn't figure out which files to change... opamState looks like the place to fix things in variables.fish but it says |
I have the same problem This seems to be issue #2244 , which has already been fixed When can we expect 1.2.3 to be released with this fix? |
Same issue here. |
I ran into this as well. Based on the error messages I was getting, I could tell that
So two items, the .opam bin and then a totally collection of space-separated paths, which don't work for executable lookup. I commented out the OPAM config line in my fish.config for now as a workaround. |
I just installed Arch Linux and wanted to try opam, and this still happens. |
I just installed opam under OS X, and fish got broken as reported above. Manually adding two semicolons in config.fish and init.fish and removing redundant quotes from variables.fish brought it back to life. |
Just hit the same problem (on OS X). For anyone else searching on the error message, this is the output you see after starting a new shell:
|
I fixed this on my osx install by changing the line where the path is set to be:
Based on the advice in this comment: fish-shell/fish-shell#527 (comment) for setting paths in fish. My guess is the way it is being set here by opam is incorrect? Not much of a fish expert yet but it the spew of errors seems to indicate its clobbering path. |
In Fish, `or` is a command of its own, not a syntax element. So you need a semicolon before it to start a new command. Reference: http://fishshell.com/docs/current/commands.html#or This should be the last fix needed to solve ocaml#2255 – the other issues were fixed by 758c391 (use `source`) and c87a280 (don’t quote array variables).
Between my pull request #2424 and the earlier pull request #2169, we now have all the fixes to solve this issue. We just need to wait for a release of OPAM that contains those fixes. Until then, here are instructions for manually fixing your files:
|
Thought I should let people know, I'm still getting this error. The fix posted here is awesome, thanks @roryokane. However, it's probably annoying if one manages to miss this. I installed opam via homebrew, was this change not implemented there as well? |
Thanks @roryokane , your fix works for me also. |
Also installed |
Note: this doesn't just affect |
As suggested in #2169, I'd like to encourage making a point release with these two fixes. Current behavior breaks the configuration of fish shells when installing the latest release, 1.2.2 (released a year ago, so I'm assuming this is what most package managers have). |
I lost half an hour to find this bug report, so it would be nice to have this to work: many users may not have the luck or the patience to find it. |
Almost a year later and this is still a problem in 1.2.2, which is the one found in the pacman repo (Arch Linux package manager). Not sure who is admin of the package (can't bother to check), but could be nice if it was updated.. |
When is opam 1.2.3 going to be released? I'm on MacOS and still this error is present almost 2 years after the issue appeared. |
I'm still hitting this issue :( |
Who in the world is responsible for deploying this project to homebrew? I wanna know who to ping lol |
If you're still hitting this issue, I'd suggest to try opam 2.0 beta, it'll definitely fix the issue and seems stable to me |
Still an issue on OSX with Homebrew which provides https://github.com/Homebrew/homebrew-core/blob/master/Formula/opam.rb Maybe one of the contributors there would be down for making a FYI, this isn't a problem, though, on Fedora, which installed/upgraded itself to |
I'm curious why this was closed if it wasn't fully published 🤔 ++ on publishing this to homebrew, it's the primary package manager for macs |
It was closed because the issue has been fixed on master at the time (PR #2424). |
Is there anywhere we could follow up on that conversation? I assumed this repo's maintainers were responsible for publishing it, since they own the actual product @rjbou |
(also thanks for looping them in!) |
For now, a workaround is to use our brew tap with opam2: |
For the record, with the release of opam 2.0.0 this issue has finally been fixed - thanks @rjbou! |
And to add to that, 2.0.0 is now available with |
I still have this problem on the latest fish/opam:
edit -- it looks like upgrading opam through homebrew did not update the scripts in the |
Scripts in the opam root are installed only in the init step. To update them, run an |
I recently installed opam while using fish, and it did still have 1 problem: it broke my man command by setting $MANPATH, so now my man command can't find anything except ocaml related things. I installed opam 2.0.5 I fixed it by changing the line that sets MANPATH to this:
This fix made it so |
Tested on Ubuntu, Mac OS X, and FreeBSD.
When I invoke opam init, this is inserted in my config.fish
I'm not sure exactly how but this line renders the fish shell completely unusable. I have resorted to replacing the aforementioned line with
eval (opam config env)
The text was updated successfully, but these errors were encountered: