Skip to content
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

Fix Dune warnings on pesy preprocessors config. #145

Open
jordwalke opened this issue May 12, 2020 · 2 comments
Open

Fix Dune warnings on pesy preprocessors config. #145

jordwalke opened this issue May 12, 2020 · 2 comments

Comments

@jordwalke
Copy link
Member

If you specify a preprocessor, now recent Dune will complain that the generated .merlin is not accurate (that's fine).
Solution: apply the same preprocessor config to the pesy-modules library as well.

Discussed Here

The warning makes sense in the general case, but it can be fixed by making sure that even the pesy-modules has the same ppx applied to it.

Currently if you have:

"library": {
  "imports": [
    "Console = require('console/lib')",
    "React = require('static-react')"
  ],
  "preprocess": ["pps", "static-react.reactjs_jsx_ppx"]
},

The generated Dune will be:

(library (name AppLibrary) (public_name app.library)
    (modules (:standard \ AppLibraryPesyModules))
    (libraries app.library.pesy-modules)
    (flags -open AppLibraryPesyModules)
    (preprocess (pps static-react.reactjs_jsx_ppx)))
(library (public_name app.library.pesy-modules)
    (name AppLibraryPesyModules) (modules AppLibraryPesyModules)
    (libraries console.lib static-react))
(rule
    (with-stdout-to AppLibraryPesyModules.re
        (run echo  "module Console = Console;\
                  \nmodule React = StaticReact;")))

And Dune complains because it needs everything in a directory to have the same ppx config.

The solution is easy it seems: pesy should just make sure to add the same (preprocess) spec to the pesy-modules segment as well.

@ulrikstrid
Copy link
Contributor

I thought this was fixed here #83

@jordwalke
Copy link
Member Author

Maybe my pesy is out of date!? Let me check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants