Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Include version information in output to aid in debugging (#25)
Browse files Browse the repository at this point in the history
* Add version information to output for debugging
* Fix up wasm support for playground
  • Loading branch information
Cypher1 authored Mar 10, 2022
1 parent 0c2cdc2 commit 6a7b1e6
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 5 deletions.
200 changes: 200 additions & 0 deletions ibis/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions ibis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition = "2021"
description = "Ibis - a knowledge engine for type checking asynchronously communicating modules"
repository = "https://github.com/project-oak/arcsjs-provable"
license = "See LICENSE"
build = "build.rs"

[lib]
name = "ibis"
Expand All @@ -20,6 +21,7 @@ dot = [] # Support the generation of dot graphs (for debugging)
wasm = [ "wasm-bindgen", "console_error_panic_hook" ] # Support wasm-bindgen API

[dependencies]
shadow-rs = { version = "0.9", default-features = false }
nom = "7.1.0"
paste = "1.0.6"
crepe = "0.1.6"
Expand All @@ -34,6 +36,9 @@ console_error_panic_hook = { version = "0.1.7", optional = true }
pretty_assertions = "1.0.0"
criterion = { version = "0.3", features = ["html_reports"] }

[build-dependencies]
shadow-rs = "0.9"

[profile.release]
opt-level = "z"
lto = "fat"
Expand Down
3 changes: 3 additions & 0 deletions ibis/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() -> shadow_rs::SdResult<()> {
shadow_rs::new()
}
1 change: 1 addition & 0 deletions ibis/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ <h1>Ibis - Playground</h1>
<textarea class="flex-child" id="input"></textarea>
<textarea class="flex-child" id="output"></textarea>
</div>
<div id="version_info"></div>
</body>
</html>
4 changes: 3 additions & 1 deletion ibis/playground/playground.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import {default as ibis, best_solutions_to_json} from '../pkg/ibis.js';
import {default as ibis, version_info, best_solutions_to_json} from '../pkg/ibis.js';

async function loadIbis() {
const feedback = document.getElementById('feedback');
const version_info_display = document.getElementById('version_info');
feedback.innerText = 'Loading ibis...';
// Set up ibis
await ibis('../pkg/ibis_bg.wasm');
feedback.innerText = 'Loaded';
version_info_display.innerText = version_info();
}

async function getDemoContent() {
Expand Down
1 change: 1 addition & 0 deletions ibis/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use ibis::IbisError;
use std::io::Read;

fn main() -> Result<(), IbisError> {
eprintln!("{}", ibis::version_info());
let mut data = String::new();
std::io::stdin()
.read_to_string(&mut data)
Expand Down
Loading

0 comments on commit 6a7b1e6

Please sign in to comment.