I'm unable to use pprint library using melange. #1088
-
Hi, I'm building a simple single-stepper for a small ocaml-like programming language at https://github.com/tonyfettes/stepper It use melange to compile OCaml & reason code to JS and using ReasonReact with Preact. However, I'm unable to use PPrint as a dependencies to pretty-printing the AST (located at lib/syntax.ml), and it reported an error looks like this: $ esy dune build
File "/Users/tonyfettes/.esy/3_______________________________________________________________/i/opam__s__pprint-opam__c__20230830-b72f018f/lib/pprint/dune-package", line 26, characters 0-521:
26 | (library
27 | (name pprint)
28 | (kind normal)
....
43 | (path PPrintEngine)
44 | (intf (path PPrintEngine.mli))
45 | (impl (path PPrintEngine.ml)))))))
Error: File unavailable:
/Users/tonyfettes/.esy/3_______________________________________________________________/i/opam__s__pprint-opam__c__20230830-b72f018f/lib/pprint/melange/pPrint.cmj
-> required by _build/default/web/output/node_modules/pprint/PPrint.js
-> required by alias web/all
-> required by alias default
File "/Users/tonyfettes/.esy/3_______________________________________________________________/i/opam__s__pprint-opam__c__20230830-b72f018f/lib/pprint/dune-package", line 26, characters 0-521:
26 | (library
27 | (name pprint)
28 | (kind normal)
....
43 | (path PPrintEngine)
44 | (intf (path PPrintEngine.mli))
45 | (impl (path PPrintEngine.ml)))))))
Error: File unavailable:
/Users/tonyfettes/.esy/3_______________________________________________________________/i/opam__s__pprint-opam__c__20230830-b72f018f/lib/pprint/melange/pPrintEngine.cmj
-> required by _build/default/web/output/node_modules/pprint/PPrintEngine.js
-> required by alias web/all
-> required by alias default I don't know which is a better repository to report (the pprint one or this one), so I just choose to post it here. Is there anyway I can approach to this issue? Thanks in advance! Steps to reproduce# clone my repo
git clone http://github.com/tonyfettes/stepper.git stepper
cd stepper
# checkout the reproduce branch
git switch melange-pprint-reproduce
# install esy
esy install
esy
esy dune build |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After some digging and reading dune's document on melange here, I believe this is not possible without modifying the pprint library or vendor it in my source repository. I'll leave this open for some days to see if I or anyone can have better ideas on how to deal with it. |
Beta Was this translation helpful? Give feedback.
After some digging and reading dune's document on melange here, I believe this is not possible without modifying the pprint library or vendor it in my source repository. I'll leave this open for some days to see if I or anyone can have better ideas on how to deal with it.