Unable to build site locally; make generating error

Hey Everyone! I am Somya from India. I am an outreachy applicant and currently I’m almost done with setting up my system locally. However, I am facing the following issue.:

I have installed and initialised opam and now I was starting to follow all the steps given on GitHub - ocaml/ocaml.org: Implementation of the ocaml.org website. for building site locally on my system but unfortunately I am getting the following error.:

ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/utils.ml -o script/utils.cmi
ocamlfind: Package `netstring’ not found
Makefile.common:119: recipe for target ‘script/utils.cmi’ failed
make: *** [script/utils.cmi] Error 2

Please help me out.

HI @Somya_Srivastava welcome to the OCaml community :camel:

There could be a few things happening here, first of all have you definitely run make deps from the root of the project to install additional dependencies. If you did run this, did it fail or did it pass?

Could you also let us know what operating system you are using. For future reference, this might have been better raised as an issue on the ocaml.org repository so others would find it more easily.

Hopefully we’ll get this sorted soon :))

Hi! Thanks for replying @patricoferris
I am using Ubuntu 18.04.5 LTS
Also, where is the root of the project located or how is it accessed through the terminal? I’m sorry I’m an absolute beginner.

I followed the instructions for setting it up manually as show below:

opam pin add -yn ocamlorg .
opam depext ocamlorg
opam install ocamlorg --deps-only

The output after I ran make deps is as follows:

Hi @Somya_Srivastava, no need to apologise whatsoever, hopefully we can get everything resolved.

It looks like you will need to install a newer version of ocaml which is indicated by:

The following dependencies couldn't be met:
    ocamlorg -> ocaml >= 4.08.0

This is enforced by the opam package file in the respository: ocaml.org/ocamlorg.opam at master · ocaml/ocaml.org · GitHub. Did you install opam using the ppa as suggested on the opam site opam - Install ? I’m surprised it has installed something older.

Just to double check everything, could you run:

opam exec -- ocaml --version

This should let us know what version of OCaml you are using. Then you could try to create a newer “global switch” (a fancy term for a global OCaml environment tied to a specific compiler) by running:

opam switch create 4.10.2 4.10.2

This is not the latest OCaml but it is the one we use for deploying the site so it should definitely be able to build the site. Once that has finished you should be able to retry the make deps step and with any luck you should get all the dependencies you need to get up and running.

Sorry for the delay in getting you onboarded.

Thank you for helping!
Yes I have installed opam using the ppa only.
I ran opam switch create 4.10.2 4.10.2 and thankfully now the version I’m using has upgraded accordingly. All the dependencies have been installed as I have checked.
The problem still gives the same error on running make. :confused: :

ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/utils.ml -o script/utils.cmi
ocamlfind: Package `netstring’ not found
Makefile.common:119: recipe for target ‘script/utils.cmi’ failed
make: *** [script/utils.cmi] Error 2

Okay we’re getting closer!

Could you cd into the repository and run make deps and paste the results here please? It still seems to be some issue with missing dependencies.

I’m already inside the ocaml.org repository that I’ve forked and cloned in my system as I was updating CONTRIBUTING.md which was merged successfully. Since this issue didn’t require ocaml to be installed I didn’t install it then but now it’s obviously the basic requirement.
Are you talking about the same repository?

Also, here are all the results including what make deps gave:

