guild icon
Toit
#Can I separate compile and install?
Thread channel in help
Adam
Adam 11/24/2024 10:56 AM
1. I can compile on windows 11:

C:\Users\lenovo\.cache\jaguar\sdk\bin\toit.compile.exe -o esp32_binary .\hello_world.toit
This ^^^ compile to windows os and arch.

[--os <system>] // Cross-compilation system target.
[--arch <architecture>] // Cross-compilation architecture target.

Can I set these ^^^ options somehow to compile for esp32?

2. If 1. above work, I can copy the esp32_binary output file and the jag_linux_arm.tgz to a router with openwrt OS.

Can I run "jag scan" on the router to detect the esp32 behind router, and run "jag container install ..." to install the compiled esp32_binary?

I don't wan't to run "toit.compile" on openwrt (if possible).

My developer laptop is not on the same wifi network as the target esp32. I have no experience. Is this scenario possible? Or any better idea?
AdamOPAdam
1. I can compile on windows 11: C:\Users\lenovo\.cache\jaguar\sdk\bin\toit.compile.exe -o esp32_binary .\hello_world.toit This ^^^ compile to windows os and arch. [--os <syst...
floitsch
floitsch 11/24/2024 10:59 AM
I'm not 100% certain it's possible, but if not then it's just an oversight that can be easily fixed.

When compiling for the esp32 we want to get a "snapshot" (with the --snapshot option of toit compile).
floitsch
floitsch 11/24/2024 10:59 AM
As long as that snapshot comes from the same SDK as the version that is running on the device you can then send the bytecodes to the device.
floitsch
floitsch 11/24/2024 11:01 AM
It could be that jag (the executable) doesn't support that yet, but internally it itself compiles to a snapshot first, so adding support for it would just require to add a new command (or check) that skips the compilation and takes the snapshot you provide.
floitsch
floitsch 11/24/2024 11:01 AM
I can check in a few minutes(edited)
Adam
Adam 11/24/2024 11:04 AM
Thanks for the answer, this --snapshot option for toit.compile seems to be great.
jag container install help
this command not have snapshot option
floitsch
floitsch 11/24/2024 11:05 AM
I just looked at the sources: I think jag container install just looks at the file you give and verifies if it is already a snapshot: https://github.com/toitlang/jaguar/blob/6550830ca6904fed2c8fb368a6be3407b6e4d52a/cmd/jag/commands/run.go#L257
Use live reloading over WiFI to turbo-charge developing for your ESP32. - toitlang/jaguar
AdamOPAdam
Thanks for the answer, this --snapshot option for toit.compile seems to be great. jag container install help this command not have snapshot option
floitsch
floitsch 11/24/2024 11:07 AM
Also: I would recommend to start using toit compile instead of toit.compile. we are planning to phase out (or at least hide) the toit.xxx binaries.
👍1
floitschfloitsch
I just looked at the sources: I think jag container install just looks at the file you give and verifies if it is already a snapshot: https://github.com/toitlang/jaguar/blob/6550...
Adam
Adam 11/24/2024 11:13 AM
"I just looked at the sources: I think jag container install just looks at the file you give and verifies if it is already a snapshot"
If I understand you well, jag container install accept:
- a source code file, and compile with toit compile
- or accept a compiled snapshot file and use it without compilation
floitsch
floitsch 11/24/2024 11:18 AM
Correct
👍1
10 messages in total