In my airsdk mission I am using the paho-mqtt-c library.
For this I have a dependency in the mission.yaml file like this:
deps:
paho-mqtt-c:
type: alchemy
The dependency has the following file structure:
> tree deps
deps
└── paho-mqtt-c
├── atom.mk
└── paho.mqtt.c-1.3.12.tar.gz
Where the sources in the tar.gz file are from Github and the atom.mk file has the following content:
LOCAL_PATH := $(call my-dir)
# Build and copy paho mqtt libraries
# Build paho.mqtt.c
include $(CLEAR_VARS)
LOCAL_MODULE := paho-mqtt-c
LOCAL_CATEGORY_PATH := libs
LOCAL_ARCHIVE_VERSION := 1.3.12
LOCAL_ARCHIVE := paho.mqtt.c-$(LOCAL_ARCHIVE_VERSION).tar.gz
LOCAL_ARCHIVE_SUBDIR := paho.mqtt.c-$(LOCAL_ARCHIVE_VERSION)
LOCAL_CMAKE_CONFIGURE_ARGS += -DPAHO_WITH_SSL=TRUE
LOCAL_EXPORT_LDLIBS += -lpaho-mqtt3as
include $(BUILD_CMAKE)
Building the project does work, however, when I try to rebuild it, I get the following error, because airsdk does not clean up the files:
Traceback (most recent call last):
File "/usr/bin/airsdk", line 10, in <module>
sys.exit(main())
File "/opt/parrot-airsdk/parrot-airsdk-cli/lib/python3.8/site-packages/airsdk_cli/main.py", line 183, in build
status = mission.build(version, verbose)
File "/opt/parrot-airsdk/parrot-airsdk-cli/lib/python3.8/site-packages/airsdk_cli/mission/mission.py", line 913, in build
ret = build.build(version, verbose)
File "/opt/parrot-airsdk/parrot-airsdk-cli/lib/python3.8/site-packages/airsdk_cli/mission/mission.py", line 294, in build
return self.post_build(version=version)
File "/opt/parrot-airsdk/parrot-airsdk-cli/lib/python3.8/site-packages/airsdk_cli/mission/mission.py", line 300, in post_build
ret = self._gen_payload_tree()
File "/opt/parrot-airsdk/parrot-airsdk-cli/lib/python3.8/site-packages/airsdk_cli/mission/mission.py", line 388, in _gen_payload_tree
shutil.copytree(src_path, dst_path, symlinks=True, dirs_exist_ok=True)
File "/usr/lib/python3.8/shutil.py", line 557, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
File "/usr/lib/python3.8/shutil.py", line 513, in _copytree
raise Error(errors)
shutil.Error: [('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3cs.so.1', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3cs.so.1', "[Errno 17] File exists: 'libpaho-mqtt3cs.so.1.3.12' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3cs.so.1'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3as.so.1', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3as.so.1', "[Errno 17] File exists: 'libpaho-mqtt3as.so.1.3.12' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3as.so.1'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3a.so.1', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3a.so.1', "[Errno 17] File exists: 'libpaho-mqtt3a.so.1.3.12' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3a.so.1'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3c.so', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3c.so', "[Errno 17] File exists: 'libpaho-mqtt3c.so.1' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3c.so'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/python', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/python', "[Errno 17] File exists: 'python3.11' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/python'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3a.so', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3a.so', "[Errno 17] File exists: 'libpaho-mqtt3a.so.1' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3a.so'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3c.so.1', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3c.so.1', "[Errno 17] File exists: 'libpaho-mqtt3c.so.1.3.12' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3c.so.1'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3as.so', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3as.so', "[Errno 17] File exists: 'libpaho-mqtt3as.so.1' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3as.so'"), ('/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/usr/lib/libpaho-mqtt3cs.so', '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3cs.so', "[Errno 17] File exists: 'libpaho-mqtt3cs.so.1' -> '/home/user/testmission/.airsdk/out/testmission-anafi2_pc/final/missions/com.apb.missions.testmission/payload/lib/libpaho-mqtt3cs.so'")]
I can manually fix this problem by deleting the conflicting files before rebuilding, however it seems like this could be fixed within the airsdk-cli tool?