Opened 11 years ago

Closed 11 years ago

#8564 closed enhancement (fixed)

dojo minification yields different results on different machines

Reported by: wdoekes Owned by: James Burke
Priority: low Milestone: 1.3
Component: BuildSystem Version: 1.2.3
Keywords: Cc:
Blocked By: Blocking:

Description

When doing minification of the dojo sources, the resulting code can vary even though the originals are the same. The differences occur in language code specifications, like the following example:

$ svn diff my-repository/dojo-mini/dojo/currency.js
-if(!dojo._hasResource["dojo.currency"]){dojo._hasResource["dojo.currency"]=true;dojo.provide("dojo.currency");dojo.require("dojo.number");dojo.require("dojo.i18n");dojo.requireLocalization("dojo.cldr","currency",null,"ROOT,de,en,en-au,en-ca,en-us,es,fr,it,ja,ko,nl,pt,zh,zh-tw");dojo.require("dojo.cldr.monetary");dojo.currency._mixInDefaults=function(_1)...
+if(!dojo._hasResource["dojo.currency"]){dojo._hasResource["dojo.currency"]=true;dojo.provide("dojo.currency");dojo.require("dojo.number");dojo.require("dojo.i18n");dojo.requireLocalization("dojo.cldr","currency",null,"zh,en-ca,pt,en-us,de,ja,en,en-au,fr,es,ko,zh-tw,it,ROOT,nl");dojo.require("dojo.cldr.monetary");dojo.currency._mixInDefaults=function(_1)...

As you can see, the only difference is in the language order. This order comes from the native filesystem order:

$ ls -U my-repository/dojo-mini/dojo/cldr/nls/
zh-cn  en-ca  pt     it-it  en-gb  ja     en     fr  ko     it     de-de         number.js    nl
zh     ko-kr  pt-br  en-us  de     ja-jp  en-au  es  zh-tw  es-es  gregorian.js  currency.js

(zh first, nl last, like in the second list: "zh,en-ca,pt,en-us,de,ja,en,en-au,fr,es,ko,zh-tw,it,ROOT,nl")

The filesystem order can vary across machines, platforms and checkouts. So, everytime someone new does a minification and checks their minified build into our repository, we get new modifications that aren't differences.

This can be easily fixed by sorting the language codes before writing them to the minified javascript file. See the attached patch for a possible solution.

Regards, Walter Doekes (OSSO B.V.)

P.S. Thanks for the swift replies on my other reports :-)

Attachments (1)

consistent_minify_order.patch (349 bytes) - added by wdoekes 11 years ago.
util/buildscripts/jslib/i18nUtil.js

Download all attachments as: .zip

Change History (3)

Changed 11 years ago by wdoekes

util/buildscripts/jslib/i18nUtil.js

comment:1 Changed 11 years ago by James Burke

Milestone: tbd1.3

comment:2 Changed 11 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [16637]) Fixes #8564, make sure locale lists are in a consistent order across operating systems. \!strict

Note: See TracTickets for help on using tickets.