cognitive-engineering-lab / aquascope

Interactive visualizations of Rust at compile-time and run-time
https://cognitive-engineering-lab.github.io/aquascope/
MIT License
1.94k stars 44 forks source link

Bug: Not able to interpret any code in playground #127

Open Palanikannan1437 opened 6 months ago

Palanikannan1437 commented 6 months ago

Hey folks, thank you for building such a cool tool, this tool has greatly helped me in learning Rust, absolutely love it.

Description

I wanted to set it up locally and followed all the instructions as mentioned in "from source" section and was able to do it successfully without any errors.

  1. Getting permissions in the playground works properly
image
  1. But while trying to interpret ANY code (even the default one), gives me this error in the Stderr section
[2024-03-04T20:13:16Z DEBUG aquascope_front::plugin] Provided PluginArgs AquascopePluginArgs { should_fail: true, command: Interpreter }
[2024-03-04T20:13:16Z DEBUG rustc_plugin::cli] PLUGIN_ARGS={"should_fail":true,"command":"Interpreter"}
[DEBUG src/driver.rs:152 2024-03-04T20:13:16Z] - Running plugin...
[DEBUG src/plugin.rs:171 2024-03-04T20:13:16Z] - Running command with callbacks: ["/Users/palanikannan/.cargo/bin/aquascope-driver", "--crate-name", "aquascope_tmp_proj", "--edition=2021", "src/main.rs", "--error-format=json", "--json=diagnostic-rendered-ansi,artifacts,future-incompat", "--crate-type", "bin", "--emit=dep-info,metadata", "-C", "embed-bitcode=no", "-C", "debuginfo=2", "-C", "split-debuginfo=unpacked", "-C", "metadata=2f3c62f7dee3217d", "-C", "extra-filename=-2f3c62f7dee3217d", "--out-dir", "/private/var/folders/t3/2hkg5_r510d884kf_vpl4wbr0000gn/T/.tmpK1Vlgx/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/deps", "-C", "incremental=/private/var/folders/t3/2hkg5_r510d884kf_vpl4wbr0000gn/T/.tmpK1Vlgx/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/incremental", "-L", "dependency=/private/var/folders/t3/2hkg5_r510d884kf_vpl4wbr0000gn/T/.tmpK1Vlgx/aquascope_tmp_proj/target/plugin-nightly-2023-08-25/debug/deps", "--sysroot", "/Users/palanikannan/.rustup/toolchains/nightly-2023-08-25-x86_64-apple-darwin", "-Z", "identify-regions", "-Z", "mir-opt-level=0", "-Z", "track-diagnostics=yes", "-Z", "maximal-hir-to-mir-coverage", "-A", "warnings"]
[DEBUG src/plugin.rs:175 2024-03-04T20:13:16Z] - building compiler ...
error: the current sysroot was built without `-Zalways-encode-mir`, or libcore seems missing. Use `cargo miri setup` to prepare a sysroot that is suitable for Miri.

error: could not compile `aquascope_tmp_proj` (bin "aquascope_tmp_proj") due to previous error

I tried to run cargo miri setup and tried cargo make install-mdbook and cargo make playground post that but it doesn't seem to work even then, I'm getting the same output in the Stderr when trying to interpret any code. Could you please point me towards a potential fix? Thanks

go-bears commented 6 months ago

I'm seeing the same issue with the online web browser demo version. I've tried accessing the visualizer in Firefox and Chrome, and I'm not seeing anything when I press the "interpret" or "permissions" buttons.

gavinleroy commented 6 months ago

I'm seeing the same issue with the online web browser demo version. I've tried accessing the visualizer in Firefox and Chrome, and I'm not seeing anything when I press the "interpret" or "permissions" buttons.

Thanks for reporting! The issue with the online playground is different from that reported above. It was already fixed and you should be able to enjoy Aquascope online again.

As for the local playground instance, there appears to be a misconfiguration in the repo. I'm currently traveling but will hopefully manage a fix in the next few days.

Palanikannan1437 commented 6 months ago

Hey there @gavinleroy, were you able to find some bandwidth for looking into the local playground issue 😅

gavinleroy commented 6 months ago

Yes, you need to make sure that the environment variable MIRI_SYSROOT is set to the path output by cargo miri setup. I've just updated the Makefile to do this, so if you pull it should work :tm:. Let me know if that works for you locally.

Palanikannan1437 commented 5 months ago

Hey @gavinleroy, thank you so much for this. But even after this it doesn't seem to work 😅

What I did was,

  1. pulled the latest changes
  2. ran cargo make install-mdbook
  3. ran cargo make playground again

Am I missing something here?

gavinleroy commented 5 months ago

@Palanikannan1437 🤦 argh, my apologies. I inserted a typo into the Makefile, now that should be fixed and I've confirmed that others have been able to run the local playground as described. Please do let me know if that finally fixes the issue.