Building for ESP8266 on macOS Big Sur

Hi all,

I’m having problems building demo-c for esp8266 using a Mac

  1. My goal is: to run mos example on a Big Sur host with ESP8266 target

  2. My actions are:
    install using brew
    clone demo-c
    mos build --platform esp8266 --clean

  3. The result I see is: Build fail

In logs,
#if CS_PLATFORM == CS_P_ESP32 (and many other similar)

Neither CS_PLATFORM nor CS_P_ESP32 appear to be defined, consequently both default to 0. This might mean that this line evaluates to true.

Depending on compiler mode (treat all warnings as errors, for instance), this is sufficient to fail the build.

I get the same result with both cloud-based and local builds.

  1. My expectation & question is:

Building the example doesn’t work, but I’d expect it to.

On the same machine, I create a Debian VM, passthrough the USB serial port connected to the ESP8266 device, install MOS from apt-get and I can clone, build and flash the same code to the device (so it’s not a hardware setup or build config issue).

Thanks

(SOLVED)

I see the same problem with macOS Catalina. I haven’t look at mos since around 2018 and was probably using High Sierra back then.

Anyway, it seems I have solved the problem, and the answer is to rebuild mos from source using the instructions at https://github.com/mongoose-os/mos

The following leads to a clean and successful build of demo-c on a macOS Big Sur host:

  1. brew install coreutils libftdi libusb-compat pkg-config

  2. brew install go (go is listed as a dependency, but it is not satisfied by the brew install command above, which is as per the instructions)

  3. git clone https://github.com/mongoose-os/mos

  4. cd mos

  5. make

  6. cp mos ~/bin

  7. cd ..

  8. export PATH=~/bin:$PATH

  9. mos clone https://github.com/mongoose-os-apps/demo-c demo-c

  10. cd demo-c

  11. mos build --platform esp8266

…and all is good with the world.

hm