Hello! Ricardo Wurmus skribis: > Ludovic Courtès writes: > >> Ricardo Wurmus skribis: [...] >>> Currently, there’s no way to tell if the derivations listed under “These >>> derivations will be built” are expensive package builds or just simple >>> graft derivations. >> >> Indeed. A simple trick would be to (ab)use the environment variable >> part of derivations as a property list, the way Nix has traditionally >> done it (see ‘user+system-env-vars’ in (guix derivations)). >> >> So we could have, say, a ‘hint’ environment variable, and the UI would >> use that to determine if it’s a graft. > > This sounds like a good trick to me. I think it would be great to give > more hints to the UI and make it clearer to users what work they can > expect Guix to perform. In a similar vein, the attached module provides code to estimate package build time based on locally-available build logs. It can be used to show hints like this: --8<---------------cut here---------------start------------->8--- The following derivations would be built (estimated time: 54 mn): /gnu/store/3627svyhih9cfss8gnxllp9nmxqp23cq-gcc-4.9.4.drv /gnu/store/3didvp9c3sfqwmb9kkdr211vg5myygsf-gcc-4.9.4.tar.xz.drv --8<---------------cut here---------------end--------------->8--- or: --8<---------------cut here---------------start------------->8--- The following derivations would be built (estimated time: 22 hr): /gnu/store/safjgjqhxlf59rknygqdfq175cl5wvks-rust-1.27.2.drv /gnu/store/v154ah7f8wqcga104df9ldb25bjk2pm8-rustc-1.27.2-src.tar.gz.drv /gnu/store/nz2xzl1yizcwcxhnw2w5mdqnp3q1gggx-rustc-1.25.0-src.tar.gz.drv /gnu/store/wn422brymn6ysxq07090ijb4wx78dc1l-rustc-1.24.1-src.tar.gz.drv /gnu/store/3cj5083j5aq7az7n5dmkds77g84xqc33-rust-bootstrap-1.22.1.drv /gnu/store/rm1nghqrvw43wlbwws49rw921qh58m35-rustc-1.23.0-src.tar.xz.drv /gnu/store/a9gzrq0bsc3ynfj4cnrsxxd2jwjgf4zj-rust-1.23.0.drv /gnu/store/bmbpbhgby84yrj0mvkv279cy2ira4xqf-rustc-1.24.1-src.tar.xz.drv /gnu/store/bxxyzp6kzq88ii4aindgnggbb2m193rk-rust-1.24.1.drv /gnu/store/r26s0y5fi055pclhnivvf63llbrj54yw-rustc-1.25.0-src.tar.xz.drv /gnu/store/x4l0rsqni9lglfzazkjyxqjp432yr33s-rustc-1.26.2-src.tar.gz.drv /gnu/store/03y9zf5imbm0ni1llcmxixb8c78nmxdd-rustc-1.26.2-src.tar.xz.drv /gnu/store/ici0m0bia0f6f4wh0ykn12x6wg1ckck0-rust-1.25.0.drv /gnu/store/2l6fn1nxs2sfl93khki5jzz6dh7gfqpr-rust-1.26.2.drv /gnu/store/9bn1gxnsc59zi8bdpvfgqcjpczmk3ch0-rustc-1.27.2-src.tar.xz.drv --8<---------------cut here---------------end--------------->8--- (That’s from my x86_64 laptop.) The obvious downside is that it works by first retrieving the names of the files under /var/log/guix/drvs, and then opening, decompressing, and parsing the candidate log files. That typically takes a few seconds on a recent SSD laptop, but clearly we don’t want to do that every time. We could maintain a cache, but even then, it might still be too expensive. Perhaps we should keep build times in the database somehow; the daemon can keep it up-to-date. Thoughts? There’s the obvious downside that both approaches rely on having previously built the package, but I think that’s a necessary limitation, unless we are to resort to external services (which could hardly provide estimates that make sense for the user’s machine anyway.) Ludo’.