Trouble Replicating the Build

Trouble Replicating the Build

druegamerdruegamer Posts: 21Questions: 5Answers: 0

I am unsure if this is the best place to ask this, if there is a better place please let me know.

I'm having some trouble replicating the build process, and it appears to have to do specifically with the minimization process. I am able to replicate the non-minimized files exactly, but the minimized versions always have differences.

The build process described on the github (https://github.com/DataTables/DataTablesSrc) does not name any particular version of Closure to use, but none that I have tried yield an exact replica of the minimized versions found on the compiled repo.

The primary differences seem small: the variables are named differently, there is a slight optimization difference in a series of boolean statements, or there is a difference in information in the header comment. I can't imagine, functionally, the code has changed, but I can't help but think there is a step being missed in build process somewhere.

I have also attached a diff to show these differences.

Some information:
- I am only compiling the javascript, using the 'js' option of the make script, and only comparing the base dataTables build with no extensions.
- I am using version 1.10.19 of the source (and the same version of the compiled to compare).
- I am only using Bash and Closure to do this. I do not have PHP, Sass, or JSHint (presumably not needed as I am only compiling the javascript).
- I have used both the OpenJDK and Oracle to run Closure
- A coworker also performed this build process, and was able to replicate the same minimized file I had but not the minimized version on the compiled-sources github.
- I am using an online javascript pretty-printer to allow comparison between the minimized files to be readable. (https://beautifier.io/)

diff.txt 241.7K

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin
    edited December 2018 Answer ✓

    Hi,

    This is the version information about the closure compiler version that the current release of DataTables was built with:

    $ java -jar compiler.jar --version
    Closure Compiler (http://github.com/google/closure-compiler)
    Version: v20120710 (revision 2079)
    Built on: 2012-07-10 20:55
    

    Its an old one as I found it gives better compression than the newer ones with no side effects that I've seen or have been reported. That said, the next version will use a newer one as we move on to using a rebuildable VM for development.

    I assume its just for validation that the minified version is actually the minified version of the source file that you want them to be identical?

    Allan

  • druegamerdruegamer Posts: 21Questions: 5Answers: 0

    Thank you very much, Allan, as usual!

    This endeavor has been for the sake of validation, and we were able to reproduce the build using that version of closure. Is there any chance we could get that closure version information on the github readme? Or maybe the release notes? That would be fantastic.

    Again, thank you very much.

This discussion has been closed.