Skip to content

Commit

Permalink
the start of the package
Browse files Browse the repository at this point in the history
  • Loading branch information
ivg committed Nov 6, 2020
0 parents commit 6989100
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_build
*.install
*.merlin
_opam

22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License

Copyright (c) 2016--2020 Jane Street Group, LLC <[email protected]>
Copyright (c) 2020 Carnegie Mellon University

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)

default:
dune build

install:
dune install $(INSTALL_ARGS)

uninstall:
dune uninstall $(INSTALL_ARGS)

reinstall: uninstall install

clean:
dune clean

.PHONY: default install uninstall reinstall clean
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The set of ppx rewriters for BAP

Provides a BAP-specific ppx rewriter that includes only the blessed set of rewriters that are needed to build and use bap projects. In the future, we may even add our own more specialized rewriters. This package is used by BAP and by BAP plugins via the `bapbuild` tool.

# Adding a new rewriter

The way how ppx rewriters work, unfortuntely, precludes us from adding a new rewriter to a downstream package, e.g., by adding a new dependency directly to the build configuration of a plugin that needs an extra rewriter. Therefore, if a new rewriter is need it has to go through the blessing process and get included into this package. This might change in the future, if we will switch to the dune build system that has a mechanism to build a preprocessor from the specified set of rewriters during the build (essentially this package). Until this, the pull requests are welcome. Just go to the [src/dune](src/dune) file and add the needed rewriter into the `library` stanza.

# Legacy

This project is a mere copy of the `ppx_jane`/`ppx_base` projects with the set of rewriters amended to our needs. E.g., we exclude the js_style rewriter that is not compatible with the code generated by ocamlfind or piqi. We also excluded some other rewriters that we are not using, to speed up the build process and make our code base more reliable.
4 changes: 4 additions & 0 deletions bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(executables (names main) (libraries ppx_bap ppxlib) (link_flags -linkall)
(preprocess no_preprocessing))

(install (section bin) (files (main.exe as ppx-bap)))
1 change: 1 addition & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Ppxlib.Driver.standalone ()
Empty file added dune
Empty file.
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 1.10)
35 changes: 35 additions & 0 deletions ppx_bap.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
opam-version: "2.0"
maintainer: "[email protected]"
authors: ["Carnegie Mellon University BAP Team"]
homepage: "https://github.com/BinaryAnalysisPlatform/ppx_bap"
bug-reports: "https://github.com/BinaryAnalysisPlatform/ppx_bap/issues"
dev-repo: "git+https://github.com/BinaryAnalysisPlatform/ppx_bap.git"
license: "MIT"
build: [
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml" {>= "4.07.0"}
"base_quickcheck"
"ppx_assert"
"ppx_bench"
"ppx_bin_prot"
"ppx_cold"
"ppx_compare"
"ppx_enumerate"
"ppx_fields_conv"
"ppx_hash"
"ppx_here"
"ppx_optcomp"
"ppx_sexp_conv"
"ppx_sexp_value"
"ppx_variants_conv"
"dune" {>= "2.0.0"}
"ppxlib" {>= "0.15.0"}
]
synopsis: "The set of ppx rewriters for BAP"
description: "
ppx_bap is the set of blessed ppx rewriters used in BAP projects.
It fills the same role as ppx_base or ppx_jane (from which it is derived),
but doesn't impose any style requirements and has only the minimal necessary
set of rewriters."
8 changes: 8 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(library
(name ppx_bap)
(public_name ppx_bap)
(kind ppx_rewriter)
(libraries ppxlib ppx_sexp_conv ppx_sexp_value ppx_compare ppx_enumerate
ppx_hash ppx_assert ppx_bench ppx_bin_prot ppx_fields_conv
ppx_here ppx_variants_conv ppx_optcomp)
(preprocess no_preprocessing))

0 comments on commit 6989100

Please sign in to comment.