Reproducible builds

I’m building my web app + React, taken from npm (following advice from webpack docs). Everything works fine, except that builds are not reproducible.

Every time I run webpack for the same source, I get slightly different bundle.js, with changes like this:

-   var DOMProperty = __webpack_require__(33);
+   var DOMProperty = __webpack_require__(30);

-   var escapeTextForBrowser = __webpack_require__(34);
-   var memoizeStringOnly = __webpack_require__(35);
-   var warning = __webpack_require__(32);
+   var escapeTextForBrowser = __webpack_require__(31);
+   var memoizeStringOnly = __webpack_require__(32);
+   var warning = __webpack_require__(33);

Is there a way to make webpack build reproducible?

Author: Fantashit

1 thought on “Reproducible builds

Comments are closed.

Reproducible builds

Q A
Bug report? yes
Feature request? yes
BC Break report?
RFC?
Symfony version x.y.z

Reproducible builds are all the craze right now (exhibit a: https://reproducible-builds.org/). The basic premise is: code generation, compilation, heck, builds in general should behave deterministically, meaning: given the same set of inputs return the same output.

The main pain point with Symfony comes from the cache warmup process. console cache:warmup
will return a different results on two consecutive builds. The three main problem areas I’ve found so far:

  • Container IDs are randomly generated
  • Names and symbols of lazy proxies are randomly generated
  • Compiled twig templates are randomly generated

Before we start digging deeper into this, first question: is that something Symfony wants to properly support or is that something that should somehow live outside of Symfony?

Demo project

Author: Fantashit

2 thoughts on “Reproducible builds

  1. AFAIK, none of the listed items are randomly named. These names are all based on a hash of their content.

Comments are closed.