You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
single segment: @pkg//:pkg. E.g. ounit2 => @ounit2//:ounit2
multiple segments: seg1.seg2.seg3 => @seg1//seg2/seg3. E.g. ptime.clock.os => @ptime//clock/os
Special cases: the OPAM repo contains a handful of "pseudo-packages", which are effectively aliases for files included in the standard OCaml distribution. In OPAM switches these packages contain nothing but a META file that defines a package (and possibly subpackages) whose content properties point to the OCaml standard lib (which is $OPAM_SWITCH_PREFIX/lib/ocaml). I think they're retained for backward compatibility.
In OBazl we do not need such pseudo-packages; we just (pre)define targets in the @ocaml namespace. For example, instead of dynlink => @dynlink//:dynlink we have @ocaml//dynlink. This means that such "packages" cannot be overridden using e.g. --override_repository, but that should not be a problem; since they are included in the core distribution, devs should have no reason to override them.
So a conversion tool needs to special-case these mappings:
Threads are slightly more complicated. Historically we had threads.posix and threads.vm; now there is just `threads.
threads.posix => @ocaml//threads
threads.vm => @ocaml//threads (the vmthreads code no longer exists)
Note that these targets within the @ocaml namespace do not necessarily correspond to subdirectories in the opam switch. In fact most of them are aliased to separate repos. For example, the compiler-lib targets alias to @ocaml.compiler-libs. The intention is that the @ocaml labels provide a simple, uniform, idiomatic user interface, that does not use '.' in repo names. The repos they alias to include links, which makes globbing more straightforward. This is needed because each ocaml_import target needs to glob all the deps of the main (archive) files it provides.
The text was updated successfully, but these errors were encountered:
Mapping from opam pkg labels to bazel labels:
single segment:
@pkg//:pkg
. E.g.ounit2
=>@ounit2//:ounit2
multiple segments:
seg1.seg2.seg3
=>@seg1//seg2/seg3
. E.g.ptime.clock.os
=>@ptime//clock/os
Special cases: the OPAM repo contains a handful of "pseudo-packages", which are effectively aliases for files included in the standard OCaml distribution. In OPAM switches these packages contain nothing but a META file that defines a package (and possibly subpackages) whose content properties point to the OCaml standard lib (which is
$OPAM_SWITCH_PREFIX/lib/ocaml
). I think they're retained for backward compatibility.In OBazl we do not need such pseudo-packages; we just (pre)define targets in the
@ocaml
namespace. For example, instead ofdynlink
=>@dynlink//:dynlink
we have@ocaml//dynlink
. This means that such "packages" cannot be overridden using e.g.--override_repository
, but that should not be a problem; since they are included in the core distribution, devs should have no reason to override them.So a conversion tool needs to special-case these mappings:
bigarray
=>@ocaml//bigarray
compiler-libs
=>@ocaml//compiler-libs
compiler-libs.common
=>@ocaml//compiler-libs/common
compiler-libs.bytecomp
=>@ocaml//compiler-libs/bytecomp
compiler-libs.optcomp
=>@ocaml//compiler-libs/optcomp
compiler-libs.toplevel
=>@ocaml//compiler-libs/toplevel
compiler-libs.native-toplevel
=>@ocaml//compiler-libs/native-toplevel
dynlink
=>@ocaml//dynlink
str
=>@ocaml//str
unix
=>@ocaml//unix
Threads are slightly more complicated. Historically we had
threads.posix
andthreads.vm
; now there is just `threads.threads.posix
=>@ocaml//threads
threads.vm
=>@ocaml//threads
(the vmthreads code no longer exists)Note that these targets within the
@ocaml
namespace do not necessarily correspond to subdirectories in the opam switch. In fact most of them are aliased to separate repos. For example, thecompiler-lib
targets alias to@ocaml.compiler-libs
. The intention is that the@ocaml
labels provide a simple, uniform, idiomatic user interface, that does not use '.' in repo names. The repos they alias to include links, which makes globbing more straightforward. This is needed because eachocaml_import
target needs to glob all the deps of the main (archive) files it provides.The text was updated successfully, but these errors were encountered: