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

obazl v2 migration: c apis #12

Open
mobileink opened this issue Oct 5, 2021 · 2 comments
Open

obazl v2 migration: c apis #12

mobileink opened this issue Oct 5, 2021 · 2 comments

Comments

@mobileink
Copy link
Collaborator

The standard FFI included in the standard distribution: @ocaml//ffi

Some packages (e.g. ctypes) export both OCaml files and a C api (headers). The (tentative) naming convention is:

  • @pkg//:pkg for the Ocaml target
  • @pkg//:libpkg for the C api.

For multi-segment pkg names:

  • @seg1//seg2/seg3
  • @seg1//seg2/seg3:libseg1_seg2_seg3

For example: @ctypes//:ctypes and @ctypes//:libctypes. OCaml rules can depend on the former; cc_* rules on the latter.

  • ctypes.stubs => @ctypes//stubs and @ctypes//stubs:libctypes_stubs

This may change. libctypes_stubs is a little clunky. Other options:

  • @ctypes//stubs:hdrs
  • @ctypes//stubs:c
  • @ctypes//stubs:c-api
  • @ctypes/stubs:csdk
  • etc.

Or even:

  • @ctypes//lib
  • @ctypes//lib:stubs
  • etc.
@tek
Copy link
Member

tek commented Oct 5, 2021

outstanding!

@mobileink
Copy link
Collaborator Author

FYI I went ahead and implemented support for pseudo-packages. So for example we have both

  • @threads//:threads (the pseudo-package)
  • @ocaml//threads

Both targets are just aliases to @ocaml.threads//:threads.

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

No branches or pull requests

2 participants