Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/facebook/ocamlrep
Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust
https://github.com/facebook/ocamlrep
Last synced: 2 months ago
JSON representation
Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust
- Host: GitHub
- URL: https://github.com/facebook/ocamlrep
- Owner: facebook
- License: mit
- Created: 2022-12-13T17:05:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-09T19:46:35.000Z (8 months ago)
- Last Synced: 2024-04-12T08:46:36.408Z (8 months ago)
- Language: Rust
- Homepage:
- Size: 4.81 MB
- Stars: 120
- Watchers: 18
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README-BUCK.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-buck2 - OcamlRep
README
# Building ocamlrep with Buck2 and Reindeer
Instructions on how to setup a Buck2 build of ocamlrep. More Buck2 information & examples can be found on the [Buck2 website](https://buck2.build/).
## Setup
### Install Buck2
#### Buck2 binary
- Get the latest prebuilt `buck2` binary (and symlink it into '/usr/local/bin').```bash
wget https://github.com/facebook/buck2/releases/download/latest/buck2-"$PLAT".zst
zstd -d buck2-"$PLAT".zst -o buck2
chmod +x buck2
sudo ln -s "$(pwd)"/buck2 /usr/local/bin/buck2
```
*Valid values for `$PLAT` are `x86_64-unknown-linux-gnu` on Linux, `x86_64-apple-darwin` on x86 macOS and `aarch64-apple-darwin` on ARM macOS.*#### Buck2 prelude
- Initialize a Buck2 prelude Git submodule.```bash
git submodule update --init
```### Reindeer
[Reindeer](https://github.com/facebookincubator/reindeer) is a tool to generate Buck2 rules for Rust crates.- Install the `reindeer` binary from source (into '~/.cargo/bin').
```bash
cargo install --git https://github.com/facebookincubator/reindeer.git reindeer
```### OPAM
- Initialize [OPAM](https://opam.ocaml.org/).```bash
opam init --compiler=5.1.1 --disable-sandboxing -y
eval $(opam env)
```
### Symlink OPAM
- Run the script 'ocaml-setup.sh'.```bash
./ocaml-setup.sh
```
*Note: The script assumes that [`OPAM_SWITCH_PREFIX`](https://opam.ocaml.org/doc/Manual.html#Switches) is set.*### Generate BUCK rules for third-party Rust.
- Run `reindeer buckify`.```bash
reindeer --third-party-dir shim/third-party/rust buckify
```## Build
- Build the complete set of ocamlrep targets.
```bash
buck2 build root//...
```