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

Possible compiler bug #1358

Open
gmlewis opened this issue Dec 24, 2024 · 3 comments
Open

Possible compiler bug #1358

gmlewis opened this issue Dec 24, 2024 · 3 comments

Comments

@gmlewis
Copy link
Contributor

gmlewis commented Dec 24, 2024

In this repo and this branch and this directory:
https://github.com/gmlewis/modus/tree/add-moonbit-sdk/sdk/moonbit/examples/simple

$ moon version --all
moon 0.1.20241219 (e628c26 2024-12-19) ~/.moon/bin/moon
moonc v0.1.20241223+62b9a1a85 ~/.moon/bin/moonc
moonrun 0.1.20241219 (e628c26 2024-12-19) ~/.moon/bin/moonrun

$ moon test --target js

         --  --
       /  //  / __--------_
      /  //  /_/            \
   ---      -                \ __
  / X        /        ____   /   )
  *_________/__/_____/______/ `--

Oops, the compiler has encountered an unexpected situation.
This is a bug in the compiler.

A bug report containing the error description and relevant code would be
greatly appreciated. You can submit the bug report here:

  https://github.com/moonbitlang/moonbit-docs/issues/new?labels=bug,ICE

Error: File "inlined_snapshot/_build/Js_of_mcore.ml", line 1668, characters 38-44: Assertion failed

Compiler args: moonc link-core /Users/glenn/.moon/lib/core/target/js/release/bundle/core.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/gmlewis/modus/wit/ffi/ffi.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/gmlewis/modus/wit/interface/console/console.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/gmlewis/modus/pkg/console/console.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/gmlewis/modus/wit/interface/imports/wasi/clocks/wallClock/wallClock.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/moonbitlang/x/internal/ffi/ffi.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/moonbitlang/x/encoding/encoding.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/moonbitlang/x/sys/internal/ffi/ffi.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/moonbitlang/x/sys/sys.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/.mooncakes/moonbitlang/x/time/time.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/simple-example.core /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/simple-example.blackbox_test.core -main gmlewis/modus/examples/simple-example_blackbox_test -o /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/target/js/debug/test/simple-example.blackbox_test.js -test-mode -pkg-config-path /Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/moon.pkg.json -pkg-sources gmlewis/modus/wit/ffi:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/wit/ffi -pkg-sources gmlewis/modus/wit/interface/console:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/wit/interface/console -pkg-sources gmlewis/modus/pkg/console:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/pkg/console -pkg-sources gmlewis/modus/wit/interface/imports/wasi/clocks/wallClock:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/wit/interface/imports/wasi/clocks/wallClock -pkg-sources moonbitlang/x/internal/ffi:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/internal/ffi -pkg-sources moonbitlang/x/encoding:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/encoding -pkg-sources moonbitlang/x/sys/internal/ffi:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/sys/internal/ffi -pkg-sources moonbitlang/x/sys:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/sys -pkg-sources moonbitlang/x/time:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple/time -pkg-sources gmlewis/modus/examples/simple-example:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple -pkg-sources gmlewis/modus/examples/simple-example_blackbox_test:/Users/glenn/src/github.com/hypermodeinc/modus/sdk/moonbit/examples/simple -pkg-sources moonbitlang/core:/Users/glenn/.moon/lib/core -exported_functions moonbit_test_driver_internal_execute,moonbit_test_driver_finish -js-format cjs -no-dts -target js -g -O0

moonc version: v0.1.20241223+62b9a1a85
error: failed to run test for target Js

Caused by:
    failed when testing

Also, if you have any ideas about mocking @console here, please let me know... I'm still trying to figure out how best to do this for local unit testing.

@gmlewis
Copy link
Contributor Author

gmlewis commented Dec 24, 2024

Ah... maybe I can use different files for @console:

  • console_wasm.mbt
  • console_js.mbt
  • or maybe console_js_test.mbt

@Yu-zh
Copy link
Collaborator

Yu-zh commented Dec 24, 2024

This seems to be caused by usage of inline wasm code when compiling targeting Js backend. Can you check it? We will try to improve the error message for such cases.

@gmlewis
Copy link
Contributor Author

gmlewis commented Dec 24, 2024

This seems to be caused by usage of inline wasm code when compiling targeting Js backend. Can you check it? We will try to improve the error message for such cases.

Ah, yes, that must be it. Thank you, @Yu-zh !

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

No branches or pull requests

2 participants