It seems that opam 2.0 introduce sandbox feature to separate build and installation process, flow_parser can not be installed correctly. Here's the error:
# ocamlfind: Cannot mkdir /Users/duzhongchen/.opam/system/lib/flow_parser: Operation not permitted
# make: *** [ocamlfind-install] Error 2
No idea how to solve it.
Does sudo work?
No. It seems that it's a restriction from opam, I solve it by execute make ocamlfind-install install by myself.
closed by mistake
Hello, I managed to fix that and to have flow_parser install properly with opam 2.0.
However, the opam file in the master branch does not correspond to the one in the v0.96 release archive. I don't really know where to make the pull.
How should I do proceed ?
thanks !
@giltho Could you post the fix?
Sure :
The error comes from the sandboxing of opam 2. Basically, the build is not allowed to get "out" of its own folder. That is why the build and install operations are now separated.
The opam file should be
opam-version: "2.0"
name: "flow_parser"
version: "X.Y.Z"
maintainer: "[email protected]"
authors: ["Flow Team <[email protected]>"]
homepage: "https://github.com/facebook/flow/tree/master/src/parser"
bug-reports: "https://github.com/facebook/flow/issues"
license: "MIT"
build: [ "sh" "-c" "cd src/parser && make ocamlfind-build" ]
install: [ "sh" "-c" "cd src/parser && make ocamlfind-install" ]
remove: ["ocamlfind" "remove" "flow_parser"]
depends: [
"ocaml" {>= "4.03.0"}
"ocamlfind" {build}
"ocamlbuild" {build}
"dtoa"
"core_kernel"
"ppx_deriving" {build}
"ppx_gen_rec" {build}
"sedlex" {< "2.0"}
"ppx_tools_versioned" {= "5.2"}
"wtf8"
]
dev-repo: "git+https://github.com/facebook/flow.git"
synopsis: "The Flow parser is a JavaScript parser written in OCaml"
description: """
It produces an AST that conforms to ESTree. The Flow Parser can be compiled to native code or can be compiled to JavaScript using js_of_ocaml.
To find out more about Flow, check out <https://flow.org>."""
flags: light-uninstall
url {
src: "NEW ARCHIVE"
checksum: "md5=..."
}
Note that instead of using only make ocamlfind-install I splitted it in two parts, by using make ocamlfind-build for the build part (feel free to rename that make task, it doesn't fit really well.)
And now src/parser/Makefile also has to be modified to change the used tasks. It currently contains
ocamlfind-install:
cd $(TOP); \
$(OCB) $(REL_DIR)/parser_flow.cma $(REL_DIR)/parser_flow.cmxa; \
ocamlfind install flow_parser $(REL_DIR)/META \
_build/$(REL_DIR)/parser_flow.a \
_build/$(REL_DIR)/parser_flow.cma \
_build/$(REL_DIR)/parser_flow.cmxa \
_build/$(REL_DIR)/*.cmi
that should be changed into
ocamlfind-build:
cd $(TOP); \
$(OCB) $(REL_DIR)/parser_flow.cma $(REL_DIR)/parser_flow.cmxa
ocamlfind-install:
cd $(TOP); \
ocamlfind install flow_parser $(REL_DIR)/META \
_build/$(REL_DIR)/parser_flow.a \
_build/$(REL_DIR)/parser_flow.cma \
_build/$(REL_DIR)/parser_flow.cmxa \
_build/$(REL_DIR)/*.cmi
I think that's it 馃槃
Any update here ? :)
Anyone has made it work ?
Most helpful comment
No. It seems that it's a restriction from opam, I solve it by execute
make ocamlfind-installinstall by myself.