Building Copter releases fails

I’ve posted this in the ArduCopter (Building older versions - #10 by jmb275), but am not getting answers. I figured the development team might know better.

Bottom line is, on a MacBook Pro (circa 2018), with macOS 11.2.3, and python 3.9.1 executing the following:

git clone --recurse-submodules GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source
git checkout Copter-4.0.7
git submodule update --init --recursive
./waf configure --board CubeOrange
./waf copter

yields the following error:

Waf: Leaving directory `ardupilot/build/CubeOrange'
Build failed
Traceback (most recent call last):
  File "ardupilot/modules/waf/waflib/Task.py", line 338, in process
    ret = self.run()
  File "Tools/ardupilotwaf/mavgen.py", line 62, in run
    if mavgen.mavgen(mavgen_options(), [xml]):
  File "ardupilot/modules/mavlink/pymavlink/generator/mavgen.py", line 143, in mavgen
    xml.append(mavparse.MAVXML(fname, opts.wire_protocol))
  File "ardupilot/modules/mavlink/pymavlink/generator/mavparse.py", line 427, in __init__
    m.crc_extra = message_checksum(m)
  File "ardupilot/modules/mavlink/pymavlink/generator/mavparse.py", line 454, in message_checksum
    crc.accumulate_str(msg.name + ' ')
  File "ardupilot/modules/mavlink/pymavlink/generator/mavcrc.py", line 34, in accumulate_str
    bytes.fromstring(buf)
AttributeError: 'array.array' object has no attribute 'fromstring'

It would appear that perhaps the wrong version of mavlink/pymavlink is connected with the Copter-4.0.* tags or something. The other thread referenced above has more details. I’ve tried about every permutation of the commands I can think of and nothing seems to work. BUT a clean clone of branch master does build on my machine, so it’s not an issue with my setup (I don’t think).

I assume I’m missing something obvious.

hello, I tried to build the older version too but it is 4.1.0-rc3 and I didn’t meet any error in compiling process. If you would like to know, it is so:

  1. Fork the repo to your github
  2. git checkout “Copter-4.1”

  3. git submodule update --init --recursive

  4. cd ardupilot

  5. ./waf configure --board CubeOrange

  6. ./waf copter

And I use Python version 2.7.18 and Linux. If you have Python 3 in your computer just download Python 2 and set the priority to Python 2 and it should be ok. I am very interest in drone - building. If you would like to talk about this subject, I would write my Discord here. We can chat about this topic sometimes.

Master pymavlink has a fix for this.