At this point, if I configure and then build copter (./waf copter) everything builds fine. I then try to checkout and build an older version, say Copter-4.0.6 using these steps:
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'
I get a similar error with other older builds. Am I missing something obvious? Is this a submodule issue? Any help would be appreciated.
FYI: Current build env:
MacBook Pro (circa 2018)
macOS 11.2.3
Okay, so I think there really is an error in mavlink/pymavlink. The error indicated in my original op is in the mavcrc.py file. Doing a diff of mavcrc.py between the most up-to-date checkout of ardupilot (and hence mavlink/pymavlink) and the version from the commit to mavlink/pymavlink associated with Copter-4.0.7 yields:
(on the left is the latest version, on the right is the version associated with tag Copter-4.0.7). Note that the AttributeError has been addressed.
So now, since I assume Copter-4.0.7 did build upon release, why is this error manifesting? Do I need to build against the latest version of mavlink/pymavlink? Do any of the developers have any idea why this is happening?
Yeah, I’ve now cloned the repo 3 more times in separate directories and tried various permutations of the suggested commands. None of them work. One observation is that the tags “Copter-4.0.7” and “Copter-4.0.6” (and likely others) are detached from HEAD. I’m not good enough with git to know precisely the implications of that. It doesn’t seem like that would make any difference, but it’s the only anomaly I can see.
Ubuntu 20.04 uses Python 3.8. These array methods were removed in Python 3.9. See here. Might be a quick PR to change and test those. Might be interesting to run our python with -Wd to see what else might be deprecated.
I’m stuck with the same issue.
What are the commands to run that if I may ask, thanks in advance!
I have Python 3.9.5 and 2.7.18 on my laptop
I do all these and end up with the error