My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge opam/patches/ocaml-compiler-libs

+345
+4
vendor/opam/ocaml-compiler-libs/.gitignore
··· 1 + _build 2 + *.install 3 + *.merlin 4 +
+10
vendor/opam/ocaml-compiler-libs/CHANGES.md
··· 1 + v0.12.3 2 + ------- 3 + 4 + - Update opam file 5 + 6 + v0.12.2 7 + ------- 8 + 9 + - Fix deprecation messages in `Ocaml_shadow` (fixes #7, 10 + @jeremiedimino)
+66
vendor/opam/ocaml-compiler-libs/CONTRIBUTING.md
··· 1 + This repository contains open source software that is developed and 2 + maintained by [Jane Street][js]. 3 + 4 + Contributions to this project are welcome and should be submitted via 5 + GitHub pull requests. 6 + 7 + Signing contributions 8 + --------------------- 9 + 10 + We require that you sign your contributions. Your signature certifies 11 + that you wrote the patch or otherwise have the right to pass it on as 12 + an open-source patch. The rules are pretty simple: if you can certify 13 + the below (from [developercertificate.org][dco]): 14 + 15 + ``` 16 + Developer Certificate of Origin 17 + Version 1.1 18 + 19 + Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 20 + 1 Letterman Drive 21 + Suite D4700 22 + San Francisco, CA, 94129 23 + 24 + Everyone is permitted to copy and distribute verbatim copies of this 25 + license document, but changing it is not allowed. 26 + 27 + 28 + Developer's Certificate of Origin 1.1 29 + 30 + By making a contribution to this project, I certify that: 31 + 32 + (a) The contribution was created in whole or in part by me and I 33 + have the right to submit it under the open source license 34 + indicated in the file; or 35 + 36 + (b) The contribution is based upon previous work that, to the best 37 + of my knowledge, is covered under an appropriate open source 38 + license and I have the right under that license to submit that 39 + work with modifications, whether created in whole or in part 40 + by me, under the same open source license (unless I am 41 + permitted to submit under a different license), as indicated 42 + in the file; or 43 + 44 + (c) The contribution was provided directly to me by some other 45 + person who certified (a), (b) or (c) and I have not modified 46 + it. 47 + 48 + (d) I understand and agree that this project and the contribution 49 + are public and that a record of the contribution (including all 50 + personal information I submit with it, including my sign-off) is 51 + maintained indefinitely and may be redistributed consistent with 52 + this project or the open source license(s) involved. 53 + ``` 54 + 55 + Then you just add a line to every git commit message: 56 + 57 + ``` 58 + Signed-off-by: Joe Smith <joe.smith@email.com> 59 + ``` 60 + 61 + Use your real name (sorry, no pseudonyms or anonymous contributions.) 62 + 63 + If you set your `user.name` and `user.email` git configs, you can sign 64 + your commit automatically with git commit -s. 65 + 66 + [dco]: http://developercertificate.org/
+21
vendor/opam/ocaml-compiler-libs/LICENSE.md
··· 1 + The MIT License 2 + 3 + Copyright (c) 2017--2018 Jane Street Group, LLC <opensource@janestreet.com> 4 + 5 + Permission is hereby granted, free of charge, to any person obtaining a copy 6 + of this software and associated documentation files (the "Software"), to deal 7 + in the Software without restriction, including without limitation the rights 8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 + copies of the Software, and to permit persons to whom the Software is 10 + furnished to do so, subject to the following conditions: 11 + 12 + The above copyright notice and this permission notice shall be included in all 13 + copies or substantial portions of the Software. 14 + 15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 + SOFTWARE.
+17
vendor/opam/ocaml-compiler-libs/Makefile
··· 1 + INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) 2 + 3 + default: 4 + dune build 5 + 6 + install: 7 + dune install $(INSTALL_ARGS) 8 + 9 + uninstall: 10 + dune uninstall $(INSTALL_ARGS) 11 + 12 + reinstall: uninstall install 13 + 14 + clean: 15 + dune clean 16 + 17 + .PHONY: default install uninstall reinstall clean
+9
vendor/opam/ocaml-compiler-libs/README.org
··· 1 + * OCAML-COMPILER-LIBS 2 + 3 + This package simply repackage the OCaml compiler libraries so they 4 + don't expose everything at toplevel. For instance =Ast_helper= is now 5 + =Ocaml_common.Ast_helper=. 6 + 7 + The special library =ocaml_shadow= add a deprecation warning on all 8 + modules from the compiler libraries, to force the user to use the 9 + prefixed names.
+2
vendor/opam/ocaml-compiler-libs/dune-project
··· 1 + (lang dune 1.0) 2 + (name ocaml-compiler-libs)
+20
vendor/opam/ocaml-compiler-libs/ocaml-compiler-libs.opam
··· 1 + opam-version: "2.0" 2 + maintainer: "opensource@janestreet.com" 3 + authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] 4 + homepage: "https://github.com/janestreet/ocaml-compiler-libs" 5 + bug-reports: "https://github.com/janestreet/ocaml-compiler-libs/issues" 6 + dev-repo: "git+https://github.com/janestreet/ocaml-compiler-libs.git" 7 + license: "MIT" 8 + build: [ 9 + ["dune" "build" "-p" name "-j" jobs] 10 + ] 11 + depends: [ 12 + "ocaml" {>= "5.2.0"} 13 + "dune" {>= "1.5.1"} 14 + ] 15 + synopsis: """OCaml compiler libraries repackaged""" 16 + description: """ 17 + 18 + This packages exposes the OCaml compiler libraries repackages under 19 + the toplevel names Ocaml_common, Ocaml_bytecomp, Ocaml_optcomp, ... 20 + """
+5
vendor/opam/ocaml-compiler-libs/src/gen/dune
··· 1 + (executables 2 + (names gen) 3 + (flags :standard -safe-string) 4 + (libraries read_cma) 5 + (preprocess no_preprocessing))
+30
vendor/opam/ocaml-compiler-libs/src/gen/gen.ml
··· 1 + (* Note: this file is very similar to the one in Base for building the Caml 2 + library. However the Caml library should once this is merged: 3 + 4 + https://github.com/ocaml/ocaml/pull/1010 5 + 6 + It's going to be hard to do this for compiler-libs as it is a big breaking change. So 7 + we expect the gen.ml file in Base to go soon and this file to stay for longer. 8 + *) 9 + 10 + open StdLabels 11 + 12 + let () = 13 + let archive_fn, oc = 14 + match Sys.argv with 15 + | [|_; "-archive"; archive_fn; "-o"; fn|] -> 16 + (archive_fn, open_out fn) 17 + | _ -> 18 + failwith "bad command line arguments" 19 + in 20 + 21 + let units = Read_cma.units archive_fn in 22 + 23 + let pr fmt = Printf.fprintf oc (fmt ^^ "\n") in 24 + pr "(* This file is automatically generated *)"; 25 + pr ""; 26 + let max_len = 27 + List.fold_left units ~init:0 ~f:(fun acc unit -> 28 + max acc (String.length unit)) 29 + in 30 + List.iter units ~f:(fun u -> pr "module %-*s = %s" max_len u u);
+14
vendor/opam/ocaml-compiler-libs/src/ocaml_bytecomp/dune
··· 1 + (library 2 + (name ocaml_bytecomp) 3 + (public_name ocaml-compiler-libs.bytecomp) 4 + (flags :standard -safe-string) 5 + (libraries compiler-libs.bytecomp) 6 + (preprocess no_preprocessing)) 7 + 8 + (rule 9 + (targets ocaml_bytecomp.ml) 10 + (deps 11 + (:first_dep ../gen/gen.exe)) 12 + (action 13 + (run %{first_dep} -archive %{ocaml_where}/compiler-libs/ocamlbytecomp.cma -o 14 + %{targets})))
+14
vendor/opam/ocaml-compiler-libs/src/ocaml_common/dune
··· 1 + (library 2 + (name ocaml_common) 3 + (public_name ocaml-compiler-libs.common) 4 + (flags :standard -safe-string) 5 + (libraries compiler-libs.common) 6 + (preprocess no_preprocessing)) 7 + 8 + (rule 9 + (targets ocaml_common.ml) 10 + (deps 11 + (:first_dep ../gen/gen.exe)) 12 + (action 13 + (run %{first_dep} -archive %{ocaml_where}/compiler-libs/ocamlcommon.cma -o 14 + %{targets})))
+15
vendor/opam/ocaml-compiler-libs/src/ocaml_optcomp/dune
··· 1 + (library 2 + (name ocaml_optcomp) 3 + (public_name ocaml-compiler-libs.optcomp) 4 + (flags :standard -safe-string) 5 + (optional) 6 + (libraries compiler-libs.optcomp) 7 + (preprocess no_preprocessing)) 8 + 9 + (rule 10 + (targets ocaml_optcomp.ml) 11 + (deps 12 + (:first_dep ../gen/gen.exe)) 13 + (action 14 + (run %{first_dep} -archive %{ocaml_where}/compiler-libs/ocamloptcomp.cma -o 15 + %{targets})))
+14
vendor/opam/ocaml-compiler-libs/src/ocaml_toplevel/dune
··· 1 + (library 2 + (name ocaml_toplevel) 3 + (public_name ocaml-compiler-libs.toplevel) 4 + (flags :standard -safe-string) 5 + (libraries compiler-libs.toplevel) 6 + (preprocess no_preprocessing)) 7 + 8 + (rule 9 + (targets ocaml_toplevel.ml) 10 + (deps 11 + (:first_dep ../gen/gen.exe)) 12 + (action 13 + (run %{first_dep} -archive %{ocaml_where}/compiler-libs/ocamltoplevel.cma -o 14 + %{targets})))
+5
vendor/opam/ocaml-compiler-libs/src/read_cma/dune
··· 1 + (library 2 + (name read_cma) 3 + (flags :standard -safe-string) 4 + (libraries compiler-libs.common compiler-libs.bytecomp) 5 + (preprocess no_preprocessing))
+17
vendor/opam/ocaml-compiler-libs/src/read_cma/read_cma.ml
··· 1 + open StdLabels 2 + 3 + let compunit_name Cmo_format.{ cu_name = Compunit name ; _ } = name 4 + 5 + let units fn = 6 + (* The cma format is documented in typing/cmo_format.mli in the compiler sources *) 7 + let ic = open_in_bin fn in 8 + let len_magic_number = String.length Config.cma_magic_number in 9 + let magic_number = really_input_string ic len_magic_number in 10 + assert (magic_number = Config.cma_magic_number); 11 + let toc_pos = input_binary_int ic in 12 + seek_in ic toc_pos; 13 + let toc = (input_value ic : Cmo_format.library) in 14 + close_in ic; 15 + 16 + List.map toc.lib_units ~f:compunit_name 17 + |> List.sort ~cmp:String.compare
+1
vendor/opam/ocaml-compiler-libs/src/read_cma/read_cma.mli
··· 1 + val units : string -> string list
+15
vendor/opam/ocaml-compiler-libs/src/shadow/dune
··· 1 + (library 2 + (name ocaml_shadow) 3 + (public_name ocaml-compiler-libs.shadow) 4 + (flags 5 + (:standard -safe-string) 6 + -w 7 + -49) 8 + (preprocess no_preprocessing)) 9 + 10 + (rule 11 + (targets ocaml_shadow.ml) 12 + (deps 13 + (:first_dep gen/gen.exe)) 14 + (action 15 + (run %{first_dep} -dir %{ocaml_where}/compiler-libs -o %{targets})))
+5
vendor/opam/ocaml-compiler-libs/src/shadow/gen/dune
··· 1 + (executables 2 + (names gen) 3 + (flags :standard -safe-string) 4 + (libraries read_cma) 5 + (preprocess no_preprocessing))
+61
vendor/opam/ocaml-compiler-libs/src/shadow/gen/gen.ml
··· 1 + module List = ListLabels 2 + open MoreLabels 3 + 4 + module Smap = Map.Make(String) 5 + 6 + let () = 7 + let dir, oc = 8 + match Sys.argv with 9 + | [|_; "-dir"; dir; "-o"; fn|] -> 10 + (dir, open_out fn) 11 + | _ -> 12 + failwith "bad command line arguments" 13 + in 14 + 15 + let files = 16 + Sys.readdir dir 17 + |> Array.to_list 18 + |> List.sort ~cmp:String.compare 19 + in 20 + 21 + let all_exposed_modules = 22 + List.filter files ~f:(fun fn -> Filename.check_suffix fn ".cmi") 23 + |> List.map ~f:(fun fn -> String.capitalize_ascii (Filename.chop_extension fn)) 24 + in 25 + 26 + let module_to_lib = 27 + List.filter files ~f:(fun fn -> Filename.check_suffix fn ".cma") 28 + |> List.fold_left ~init:Smap.empty ~f:(fun acc fn -> 29 + let lib_mod = 30 + try 31 + Scanf.sscanf fn "ocaml%s.cma" (fun s -> "Ocaml_" ^ s) 32 + with _ -> 33 + String.capitalize_ascii (Filename.chop_extension fn) 34 + in 35 + let units = Read_cma.units (Filename.concat dir fn) in 36 + List.fold_left units ~init:acc ~f:(fun acc unit -> 37 + Smap.add acc ~key:unit ~data:lib_mod)) 38 + in 39 + 40 + (* If we keep the alias, we can't use -linkall... *) 41 + Printf.fprintf oc "module Do_not_use_directly = struct end\n"; 42 + List.sort all_exposed_modules ~cmp:String.compare 43 + |> List.iter ~f:(fun m -> 44 + let repl = 45 + match Smap.find m module_to_lib with 46 + | lib -> 47 + let lib = 48 + let prefix = "Ocaml" in 49 + let prefix_len = String.length prefix in 50 + let lib_len = String.length lib in 51 + if lib_len >= prefix_len && String.sub lib 0 prefix_len = prefix then 52 + prefix ^ "_" ^ String.sub lib prefix_len (lib_len - prefix_len) 53 + else 54 + lib 55 + in 56 + Printf.sprintf ", use %s.%s instead" lib m 57 + | exception Not_found -> "" 58 + in 59 + Printf.fprintf oc 60 + "module %s = Do_not_use_directly [@@deprecated \"Accessing this module directly is deprecated%s\"]\n" 61 + m repl)