Building locally without docker

Hi All,
I run OS X and have found local compile times with mongoose os via docker desktop to be unreasonably long sometime taking more than 5-10 minutes! When looking for a way to compile without docker I stumbled upon this repo and updated it for mos 2.20.0 with my fork here. Please take a look and offer any feedback! The installer will download a local toolchain and create a shell script you can use to invoke mos with the proper environment vars set.
I’ve tested it on OS X but I assume it will work on Linux.
Cheers,
Nic

1 Like

Hi @stopthatcow, very nice feature! I confirm that the script working on my Mac (M1 Pro). Thank you very much!

Just tried on M1 pro, I get a bunch of the below warnings then a build fail even when building the demo-c application.

<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: note: this is the location of the previous definition
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: note: this is the location of the previous definition
...
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_LFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
<command-line>: warning: "MGOS_ROOT_FS_OPTS_SPIFFS" redefined
<command-line>: note: this is the location of the previous definition
AR build/objs/bootloader_support/libbootloader_support.a
AR build/objs/esp_common/libesp_common.a
Error: exit status 2
/Users/admin/mos/cli/build_local.go:692: 
/Users/admin/mos/cli/build_local.go:475: 
/Users/admin/mos/cli/build.go:278: 
/Users/admin/mos/cli/build.go:221: 
/Users/admin/mos/cli/main.go:194: build failed

I’ve only ever use the docker based build, wondering if the stuffing around I did to get it working with M1 pro has mucked something up.

@klimbot Analize carefully full log file and search though the error. Warnings in you log is not critical for compiling the application. It must be another main error somewhere earlier in your log than the part of log you’ve posted here.

@Aleksey_Kotelnikov your powers of influence are incredible!! You weren’t even sitting over my shoulder, but when I tried to reproduce the problem it “just worked” :laughing:

Guys, I modified Mongoose OS IDE extension for VS Code for support mos-native script from @stopthatcow for native ESP32 applications compiling on MacOS. In the modified extension I also hid remote build option, because of my experience it is a lot of false clicking.

For installation it’s needed to uninstall original extension, download and install compiled package mongoose-os-ide-0.6.0.vsix from my repository: Mongoose OS IDE native and set “MOS_NATIVE” environment variable as a path to mos_build_local.sh script. All the instructions on GitHub.

Hope it will be helpful.

1 Like