Yep that’s the one so now if you do eval $(opam env) and then run make do you still get this error:

ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/utils.ml -o script/utils.cmi
ocamlfind: Package `netstring’ not found
Makefile.common:119: recipe for target ‘script/utils.cmi’ failed
make: *** [script/utils.cmi] Error 2

Nope, it runs something but then ultimately gives a new error this time.:

ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/utils.ml -o script/utils.cmi
ocamlfind ocamlopt -annot -g -safe-string -package netstring,syndic
-c script/utils.ml -o script/utils.cmx
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -package uri,netstring -linkpkg
utils.cmx urlfun.mli urlfun.ml relative_urls.ml -o …/“script/relative_urls”
make staging SET_STAGING=’-set staging’
make[1]: Entering directory ‘/home/somya/ocaml.org’
ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/code_types.ml -o script/code_types.cmi
ocamlfind ocamlopt -annot -g -safe-string -package netstring,syndic
-c script/code_types.ml -o script/code_types.cmx
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/md_preprocess” -package omd,str,netstring -linkpkg
utils.cmx code_types.cmx code.ml md_preprocess.ml
cat “template/front_code_snippet.md” | script/md_preprocess | omd -r ocaml=script/ocamltohtml -r tryocaml=script/ocamlapplet.bash -o template/front_code_snippet.html
cat “template/learn_code_snippet.md” | script/md_preprocess | omd -r ocaml=script/ocamltohtml -r tryocaml=script/ocamlapplet.bash -o template/learn_code_snippet.html
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/breadcrumb” -package str,netstring -linkpkg
utils.cmx breadcrumb.ml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/translations” -package str,netstring -linkpkg
utils.cmx translations.ml
cd script &&
ocamlfind ocamlc -annot -g -safe-string -o …/“script/code_top” -package unix,netstring,dynlink,compiler-libs.toplevel
-linkpkg utils.cmo code_types.cmo code_top.ml
findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/somya/.opam/4.10.2/lib/ocaml/compiler-libs, /home/somya/.opam/4.10.2/lib/ocaml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/script/ocamltohtml lexer.ml ocamltohtml.ml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -package cohttp-lwt-unix,netstring,syndic
-thread -linkpkg utils.cmx http.ml rss2html.ml -o …/“script/rss2html”
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -package cohttp-lwt-unix,netstring,syndic
-thread -linkpkg utils.cmx http.ml weekly_news.ml -o …/“script/weekly_news”
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/lang_of_filename” -package str,netstring -linkpkg
utils.cmx lang_of_filename.ml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/translate” -package str,netstring -linkpkg
utils.cmx translate.ml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/link_of_lang” -package str,netstring -linkpkg
utils.cmx link_of_lang.ml
cd script &&
ocamlfind ocamlopt -annot -g -safe-string -o …/“script/generate_opam_update_list” -package cow
-linkpkg generate_opam_update_list.ml
curl -O http://opam.ocaml.org/json/last10_updates.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0curl: (6) Could not resolve host: opam.ocaml.org
Makefile.common:42: recipe for target ‘opam_update_list’ failed
make[1]: *** [opam_update_list] Error 6
make[1]: Leaving directory ‘/home/somya/ocaml.org’
Makefile:4: recipe for target ‘local’ failed
make: *** [local] Error 2

It seems there’s a problem with your network.

Oh yes! It worked.
Thank you so much @patricoferris and @dbuenzli!

2 Likes

Great, thanks @dbuenzli :+1:

Hey Hello @patricoferris i have this error do you have any idea on how i can solve that?

Hi @Lontchi_Lionelle – hopefully you can run something like make deps and eval $(opam env) and that should do the trick.

After doing all that this is the error i recieve

ocamlfind ocamlc -annot -g -safe-string -package netstring,syndic -c script/utils.ml -o script/utils.cmi
File "script/utils.ml", line 1:
Error: I/O error: script/utils.annotdfb8a5.tmp: Permission denied
make: *** [Makefile.common:119: script/utils.cmi] Error 2

I don’t know if you could help me please :pray:

It looks like a permission error, you need to make sure you have the correct permissions for the ocaml.org repository that I presume you got by cloning it. Maybe you ran some commands with sudo at some point? It’s always useful to provide as much details as possible for these types of errors (are you using Ubuntu like the original author of this post?).

Unfortunately I can’t really be of much more help beyond that. If you are really stuck you can always try a fresh git clone of the repository and run make.

If this all persists feel free to open an issue on GitHub - ocaml/ocaml.org: Implementation of the ocaml.org website. if you think something is broken, this forum isn’t quite the right place for those kinds of problems (it’s a bit of a miracle you found this post :slight_smile:)

Okay thank you lemme try cloning it from afresh

Thanks @patricoferris it worked perfectly!

1 Like