question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TwirlCompiler: Make output reproducible-friendly

See original GitHub issue

Hi,

Currently the TwirlCompiler emits a comment like this:

                  -- GENERATED --
                  DATE: Wed Mar 06 05:39:00 CET 2019
                  SOURCE: /home/bardur/wd/cwconsult/silo/modules/postgresql/src/main/twirl/dk/cwconsult/silo/postgresql/core/impl/LockStreamSQL.scala.txt
                  HASH: aca20403ba81a6a79ef8db751c2a0f13b68222eb
                  MATRIX: 651->1|764->22|791->23|829->35|864->50|892->51
                  LINES: 15->1|20->2|21->3|21->3|21->3|21->3
                  -- GENERATED --

Unfortunately, this contains two pieces of information that are bad for reproducible builds:

  • The absolute path of the source file.
  • The timestamp of compilation.

(It’s generally also bad for build systems where you ideally want the output of a build step to be stable if its inputs are – to avoid e.g. spurious rebuilds.)

It would be much appreciated if they could either just be outright removed[0] or if we could have an option to disable embedding these ‘fields’. (I’m not sure if the ordering on e.g. MATRIX and LINES output is deterministic, but it should be made so as well.)

If either of these seems acceptable, I think I should be able to code it up fairly quickly.

[0] I’m not really familiar with the Play ecosystem, but one assumes that this may be for template-debugging purposes where a dev server can show the file?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:24 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
bjaglincommented, Apr 14, 2021

For the record, this was released as part of 1.5.1.

2reactions
BardurArantssoncommented, Jun 25, 2019

The TL;DR is that the output changes needlessly on recompilation of the same input – which makes interacting with build systems like Pants, Bazel, etc. less than ideal because they’ll assume that because the twirl output file has changed (its hash has changed), they need to recompile the output (and whatever depends on that output).

Does that make sense?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buildroot:ReproducibleBuilds - eLinux.org
Autobuilders randomly do builds with BR2_REPRODUCIBLE=y. Such builds are run a second time and the results are compared. Changing build directory definitely ...
Read more >
cl6x compiler to produce bitwise reproducible output - TI E2E
I need cl6x compiler to provide bitwise reproducible output (see also https://reproducible-builds.org.e. multiple compilations of the same ...
Read more >
A Super-Simple Makefile for Medium-Sized C/C++ Projects
A simple Makefile for C or C++ that automatically finds sources, determines include flags, and sets up header dependencies.
Read more >
Introduction to Reproducible Research in R and R ... - WordPress.com
Reproducibility is the ability of an entire experiment or study to be reproduced, either by the researcher or by someone else working independently, ......
Read more >
AiiDA 1.0, a scalable computational infrastructure for ... - Nature
In computational science, for a result to be reproducible, ... as processes that create new data as output, given certain data as input....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found