diff --git a/docs/installation/index.md b/docs/installation/index.md index f95f0934..7c08e4d5 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -109,3 +109,34 @@ and add this snippet: "editor.defaultFormatter": "ocamllabs.ocaml-platform" } ``` + +## Troubleshooting + +## Error while compiling OCaml + +If you get an error while compiling OCaml and it says something about not being +able to find a file, then your `patch` binary probably isn't [GNU +patch](https://savannah.gnu.org/projects/patch/). Run this in your shell: + +```bash +patch --version +``` + +If it returns something like + +```text +GNU patch 2.7.6 +Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. +Copyright (C) 1988 Larry Wall + +License GPLv3+: GNU GPL version 3 or later . +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Written by Larry Wall and Paul Eggert +``` + +then you're good to go. Otherwise, you need to install GNU patch and make sure +that running `patch` will invoke it. How you do it depends on your operating +system. For example, on Macs you can install from [Homebrew](https://brew.sh/) +by running `brew install gpatch`.