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

Ast mapper version is not compat with bs-platform v6 #77

Open
Coobaha opened this issue Apr 13, 2019 · 8 comments
Open

Ast mapper version is not compat with bs-platform v6 #77

Coobaha opened this issue Apr 13, 2019 · 8 comments

Comments

@Coobaha
Copy link

Coobaha commented Apr 13, 2019

Hi @mhallin,

I've tried to use new bs-platform and it's not compat with graphql_ppx

bsb output is

Failure("Ast_mapper: OCaml version mismatch or malformed input")
File "~/demo/src/Demo.re", line 1:
Error: Error while running external preprocessor
Command line: ~/demo/node_modules/graphql_ppx/ppx '/var/folders/7_/7cxq24hd50vdm4xvrwjl959wx8xlpw/T/camlppxc7a198' '/var/folders/7_/7cxq24hd50vdm4xvrwjl959wx8xlpw/T/camlppx72e796'

My package.json

  "devDependencies": {
    "bs-platform": "6.0.0"
  },
  "dependencies": {
    "graphql_ppx": "^0.2.8"
  }
@baransu
Copy link
Contributor

baransu commented Apr 13, 2019

https://github.com/mhallin/graphql_ppx/blob/master/src/bucklescript/graphql_ppx.ml#L1-L2

We're doing this conversion to downgrade to 402. I'm wondering if it's a matter of dropping it or changing to OCaml_406

@baransu
Copy link
Contributor

baransu commented Apr 13, 2019

Ok. It's not that simple 😄

@anmonteiro
Copy link
Contributor

It looks to me as though no code changes are necessary. The executable probably just needs to be compiled against OCaml 4.06. It's using OCaml-migrate-parsetree so it should just work.

@anmonteiro
Copy link
Contributor

I just verified my assumption that no code changes are necessary.

I built the PPX with OCaml 4.06 and copied the binary to my node_modules in a project that depends on BuckleScript 6.X.

graphql_ppx works as expected in such scenario.

@baransu
Copy link
Contributor

baransu commented Apr 19, 2019

@anmonteiro DO you think there is a sane way to have both 5.X and 6.X support? From what I tested when compiling with OCaml 4.06 it fails with 5.X. I assume we have to switch in CI and build two versions of every binary for both 5.X and 6.X.

@anmonteiro
Copy link
Contributor

@baransu yeah, we are always going to need 2 binaries. The best alternative I see is to do what I recently did for the ReasonReact repo (reasonml/reason-react#392) and use 2 esy files, one for each version of the OCaml compiler

@baransu
Copy link
Contributor

baransu commented Apr 19, 2019

@anmonteiro That's nice. Thanks!

@aantron
Copy link

aantron commented Jan 31, 2020

It's possible to have one binary. I am doing that in Bisect_ppx, using a patched ocaml-migrate-parsetree (which I should probably just release).

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

4 participants