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

make loadPackages() work for big build.zig files #459

Closed
wants to merge 1 commit into from

Conversation

teh-cmc
Copy link

@teh-cmc teh-cmc commented Feb 12, 2022

Hey there, I'm currently working on a project in which the build.zig file has been steadily growing, and at some point my ZLS just stopped working: no autocompletion, no gotodef, no nothing for any package outside of std. :(

Turns out the culprit was the loadPackages function that execs some parsing stuff and pipes back the output... unfortunately the default parameters for exec only allow up to 50k of data to be collected through stdout by default ¯\_(ツ)_/¯.

@SuperAuguste
Copy link
Member

Hey, thanks for your contribution! This change does indeed work, but it demonstrates an underlying issue with the build runner. I would prefer a refactor that implements a streaming solution that does not require 52 megabytes of allocated stdout buffer to function!

@theoparis
Copy link

theoparis commented Jul 4, 2022

Hey, thanks for your contribution! This change does indeed work, but it demonstrates an underlying issue with the build runner. I would prefer a refactor that implements a streaming solution that does not require 52 megabytes of allocated stdout buffer to function!

I was just attempting to implement this. Would a "streaming solution" be considered using a while loop and a [4096]u8 buffer with readUntilDelimiterOrEof? I also split the ChildProcess.exec() to seperate spawn, read, wait calls.

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

Successfully merging this pull request may close these issues.

3 participants