fsimphy / bayernfahrplan

A JSON-fetcher for bus departues in bavaria written in D
MIT License
1 stars 0 forks source link

Reduce compilation annoyances w.r.t. vibe #36

Open pheerai opened 5 years ago

pheerai commented 5 years ago

Summary

This is a meta task for tracking and discussing the current state of dub builds.

Occuring problems

With requests pulling vibe-d as (unused) dependency, the following two things happen:

  1. [ ] vibe-d:http takes ages to compile on the RPi3B, taking up 90% of RAM and up to 750 M of swap space (for a total consumption of approx. 1.7 GB)
  2. [ ] Same goes for linking
  3. [ ] vibe-d:tls even has to be specified as an explicit dependency, otherwise the necessary subconfiguration for running with openssl1.1 is not applied and linking fails.

Configuration and environment

Other things to be mentioned

(List of links to related GH issues will be added soon)

ghost91- commented 4 years ago

Unfortunately, this is a limitation of dub and there isn't really a way around it without extracting the vibe.d functionality of requests to a separate package.

See https://github.com/dlang/dub/issues/1706, https://github.com/dlang/dub/pull/1148, https://github.com/dlang/dub/wiki/FAQ

Geod24 commented 4 years ago

Just stumbled upon this. You guys commit your dub.selections.json, so here's a workaround for you:

0) Create a library folder if you don't have one (I use submodules); 1) Identify all dependencies that are unused; 2) For each of them, create a folder (e.g. submodules/vibe.d) and add a dummy file such as this. 3) Change your dub.selections.json to point your unused dependency, such as this.

And voila. In our case we use git submodule only for dependency, but we came up with the same problem (dub trying to pull things it shouldn't). This hack lets it believe it already has them, and you'll never get an error since the configuration is not used.