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

Module name clash #101

Closed
rdavison opened this issue Jun 5, 2020 · 1 comment · Fixed by #103
Closed

Module name clash #101

rdavison opened this issue Jun 5, 2020 · 1 comment · Fixed by #103
Assignees
Labels
Milestone

Comments

@rdavison
Copy link

rdavison commented Jun 5, 2020

It looks like the (wrapped false) setting in pgx/src/dune is causing me some problem when using Pgx in a local project.

Some environment information:

  • esy-0.6.4
  • dune-2.5.1
  • ocaml-4.09.1

Error message:

$ esy dune build @all
Entering directory '/home/richard/code/project'
File "_none_", line 1:
Error: Files /home/richard/.esy/3__________________________________________________________________/i/ocaml-4.9.1000-ffe51dac/lib/ocaml/compiler-libs/ocamlcommon.cmxa
       and /home/richard/.esy/3__________________________________________________________________/i/opam__s__pgx-opam__c__1.0-1d851550/lib/pgx/pgx.cmxa
       both define a module named Types

Diagnosis:

$ esy ls-modules | grep -A4 -B9 Types
info ls-modules 0.6.4 (using esy.json) found project at ~/code/project/
├── @opam/pgx@opam:1.0 [built]
│   └── pgx
│       ├── Pgx
│       ├── Io_intf
│       ├── Pgx_intf
│       ├── Isolation
│       ├── Access
│       ├── Result_desc
│       ├── Row_desc
│       ├── Types
│       ├── Pgx_value_intf
│       ├── Pgx_value
│       ├── Error_response
│       └── Pgx_aux

It looks like some internal library in the compiler defines and exports a Types module, and so does Pgx. When I checked the Dune documentation, I saw that (wrapped false) is discouraged, but if you do want to use it, they recommend prefixing all the modules in your library manually.

@brendanlong
Copy link
Contributor

Thanks for bring this up. This is definitely a mistake and that module shouldn't be exported.

@brendanlong brendanlong self-assigned this Jun 23, 2020
brendanlong added a commit that referenced this issue Jun 23, 2020
This makes us only expose the Pgx module at top-level.

Most of this stuff was never intended to be used directly, so the only
major change is that Pgx_value now _must_ be referenced as Pgx.Value.

Fixes #101
@brendanlong brendanlong added this to the 2.0 milestone Jun 23, 2020
brendanlong added a commit that referenced this issue Jun 23, 2020
This makes us only expose the Pgx module at top-level.

Most of this stuff was never intended to be used directly, so the only
major change is that Pgx_value now _must_ be referenced as Pgx.Value.

Fixes #101
brendanlong added a commit that referenced this issue Jun 23, 2020
This makes us only expose the Pgx module at top-level.

Most of this stuff was never intended to be used directly, so the only
major change is that Pgx_value now _must_ be referenced as Pgx.Value.

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

Successfully merging a pull request may close this issue.

2 participants