Skip to content

protocol-buffers-descriptor is super slow and memory-intensive to build with 8.10.2

Summary

With GHC-8.10.2 protocol-buffers-descriptor won't build without disabling optimizations

  • building without fiddling results in OOM (I have 8gb RAM) at building Text.DescriptorProtos.FileOptions
  • switching to -O1 and removing fspec-constr-count doesn't seem to help
  • adding -O0 to just the FileOptions module gets me past that, by now it's stuck on Text.DescriptorProtos.FieldDescriptorProto (though memory is around 4GB)

With O0 on the whole project it builds quickly.

For a complete build log see https://travis-ci.org/github/k-bx/protocol-buffers/jobs/741074158

Original ticket: https://github.com/k-bx/protocol-buffers/issues/91

Steps to reproduce

# git clone git@github.com:k-bx/protocol-buffers.git
# cd protocol-buffers
# git checkout 3b8ab6b8e10bb0bfe8411db785c1c19a5e4dcd70
# stack build --stack-yaml stack-8.10.2.yaml protocol-buffers-descriptor

Expected behavior

protocol-buffers-descriptor builds.

Environment

  • GHC version used: 8.10.2
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information