Skip to content

Commit

Permalink
Update seahorse to latest commit, which includes a wasm fix (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcintyre94 committed Nov 30, 2022
1 parent 1f46f38 commit 35cefc0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
13 changes: 10 additions & 3 deletions wasm/Cargo.lock

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

4 changes: 2 additions & 2 deletions wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Toolchain:

```sh
rustc --version
# rustc 1.62.0 (a8314ef7d 2022-06-27)
# rustc 1.65.0 (897e37553 2022-11-02)
wasm-pack --version
# wasm-pack 0.10.2
# wasm-pack 0.10.3
```

Run:
Expand Down
2 changes: 1 addition & 1 deletion wasm/pkgs/seahorse-compile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Callum McIntyre <callum@pointer.gg>"
],
"description": "Seahorse compiler for Solana Playground with WASM.",
"version": "0.2.3-nolocalimport",
"version": "0.2.4-wasm-fix",
"license": "GPL-3.0",
"repository": {
"type": "git",
Expand Down
Binary file modified wasm/pkgs/seahorse-compile/seahorse_compile_wasm_bg.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion wasm/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "stable-2022-06-27"
channel = "stable-2022-11-03"
targets = [ "wasm32-unknown-unknown" ]
7 changes: 4 additions & 3 deletions wasm/seahorse-compile/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "seahorse-compile-wasm"
version = "0.2.3-nolocalimport" # mirror seahorse-lang version
version = "0.2.4-wasm-fix" # mirror seahorse-lang version
edition = "2021"
authors = ["Callum McIntyre <callum@pointer.gg>"]
description = "Seahorse compiler for Solana Playground with WASM."
Expand All @@ -12,8 +12,9 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
console_error_panic_hook = "0.1.7"
# File system integration broke WASM: https://github.com/ameliatastic/seahorse-lang/commit/6a9613749e570d1ac85e2e8d0877f8b09b2b0b33
# 0.2.4: File system integration broke WASM: https://github.com/ameliatastic/seahorse-lang/commit/6a9613749e570d1ac85e2e8d0877f8b09b2b0b33
# the revision used is pre-release, with a fix for WASM: https://github.com/ameliatastic/seahorse-lang/pull/67
# seahorse-lang = "0.2.3"
seahorse-lang = { git = "https://github.com/ameliatastic/seahorse-lang", rev = "0bc37a40b4a8b983731f2dc9b51ec70d5f6545bf" }
seahorse-lang = { git = "https://github.com/ameliatastic/seahorse-lang", rev = "38a4c0dd46fe445a88fcf64098ce16baab2bfd73" }
solana-playground-utils-wasm = { path = "../utils/solana-playground-utils" }
wasm-bindgen = "0.2.81"
4 changes: 2 additions & 2 deletions wasm/seahorse-compile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub fn compile_seahorse(python_source: String, program_name: String) -> Vec<JsVa
// Playground expects to include the src/ prefix on files
let base_path: PathBuf = PathBuf::from_str("/src").unwrap();

match compile(python_source, program_name) {
Ok(out_tree) => build_src_tree(&out_tree, base_path)
match compile(python_source, program_name, Some(base_path.clone())) {
Ok(out_tree) => build_src_tree(&out_tree.tree, base_path)
// we need to change from Vec<String> to Vec<JsValue> for wasm-bindgen
.iter()
.map(|s| JsValue::from_str(s))
Expand Down

0 comments on commit 35cefc0

Please sign in to comment.