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

pgocaml 4.0 support? #8

Closed
swuecho opened this issue Dec 9, 2019 · 10 comments
Closed

pgocaml 4.0 support? #8

swuecho opened this issue Dec 9, 2019 · 10 comments

Comments

@swuecho
Copy link

swuecho commented Dec 9, 2019

### output ###
#       ocamlc ppx/.ppx_pgsql.objs/byte/ppx_pgsql.{cmi,cmo,cmt} (exit 2)
# (cd _build/default && /Users/hwu/.opam/4.08.1/bin/ocamlc.opt -w -40 -safe-string -g -bin-annot -I ppx/.ppx_pgsql.objs/byte -I /Users/hwu/.opam/4.08.1/lib/base -I /Users/hwu/.opam/4.08.1/lib/base/base_internalhash_types -I /Users/hwu/.opam/4.08.1/lib/base/caml -I /Users/hwu/.opam/4.08.1/lib/base/shadow_stdlib -I /Users/hwu/.opam/4.08.1/lib/bigarray-compat -I /Users/hwu/.opam/4.08.1/lib/bytes -[...]
# File "ppx/ppx_pgsql.ml", line 40, characters 4-24:
# 40 |     PGOCaml.name_of_type ?modifier oid
#          ^^^^^^^^^^^^^^^^^^^^
# Error: This function has type PGOCaml.oid -> string
#        It is applied to too many arguments; maybe you forgot a `;'.
@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

@swuecho my ocaml install is a bit broken at the moment so I cannot try the fix, but I see the ?modifier parameter is gone from that function, I think that removing all 3 references to that parameter in the name_of_type function in ppx/ppx_pgsql.ml (line 38) should do the trick.

Can you give that a try? If that works I will update the code (or you can submit a PR with that change if you want).

@swuecho
Copy link
Author

swuecho commented Dec 9, 2019

@tizoc thanks for quick reply. I changed the modifier, but there are other problem.

### output ###
# 163 |         Re.get subs 3, Re.test subs 1, Re.test subs 2 in
# [...]
# Alert deprecated: Re.test
# Use Group.test
# File "ppx/ppx_pgsql.ml", line 163, characters 39-46:
# 163 |         Re.get subs 3, Re.test subs 1, Re.test subs 2 in
#                                              ^^^^^^^
# Alert deprecated: Re.test
# Use Group.test
# File "ppx/ppx_pgsql.ml", line 189, characters 30-67:
# 189 |          let to_string_func = [%expr PGOCaml.([%e to_string_func])] in
#                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Error: Unbound record field pexp_loc_stack

@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

I see. I think it is related to ocaml-ppx/ppx_tools#77 and ocaml-ppx/ppx_tools#75

One of those has been fixed, the other is still open but someone failed to reproduce the problem. Is your ppx_tools package up to date?

@swuecho
Copy link
Author

swuecho commented Dec 9, 2019

my ocaml version is 4.08.1.

$ opam install ppx_tools    
[NOTE] Package ppx_tools is already installed (current version is 5.3+4.08.0).

same with bug reporter in ocaml-ppx/ppx_tools#77. I will create a 4.09 switch.

@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

I'm fixing my ocaml install, should be able to test this stuff soon.

@swuecho
Copy link
Author

swuecho commented Dec 9, 2019

4.09 same problem.

tried the code in #77 in 4.08.1, works fine.

ocamlc -c -ppx ~/.opam/4.08.1/lib/ppx_tools/ppx_metaquot a.ml -I +compiler-libs -dsource
let x =
{
Parsetree.pexp_desc =
(Parsetree.Pexp_constant (Parsetree.Pconst_string ("test", None)));
Parsetree.pexp_loc = (Stdlib.(!) Ast_helper.default_loc);
Parsetree.pexp_loc_stack = [];
Parsetree.pexp_attributes = []
}

maybe another bug in ppx_tools? I wish I know more ppx to understand what is going on.

@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

@swuecho I think I fixed it, will commit it in a bit

@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

@swuecho pushed, upgrade and see if it works for you

@swuecho
Copy link
Author

swuecho commented Dec 9, 2019

work! thanks

@tizoc
Copy link
Owner

tizoc commented Dec 9, 2019

Fixed in b94132f and eb99803

Closing.

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