Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running on windows. #51

Open
1 task done
tensor-programming opened this issue May 18, 2023 · 2 comments · May be fixed by #52
Open
1 task done

Error running on windows. #51

tensor-programming opened this issue May 18, 2023 · 2 comments · May be fixed by #52

Comments

@tensor-programming
Copy link

tensor-programming commented May 18, 2023

Is there an existing issue?

General
Was attempting to run the program.

Context
Error occurs when trying to run both locally and also against a web source. Also, the official example provider seemingly has its mod.ts missing because it was included in the gitignore. Not sure if this was deliberate.

Stacktrace

Platform: windows x86_64
Version: 0.1.7
Args: ["mashin", "run", "https://raw.githubusercontent.com/tensor-programming/mashing-test/dev/examples/my_provider.ts"]

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Builder, source: "Unknown TLS backend passed to `use_preconfigured_tls`" }', c:\Users\jking\.cargo\registry\src\github.com-1ecc6299db9ec823\deno_fetch-0.128.0\lib.rs:703:22
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\std\src\panicking.rs:575
   1: core::panicking::panic_fmt
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src\panicking.rs:64
   2: core::result::unwrap_failed
             at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library\core\src\result.rs:1790
   3: deno_fetch::create_http_client
   4: mashin::http_client::HttpClient::new
   5: mashin::main::{{closure}}
   6: tokio::runtime::scheduler::current_thread::Context::enter
   7: tokio::macros::scoped_tls::ScopedKey<T>::set
   8: tokio::runtime::scheduler::current_thread::CurrentThread::block_on
   9: tokio::runtime::runtime::Runtime::block_on
  10: mashin::setup_panic_hook::{{closure}}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Additional Information

Can be recreated on windows by executing mashin run on a provider that is local or remote.

Solution
No response

Are you willing to help with this request?
Yes, I can help with this if needed.

@tensor-programming
Copy link
Author

Fixed by bumping up these deps:

deno_core = "0.187.0"
deno_web = "0.136.0"
deno_fetch = "0.129.0"
deno_console = "0.105.0"
deno_webidl = "0.105.0"
deno_url = "0.105.0"
deno_websocket = "0.110.0"

Leads to another error however,

Error: Error: Could not open library: The specified module could not be found.
    at new DynamicProvider (ext:mashin_core/40_ffi.js:14:9)
    at new Provider (https://mashin.run/[email protected]/sdk/resource.ts:20:9)
    at new Provider (https://raw.githubusercontent.com/tensor-programming/mashing-test/dev/mod.ts:35:9)
    at https://raw.githubusercontent.com/tensor-programming/mashing-test/dev/examples/my_provider.ts:4:18
    at eventLoopTick (ext:core/01_core.js:181:11)

@tensor-programming
Copy link
Author

tensor-programming commented May 18, 2023

I found the issue overall with windows. I was able to run both my_provider.ts and my_provider_x500.ts by manually modifying the mod.ts file and replacing the LOCAL_PATH with a direct path to the .dll file for the lib.

On windows the files created for a cdylib are .dll and not .dynlib or .so files. Also for some reason, instead of appending lib in front of the name of the file, they just use the project name directly. As seen below.

image

The header here

let header = format!(
r#"/* -------------------------------------------------------- *\
* *
* ███╗░░░███╗░█████╗░░██████╗██╗░░██╗██╗███╗░░██╗ *
* ████╗░████║██╔══██╗██╔════╝██║░░██║██║████╗░██║ *
* ██╔████╔██║███████║╚█████╗░███████║██║██╔██╗██║ *
* ██║╚██╔╝██║██╔══██║░╚═══██╗██╔══██║██║██║╚████║ *
* ██║░╚═╝░██║██║░░██║██████╔╝██║░░██║██║██║░╚███║ *
* ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═════╝░╚═╝░░╚═╝╚═╝╚═╝░░╚══╝ *
* by Nutshimit *
* -------------------------------------------------------- *
* *
* This file is generated automatically by mashin. *
* Do not edit manually. *
* *
\* ---------------------------------------------------------*/
import {{
Resource as MashinResource,
Provider as MashinProvider,
getFileName,
Inputs,
Outputs,
ResourceName,
ResourceOptions,
}} from "https://mashin.run/std@{std_version_to_use}/sdk/mod.ts";
export const VERSION = "{crate_version}";
const LOCAL_PATH = Deno.env.get("LOCAL_PLUGIN")
? "./target/debug/lib{crate_name}.dylib"
: await globalThis.__mashin.downloadProvider(
"github",
new URL(
getFileName("{crate_name}"),
`{github_url}/releases/download/v${{VERSION}}/`
).toString()
);
"#
);
will have to be conditionally compiled for windows.

@tensor-programming tensor-programming changed the title Reqwest https error when trying to call mashin run on windows Error running on windows. May 18, 2023
@tensor-programming tensor-programming linked a pull request May 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant