Title: Failing to build for target wasm32-unknown-unknown · Issue #2378 · RustPython/RustPython · GitHub
Open Graph Title: Failing to build for target wasm32-unknown-unknown · Issue #2378 · RustPython/RustPython
X Title: Failing to build for target wasm32-unknown-unknown · Issue #2378 · RustPython/RustPython
Description: Right now building for wasm32-unknown-unknown yields the following error: error[E0599]: no method named `into_pyexception` found for struct `std::io::Error` in the current scope --> vm/src/stdlib/thread.rs:243:28 | 243 | .map_err(|err| e...
Open Graph Description: Right now building for wasm32-unknown-unknown yields the following error: error[E0599]: no method named `into_pyexception` found for struct `std::io::Error` in the current scope --> vm/src/stdlib/t...
X Description: Right now building for wasm32-unknown-unknown yields the following error: error[E0599]: no method named `into_pyexception` found for struct `std::io::Error` in the current scope --> vm/src/stdli...
Opengraph URL: https://github.com/RustPython/RustPython/issues/2378
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Failing to build for target wasm32-unknown-unknown","articleBody":"Right now building for `wasm32-unknown-unknown` yields the following error:\r\n\r\n```\r\nerror[E0599]: no method named `into_pyexception` found for struct `std::io::Error` in the current scope\r\n --\u003e vm/src/stdlib/thread.rs:243:28\r\n |\r\n243 | .map_err(|err| err.into_pyexception(vm))\r\n | ^^^^^^^^^^^^^^^^ method not found in `std::io::Error\r\n```\r\n\r\nThis is fairly trivial to fix though:\r\n\r\n```diff\r\ndiff --git a/vm/src/stdlib/thread.rs b/vm/src/stdlib/thread.rs\r\nindex 8c48761d..afa42eac 100644\r\n--- a/vm/src/stdlib/thread.rs\r\n+++ b/vm/src/stdlib/thread.rs\r\n@@ -240,7 +240,16 @@ fn _thread_start_new_thread(\r\n vm.state.thread_count.fetch_add(1);\r\n thread_to_id(\u0026handle.thread())\r\n })\r\n- .map_err(|err| err.into_pyexception(vm))\r\n+ .map_err(|err| {\r\n+ #[cfg(any(not(target_arch = \"wasm32\"), target_os = \"wasi\"))]\r\n+ {\r\n+ err.into_pyexception(vm)\r\n+ }\r\n+ #[cfg(all(target_arch = \"wasm32\", not(target_os = \"wasi\")))]\r\n+ {\r\n+ vm.new_os_error(err.to_string())\r\n+ }\r\n+ })\r\n }\r\n \r\n fn run_thread(func: PyCallable, args: FuncArgs, vm: \u0026VirtualMachine) {\r\n```\r\n\r\nAnother option would be to compile without \"threading\" feature. I am not sure if this is intentional that it fails to compile with threading enabled?\r\n\r\nP.S. Thank you for your hard work on RustPython, I really love the project!","author":{"url":"https://github.com/vnetserg","@type":"Person","name":"vnetserg"},"datePublished":"2020-12-21T21:13:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/2378/RustPython/issues/2378"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:73de09b6-6d51-ba42-a920-af9965a1505a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC02:DA633:95025C:BE6D12:697422AB |
| html-safe-nonce | f5acb6c020130df0bfa9a96143997cb9503ac041c5b94423bf4bacc6ca77fbf4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzAyOkRBNjMzOjk1MDI1QzpCRTZEMTI6Njk3NDIyQUIiLCJ2aXNpdG9yX2lkIjoiNDkxMTE3MTM4MzkxNzI5MDE1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f8d4d4ded22de59b941e2b706435686ec33e95b5ca6782ec57a1b44adefc9ebd |
| hovercard-subject-tag | issue:772465372 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/2378/issue_layout |
| twitter:image | https://opengraph.githubassets.com/75ce85927e6c33d2de75c6e5032dff36e1f896fc47e35fa32f358ef1bddbb28a/RustPython/RustPython/issues/2378 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/75ce85927e6c33d2de75c6e5032dff36e1f896fc47e35fa32f358ef1bddbb28a/RustPython/RustPython/issues/2378 |
| og:image:alt | Right now building for wasm32-unknown-unknown yields the following error: error[E0599]: no method named `into_pyexception` found for struct `std::io::Error` in the current scope --> vm/src/stdlib/t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vnetserg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 447dc9917c3d68d647a01abfdefe55ec7ee1785922136c1d8395dbb3ab6d57b9 |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8dad7bdfecbe3eaa97ac4e632d6b47e2b23e81d9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width