https://github.com/fbernier/rebar3_rust
Compile rust NIFs for erlang projects.
https://github.com/fbernier/rebar3_rust
Last synced: over 1 year ago
JSON representation
Compile rust NIFs for erlang projects.
- Host: GitHub
- URL: https://github.com/fbernier/rebar3_rust
- Owner: fbernier
- License: other
- Created: 2017-02-22T19:14:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T19:22:50.000Z (over 9 years ago)
- Last Synced: 2025-02-07T20:43:44.436Z (over 1 year ago)
- Language: Erlang
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rebar3_rust
Compile rust crates for erlang projects.
## Use
Add the plugin and hooks to your `rebar.config`
```erlang
{
plugins,
[
{
rebar3_rust,
{
git,
"https://github.com/sdwolf/rebar3_rust.git",
{branch, "master"}
}
}
]
}.
{
provider_hooks,
[
{
post,
[
{compile, {rust, compile}},
]
}
]
}.
```
Add the following to your `.gitignore`
```
crates/*/target
priv/*
!priv/.keep
```
You can find an example usage [here](https://github.com/sdwolf/rustfromerl).
## Upgrade
```bash
rebar3 plugins upgrade rebar3_rust
```
## Development
Go inside the downloaded dependency folder:
```bash
cd _build/default/plugins/rebar3_rust
```
Start your erlang docker container:
```bash
docker-here erlang bash
# Or use the full command if you do not have the docker-here alias:
docker run --rm -it -u `id -u`:`id -g` -v "$PWD":/work -w /work erlang bash
```
Compile from a dependent project:
```bash
rebar3 compile && rm -rf ebin/ && mv _build/default/lib/rebar3_rust/ebin/ .
```
## Resources
https://github.com/goertzenator/erlang_nif-sys