Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 1.71 KB

BUILDING.md

File metadata and controls

48 lines (33 loc) · 1.71 KB

Building

Install Rust. If you don't already have it, use rustup, following the installation instructions at rustup.rs. In brief:

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env

Assuming you have a working Rust toolchain, you can just run cargo build at the top-level of this repository:

$ cargo build

Standalone usage

To use ARK as a standalone kernel (outside Positron), install the kernelspec. From the repository root after running cargo build:

$ ./target/debug/ark --install

This installs a JSON file to the Jupyter kernel registry. After it completes, the Ark R kernel will be available on all Jupyter frontends on your system (Notebook, Lab, etc.).

You will usually want to tweak the ark environment for development; add this to ~/Library/Jupyter/kernels/ark/kernel.json:

  "env": {
    "RUST_BACKTRACE": "1",
    "RUST_LOG": "warn,ark=trace",
  }

This enables backtrace capturing in anyhow errors and sets internal crates to log at TRACE level and external dependencies to log at WARN. Setting the latter to more verbose levels can dramatically decrease performance. See the documentation in the tracing_subscriber crate for more fine-grained tuning of the RUST_LOG environment variable.

Test with Positron

To test the dev build of ARK on Positron, you can open Positron's user settings and change option Positron > R > Kernel: Path (ID: positron.r.kernel.path) to the location of the binary.

{
    "positron.r.kernel.path": "/path/to/ark/target/debug/ark",
}