Drasil icon indicating copy to clipboard operation
Drasil copied to clipboard

Something "wrong" with the tex build:

Open JacquesCarette opened this issue 2 years ago • 1 comments

Looking at the latest build, it takes 24minutes to do what is listed as the tex part of the build.

Now, digging in, we see:

stack build --ghc-options="-Wall -j2" "glassbr"

which seems odd. That does appear to succeed quickly. I was surprised to see that next was

cd "build/glassbr" && stack exec -- "glassbr" 

which, amongst other things, does type-checking. But all of this has already been done when testing against stable!! So this is all wasted work.

Then we see that in running on LuaLaTex

luaotfload | db : Font names database not found, generating new one.
luaotfload | db : This can take several minutes; please be patient.

which is a bad sign. Maybe we should have a pre-built font databse?

JacquesCarette avatar Jul 19 '23 19:07 JacquesCarette

Ok, so we have a few things:

  1. we frequently regenerate the tex (amongst other things) when we shouldn't need to (duplicate of #2850 with better stating here),
  2. the font database being regenerated isn't an issue we can do much for without a persistent machine, the cache is typically too large for us to be able to cache without bloating it,
  3. most tex builds are completely unnecessary -- if we haven't had any changes to the stable/ tex code, why should we be building the generated tex code anyways??? From the CI, we already know that a previous step validated that the generated tex is the same as that in stable/. It's redundant.

I think that (1) is a part of a bigger issue with our other targets (such as analysis, graphs, and tracegraphs), which I hope to tackle in #3557.

I'll need to think about the solution to (3). For a short-term hack to avoiding rebuilding the TeX, we can augment the Makefile to build the tex from the stable/ artifacts folder instead of the build/ folder, and in a separate workflow for "Generated Artifact Quality Control" (potentially with a whole suite of other linting, static analysis, etc) -- thjis would work on the CI-level, but not the local-level. The better solution is probably to lazy-build the TeX artifacts using some git magic to check if the current branch is a feature branch containing changes to the tex artifacts (this would work on the CI and locally).

balacij avatar Sep 17 '23 02:09 balacij