I'm trying to build an application with Alloy that requires computing an HMAC to communicate to external systems. I have found the relevant JS support in the $(MODULES)/crypt/hmac.js file but as far as I can see this also requires including `$(MODULES)/crypt/digest/manifest.json) in my manifest. This, however, fails because the digest is module requires native code which is not compiled automatically.´
My Manifest
I am using the following manifest file:
{
"include": [
"$(MODDABLE)/examples/manifest_mod.json",
"$(MODDABLE)/examples/manifest_typings.json",
"$(MODULES)/crypt/digest/manifest.json"
],
"modules": {
"crypt/hmac": "$(MODULES)/crypt/etc/hmac.js",
"*": [
"./main.js",
]
}
}
The Error
Whe running pebble build I get the following output:
Running Moddable prebuild.
Running mcrun -m ./src/embeddedjs/manifest.json -f x -p pebble/emery -t build -o ./build/mods/emery/mcrun -s tech.moddable.pebble
### -p pebble/emery
Native code detected:
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/modCrypt.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/chacha.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/fips180.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/fips197.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/fips46.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/ghash.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/rc.c
/home/lilly/.local/share/pebble-sdk/SDKs/4.9.169/toolchain/moddable/modules/crypt/digest/kcl/rfc1321.c
Mods cannot contain native code. Did you intend to build using mcconfig?
### Error: mod cannot contain native code
Moddable prebuild failed: Command '['mcrun', '-m', './src/embeddedjs/manifest.json', '-f', 'x', '-p', 'pebble/emery', '-t', 'build', '-o', './build/mods/emery/mcrun', '-s', 'tech.moddable.pebble']' returned non-zero exit status 1.
I'm trying to build an application with Alloy that requires computing an HMAC to communicate to external systems. I have found the relevant JS support in the
$(MODULES)/crypt/hmac.jsfile but as far as I can see this also requires including `$(MODULES)/crypt/digest/manifest.json) in my manifest. This, however, fails because the digest is module requires native code which is not compiled automatically.´My Manifest
I am using the following manifest file:
{ "include": [ "$(MODDABLE)/examples/manifest_mod.json", "$(MODDABLE)/examples/manifest_typings.json", "$(MODULES)/crypt/digest/manifest.json" ], "modules": { "crypt/hmac": "$(MODULES)/crypt/etc/hmac.js", "*": [ "./main.js", ] } }The Error
Whe running
pebble buildI get the following output: