dapphub / klab

K framework proof explorer & smart contract specification format
GNU Affero General Public License v3.0
123 stars 36 forks source link

libexec/klab-report: stop checking for empty files #419

Closed asymmetric closed 4 years ago

asymmetric commented 4 years ago

The call to read() was reading the whole file in memory, which would explode at runtime for very long logs.

This commit removes the check on empty files, which could result in links being shown in the report page that are effectively useless.

The ideal solution would be to use something like Node's Stream class, to perform the same check without loading everything in memory. Decided not to implement this for now, as the feature being removed doesn't seem important enough to warrant spending the necessary time dealing with Node.js in order to re-implement it with Streams.

Let me know what you think.

asymmetric commented 4 years ago

Here's an example of the problem.

asymmetric commented 4 years ago

The previous build, now unstuck, after applying this patch: https://buildbot.dapp.ci/#/builders/12/builds/685