willcrichton / flowistry

Flowistry is an IDE plugin for Rust that helps you focus on relevant code.
https://marketplace.visualstudio.com/items?itemName=wcrichton.flowistry
MIT License
1.88k stars 44 forks source link

Error in a rust CNB project: Cannot create a string longer than 0x1fffffe8 characters #83

Open schneems opened 10 months ago

schneems commented 10 months ago

Problem

I'm trying to use flowistry with the https://github.com/heroku/buildpacks-ruby repo on this commit:

$ git rev-parse HEAD
6a8896e0d4ceac6a54c9ab9269d6aab9f603da57

When I try to trigger flowestry in the main.rs I get an error:

image

This might be because the src/main.rs contains code for what will eventually become two binaries. The code in fn detect and fn build will be built into two separate binaries. This behavior comes from libcnb.rs. Docs: https://github.com/heroku/libcnb.rs/blob/6cd51ce91b58cebf72ed8e8513d52871b6106f0f/README.md#L134-L142.

Running the command:

$ cargo +nightly-2023-08-25 flowistry focus /Users/rschneeman/Documents/projects/work/buildpacks-ruby/buildpacks/ruby/src/main.rs 217 12

Takes quite a long time and it's then followed by a really long string.

Logs

OS: darwin (23.1.0) VSCode: 1.84.2 Error message

Error: Cannot create a string longer than 0x1fffffe8 characters

Full log: https://paste.rs/5gPs1

willcrichton commented 10 months ago

Thanks for the report. It seems like Flowistry is generating 1.2GB of data for this one function, which is ... too much. I will investigate and try to improve the performance.

schneems commented 10 months ago

Thanks for the plugin, your work, and reviewing my issue.

Other files take a long time but eventually successfully complete. I tried it on user_errors successfully (in the log I think too). Maybe there is something helpful in the delta between those two files that might point to the deeper underlying issue.

Also to add I have commit to libcnb.rs if there’s a small modification there that you find that could significantly improve performance, it might be possible to patch there while we wait on the longer term investigation and fix.