ProdriveTechnologies / bazel-latex

Bazel build system rules for LaTeX
Apache License 2.0
75 stars 37 forks source link

Parameterize the use of latex engine #109

Closed solsjo closed 1 year ago

solsjo commented 1 year ago

This pull request aims at simplifying the rules, raise the readability, reduce the build time of the builds and promote extensibility.

Build times are reduced by not copying all binaries to a structure similar to the one latex expects. Latex / kpathsea assumes that directories with only symlinks to be empty. This is overcome by instead setting the environment variables that kpathsea makes use of (kpathsea is the lib responsible for locating files in the tex environment).

Apart from this further refactoring might be able to do away with the tool_wrapper altogether.

solsjo commented 1 year ago

it seems setting the environment variables from starlark results in a lot of memory being claimed. It might be wise to handle the setting via Args instead, so as to more efficiently handle it. Or pass the envs, as an action parameter instead of as an argument.

solsjo commented 1 year ago

@Kernald Can you have a look at this pull request?

solsjo commented 1 year ago

@patbro would you have time to review this pull request?

Kernald commented 1 year ago

Sorry for the delay - I'll try looking at these over the next few days!

solsjo commented 1 year ago

No worries! Thanks for the review @Kernald. I have a follow up commit that removes the tool_wrapper altogether as well. When you have time :)

solsjo commented 1 year ago

Updated according to the comments.

solsjo commented 1 year ago

@Kernald

Kernald commented 1 year ago

Thanks!