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

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

Open
schneems opened this issue Dec 5, 2023 · 2 comments

Comments

@schneems
Copy link

schneems commented Dec 5, 2023

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
Copy link
Owner

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
Copy link
Author

schneems commented Dec 6, 2023

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.

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