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

cargo run --example inside wingc panics on Wing files with extern functions #5423

Open
Chriscbr opened this issue Jan 5, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 👷‍♀️ contributor-experience Improvements for contributors' experience

Comments

@Chriscbr
Copy link
Contributor

Chriscbr commented Jan 5, 2024

I tried this:

After running pnpm install and compiling everything in the Wing monorepo, I tried running the compiler frontend on an example by changing my directory to libs/wingc and running cargo run --example compile with a path to a Wing file.

This happened:

$ RUST_BACKTRACE=1 cargo run --example compile ../../examples/tests/sdk_tests/util/shell.test.w
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
     Running `/Users/chrisr/dev/wing2/target/debug/examples/compile ../../examples/tests/sdk_tests/util/shell.test.w`
thread 'main' panicked at libs/wingc/src/jsify.rs:1347:52:
attempt to subtract with overflow
stack backtrace:
   0: rust_begin_unwind
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
   1: core::panicking::panic_fmt
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:117:5
   3: wingc::jsify::JSifier::jsify_function
             at ./src/jsify.rs:1347:34
   4: wingc::jsify::JSifier::jsify_class_inflight
             at ./src/jsify.rs:1625:20
   5: wingc::jsify::JSifier::jsify_class::{{closure}}
             at ./src/jsify.rs:1412:30
   6: wingc::visit_context::VisitorWithContext::with_class
             at ./src/visit_context.rs:249:13
   7: wingc::jsify::JSifier::jsify_class
             at ./src/jsify.rs:1393:3
   8: wingc::jsify::JSifier::jsify_statement
             at ./src/jsify.rs:1138:44
   9: wingc::jsify::JSifier::jsify
             at ./src/jsify.rs:145:12
  10: wingc::compile
             at ./src/lib.rs:347:3
  11: compile::main
             at ./examples/compile.rs:18:16
  12: core::ops::function::FnOnce::call_once
             at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/ops/function.rs:250:5

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

0.54.28

Node.js Version

18.16.0

Platform(s)

MacOS

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@Chriscbr Chriscbr added 🐛 bug Something isn't working 👷‍♀️ contributor-experience Improvements for contributors' experience 🛠️ compiler Compiler labels Jan 5, 2024
@monadabot monadabot added this to Wing Jan 5, 2024
@Chriscbr Chriscbr changed the title cargo run --example in wingc errors on Wing files with extern functions cargo run --example inside wingc panics on Wing files with extern functions Jan 5, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Jan 5, 2024
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 👷‍♀️ contributor-experience Improvements for contributors' experience
Projects
Status: 🤝 Backlog - handoff to owners
Development

No branches or pull requests

1 participant