Question: I am trying to get deterministic builds for WASM working, and I'm getting diffs in the following bytes:
__wbindgen_placeholder__.__wbg_length_{{8 byte hex}}
__wbindgen_placeholder__.__wbg_getindex_{{8 byte hex}}
__wbindgen_placeholder__.__wbg_new_{{8 byte hex}}
__wbindgen_placeholder__.__wbg_buffer_{{8 byte hex}}
__wbindgen_placeholder__.__wbg_new_{{8 byte hex}}
__wbindgen_placeholder__.__wbg_set_{{8 byte hex}}
The 8 bytes of hex (16 ASCII characters [0-9a-f]) is differing for myself and others.
I am using a shared docker image, so folder paths etc. SHOULD be the same... Can anyone tell me how these hex codes are decided and how I can keep them the same? If those 6 groups of 16 hex characters would just stay the same, it would be the same binary.
Please note that these are ASCII characters embedded within the WASM, those hex are not representing bytes of the WASM itself.
FYI the project is here:
https://github.com/junderw/tiny-secp256k1-wasm
git clone, then npm run build will pull a docker image to create a build environment.
I thought this would make it deterministic, but I guess not.
My sha256 hash for the wasm file:
c05e3bd8bbd4369748ec9726c2654edce75c7d23cce2455cbaa0dcad35b3c23a
5 people on Twitter's sha256 hash, they were running mixtures of MacOS, Windows with WSL, and Linux:
a40cc811fee9967ba82244c6dfec9451138af9d06e09089bb220494204120ae9
I wonder why mine is different.
Here's the js functions it seems to be referencing:
module.exports.__wbg_length_32e166b42b85060a = function(arg0) {
var ret = getObject(arg0).length;
return ret;
};
module.exports.__wbg_getindex_1e6f9d7435b8831d = function(arg0, arg1) {
var ret = getObject(arg0)[arg1 >>> 0];
return ret;
};
module.exports.__wbg_new_c261e217f13f5328 = function(arg0, arg1) {
var ret = new TypeError(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
module.exports.__wbg_buffer_985803c87989344b = function(arg0) {
var ret = getObject(arg0).buffer;
return addHeapObject(ret);
};
module.exports.__wbg_new_b7e3d6adc8b9377a = function(arg0) {
var ret = new Uint8Array(getObject(arg0));
return addHeapObject(ret);
};
module.exports.__wbg_set_66e888cef8f00a73 = function(arg0, arg1, arg2) {
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
};
Issue was dependencies changing.
I will commit Cargo.lock, which should fix any future issues.
Most helpful comment
My sha256 hash for the wasm file:
c05e3bd8bbd4369748ec9726c2654edce75c7d23cce2455cbaa0dcad35b3c23a
5 people on Twitter's sha256 hash, they were running mixtures of MacOS, Windows with WSL, and Linux:
a40cc811fee9967ba82244c6dfec9451138af9d06e09089bb220494204120ae9
I wonder why mine is different.