mattwparas / steel

An embedded scheme interpreter in Rust
Apache License 2.0
1.12k stars 50 forks source link

Dependency `lasso` fails to compile on nightly toolchain #192

Closed tychedelia closed 3 weeks ago

tychedelia commented 5 months ago

See https://github.com/Kixiron/lasso/pull/45. Maintainer appears to be MIA. Looked briefly at Steel's use and it seems non-trivial to factor out.

tychedelia commented 5 months ago

Here's the patch from https://github.com/Kixiron/lasso/pull/45/files for anyone who needs it

[patch.crates-io]
lasso = { git = "https://github.com/lcnr/lasso/", branch = "patch-1" }
mattwparas commented 5 months ago

Oh that's unfortunate, I hope Kixiron is alright - he's put out some very impressive work.

I'll take a look at this more closely later today. In order to not use this dependency, I'd have to implement a string internet myself - which is very doable - it just won't be as performant as this one. I'm also not opposed to maintaining a fork internally to steel in the interim as well

tychedelia commented 5 months ago

I'm also not opposed to maintaining a fork internally to steel in the interim as well

The patch looks extremely trivial! This issue has been open for a bit, hopefully the maintainer can come back and do a new release.

mattwparas commented 5 months ago

I've patched master now to have the patched version of lasso

amkhlv commented 2 months ago

please update steel-core to use the latest v7.2 of lasso

mattwparas commented 2 months ago

It is updated on master, are you asking for a new release? v0.7.2 has the above issue, whereas it appears the git dependency for lasso is fixed

amkhlv commented 2 months ago

I am sorry about this confusion. But the current release just does not build...

mattwparas commented 2 months ago

What are you trying to build? Can you provide any more details?

mattwparas commented 2 months ago

The current release of steel on crates will have issues on newer rust versions, due to the issue with lasso. If you take a dependency on the git version of steel on the latest master, that should build

I will address the crates release of steel soon

amkhlv commented 2 months ago

I tried git version. I my Cargo.toml :

steel-core = { git = "https://github.com/mattwparas/steel" }

then I am getting:

error: failed to select a version for `getrandom`.
    ... required by package `steel-core v0.6.0 (https://github.com/mattwparas/steel#1eb4d9b4)`
the package `steel-core` depends on `getrandom`, with features: `js` but `getrandom` does not have these features
mattwparas commented 2 months ago

are you compiling for wasm?

amkhlv commented 2 months ago

No. It is a big sloppy personal utilities collection:

utils/Cargo.toml

mattwparas commented 2 months ago

Looks like getrandom is a transitive dependency of dirs, and as a result things were having some issues. Upgrading dirs gets your build fixing - alongside this one change from steel:

diff --git a/share/Rust/utils/Cargo.toml b/share/Rust/utils/Cargo.toml
index dc4670c..dd6cbb9 100644
--- a/share/Rust/utils/Cargo.toml
+++ b/share/Rust/utils/Cargo.toml
@@ -39,7 +39,8 @@ regex = "1.5.4"
 serde = "1.0.132"
 serde_dhall = "0.12.1"
 serde_json = "1.0.91"
-dirs = "1.0.5"
+# dirs = "1.0.5"
+dirs = "5.0.1"
 # postgres = "0.19.2"
 tokio = { version = "1", features = ["full"] }
 tokio-postgres = "0.7.7"
@@ -48,5 +49,5 @@ json = "0.12.4"
 glob = "0.3.1"
 chrono = "0.4.23"
 docx-rs = "0.4.6"
-steel-core = "0.5.0"
+steel-core = { git = "https://github.com/mattwparas/steel" }
 markdown = "0.3.0"
diff --git a/share/Rust/utils/src/svg.rs b/share/Rust/utils/src/svg.rs
index d936d58..af8a707 100644
--- a/share/Rust/utils/src/svg.rs
+++ b/share/Rust/utils/src/svg.rs
@@ -123,7 +123,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
             let in_filename = in_path.file_name().unwrap();
             let out_filename : String = if let Some(trans) = clops.transformer {
                 let mut steel_vm = Engine::new();
-                match steel_vm.run(&format!("({} \"{}\")", trans, in_filename.to_str().unwrap())) {
+                match steel_vm.run(format!("({} \"{}\")", trans, in_filename.to_str().unwrap())) {
                     Ok(mut v) => {
                         match v.pop().expect("transformer returned empty Vec") {
                           SteelVal::StringV(x) => x.to_string(),

I'll look into what was going wrong here. I specify getrandom explicitly with the js feature when compiling for wasm, but it looks like when doing dependency resolution cargo was pinning getrandom to a version without the js feature, and thus it was having a bad time

Apologies for the noise, let me know if this works on your end

amkhlv commented 2 months ago

Yes, now it works ! Thank you ! I think steel scheme is very useful. Here I use it to pass a function on the command line, in order to modify the behavior of the program.