Blockly - build.py not producing consistent results on different computers

107 views Asked by At

I'm working on a Blockly project.

I just changed computers.

When I run build.py on my new computer to compress the files, it produces a version of blocks_compressed.js that does not work. When I try to use it, none of my blocks display, because it thinks the colour property is set to an undefined variable.

On my old computer, I can produce a blocks_compressed that works fine.

I copied the entire blocks directory from my old computer to to the new one, but still get different results.

When I open the files, they appear to have the same number of lines, but the lines are in different orders. It's as if the files in the blocks directory are getting processed differently on the two computers.

I am using the same version of closure_library.

Can anyone offer a suggestion about why I would be seeing these different results?

2

There are 2 answers

0
Trevor Shaw On BEST ANSWER

Not sure why the build was working differently on two different machines. I resolved it by moving the declarations of the colour variables to files that don't get compiled to ensure they are executed before the variables are used.

1
fennel On

If you're on an older version of Blockly, try updating. This change from last year aims to make the build process deterministic.

If you're already up to date I don't have specific answers, but you could start debugging by adding logs in the places touched by that PR, to verify the file order.