[ISSUE] Cloud compile fails, but local compile succeeds

Hello!

Would love help with this. Read around similar posts but just can't figure out the solution for my context. My code compiles fine locally, but fails when I try to Cloud Compile.

Running Particle Workbench on MacOS Ventura on an M1 machine
Particle Version 3.11.3
Workbench Version 1.16.4

Here's the output for the failed Cloud Compile:

attempting to compile firmware
Compile failed: Processing  src/Argon1.ino
Checking library JsonParserGeneratorRK...
Checking library neopixel...
Installing library neopixel 1.0.1 to lib/neopixel ...
Installing library JsonParserGeneratorRK 0.1.5 to lib/JsonParserGeneratorRK ...
Library neopixel 1.0.1 installed.
Library JsonParserGeneratorRK 0.1.5 installed.
make -C ../modules/argon/user-part all
make[1]: Entering directory `/firmware/modules/argon/user-part'

mkdir -p target/
make -f ../../../modules/shared/nRF52840/build_linker_script.mk PREBUILD=1
make[2]: Entering directory `/firmware/modules/argon/user-part'
Creating target/platform_user_ram.ld ...
make[2]: Leaving directory `/firmware/modules/argon/user-part'

make -C ../../../user 
make[2]: Entering directory `/firmware/user'
Building cpp file: src/StripAnimator.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-12-msrc/

Building cpp file: src/Argon1.cpp
Invoking: ARM GCC CPP Compiler
mkdir -p ../build/target/user/platform-12-msrc/
arm-none-eabi-gcc -DMCU_DEVICE -DnRF52840 -DNRF52840_XXAA -DPLATFORM_THREADING=1 -DPLATFORM_ID=12 -DPLATFORM_NAME=argon -DPLATFORM_GEN=3 -DUSBD_VID_PARTICLE=0x2B04 -DUSBD_PID_DFU=0xD00C -DUSBD_PID_CDC=0xC00C -DSPARK_PLATFORM -fno-builtin-puts -fno-builtin-printf -Wl,--wrap=puts -Wl,--wrap=printf -g3 -gdwarf-2 -Os -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DARM_CPU_CORTEX_M4 --specs=nano.specs -DINCLUDE_PLATFORM=1 -DSOFTDEVICE_PRESENT=1 -DS140 -DPRODUCT_ID=12 -DPRODUCT_
	at makeError (/Users/griffinmullins/.vscode/extensions/particle.particle-vscode-core-1.16.4/node_modules/execa/lib/error.js:59:11)
	at handlePromise (/Users/griffinmullins/.vscode/extensions/particle.particle-vscode-core-1.16.4/node_modules/execa/index.js:114:26)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

Let me know if you need any other information!

Can you share the source to Argon1.ino? It's not clear why you're not getting an actual error message of why the compile failed, but it might be helpful.

Sure. Can I add you to the private github maybe? That file alone is 2K+ lines of code..

I understand not wanting to go through all that code, but what are things that could cause the cloud compile to fail but local compile to complete without errors? I can try and debug with that direction.

Tried relaunching VSC, cleaning and updating but getting a similar error for cloud compile:

Updating CLI... no plugins to update.
Error: Command failed with exit code 1: /Users/griffinmullins/.vscode/extensions/particle.particle-vscode-core-1.16.5/src/cli/bin/darwin/amd64/particle cloud compile argon --target 5.1.0 --no-update-check
Updating CLI... no plugins to update.

Compiling code for argon
Targeting version: 5.1.0

Including:
    lib/Drop/src/Drop.cpp
    lib/Drop/src/Drop.h
    lib/Hour/src/Hour.cpp
    lib/Hour/src/Hour.h
    lib/JsonParserGeneratorRK/docs/src/spark_wiring_print.h
    lib/JsonParserGeneratorRK/docs/src/spark_wiring_printable.h
    lib/JsonParserGeneratorRK/docs/src/spark_wiring_string.h
    lib/JsonParserGeneratorRK/src/JsonParserGeneratorRK.cpp
    lib/JsonParserGeneratorRK/src/JsonParserGeneratorRK.h
    lib/JsonParserGeneratorRK/test/JsonTest.cpp
    lib/JsonParserGeneratorRK/test/gcclib/Particle.h
    lib/JsonParserGeneratorRK/test/gcclib/helpers.cpp
    lib/JsonParserGeneratorRK/test/gcclib/rng_hal.h
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_print.cpp
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_print.h
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_printable.h
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_stream.h
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_string.cpp
    lib/JsonParserGeneratorRK/test/gcclib/spark_wiring_string.h
    lib/JsonParserGeneratorRK/test/gcclib/string_convert.h
    lib/JsonParserGeneratorRK/test/gcclib/system_tick_hal.h
    lib/JsonParserGeneratorRK/test/gcclib/test1.cpp
    lib/SetupStatus/src/SetupStatus.cpp
    lib/SetupStatus/src/SetupStatus.h
    lib/neopixel/src/neopixel.cpp
    lib/neopixel/src/neopixel.h
    lib/neopixel/src/neopixel/neopixel.h
    project.properties
    src/Argon1.cpp
    src/Argon1.ino
    src/StripAnimator.cpp
    src/StripAnimator.h

attempting to compile firmware
Compile failed: Processing  src/Argon1.ino
Checking library JsonParserGeneratorRK...
Checking library neopixel...
Installing library neopixel 1.0.1 to lib/neopixel ...
Library neopixel 1.0.1 installed.
Installing library JsonParserGeneratorRK 0.1.5 to lib/JsonParserGeneratorRK ...
Library JsonParserGeneratorRK 0.1.5 installed.
	at makeError (/Users/griffinmullins/.vscode/extensions/particle.particle-vscode-core-1.16.5/node_modules/execa/lib/error.js:59:11)
	at handlePromise (/Users/griffinmullins/.vscode/extensions/particle.particle-vscode-core-1.16.5/node_modules/execa/index.js:114:26)
	at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

- - - -

Have you made any modifications to the source in lib/ in your project? If you have, and you did not remove the entries from project.properties the cloud compile will upload the changed versions then ignore them and use the version in the cloud compile.

Actually, it's not a bad idea to change the lines in project.properties that look sort of like this:

dependencies.neopixel=1.0.1
dependencies.JsonParserGeneratorRK=0.1.5

instead to:

orig_dependencies.neopixel=1.0.1
orig_dependencies.JsonParserGeneratorRK=0.1.5

This will force cloud and local compile to both use the same version that you have in your lib directory.

You may also want to delete the lib/JsonParserGeneratorRK/test directory. That shouldn't have been in the uploaded library.

The other situation is that there is a time limit for how long a cloud compile can take. It's a few minutes. If the compile takes too long it terminates and does not always return a reasonable error.

The other thing you can try is invoking the cloud compile from a terminal window and see if it returns a better error. Use Particle: Launch CLI from the command palette then from the terminal window:

particle compile argon . --target 5.1.0

Thank you for the tips!
Compiling in the terminal gave a more useful error code, where "Math.h" didn't exist.
I adjusted it to use a lowercase "m" and everything is working.
Thanks again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.