Cmake plugin 'not supported' error for arm64 target

Is cmake not a supported plugin for arm64 target?

I am trying to build below snap on an amd64 build VM

user@dev:~/armcrosscompile$ SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft pull os-build-scripts --target-arch=arm64 --debug
Setting target machine to 'arm64'
The plugin used by 'util' does not support cross-compiling to a different target architecture.
user@dev:~/armcrosscompile/os-core$

related snapcraft.yaml snippet:

   parts:
     util:                                                                       
       source: src                    
       plugin: cmake                                                                
       override-pull: |                                                             
         snapcraftctl pull                                                             
       configflags:                                                                    
         - -DCMAKE_INSTALL_PREFIX=/usr                                                 
       override-build: |-                                                              
           snapcraftctl build                                                          
       prime:                                                                          
         - -libutil.so rm -rf usr/include
1 Like

cross compiling is not a supported way of using it … the plugin is definitely supported …

Other plugins like nil, dump, go, kernel and make are supported in cross compile. So wondering why cmake is not. Any idea if this is work in progress? If not, any suggestions for workaround?

Is the make plugin really supported for cross-compilation? For me (version 4.0.7 and target is armhf) it is just autotools and dump.

(Disclaimer: I’m new to snapcraft, so it is highly likely I’m the reason things are not working!)

yes, there are a few exceptions i.e. kernels have no arch specific library dependencies and come with their own build setup that has been designed from the ground up for cross building …

nil is special as in “i do everything from a shell script in override-build anyway”

dump was formerly called copy and should just copy already built things around in the end …

i guess making cmake cross-ready wouldnt be impossible but surely a lot of work simply because build-dependency handling will be complex.

2 Likes

Cross-compiling support via --target-arch is quite lacking and unfortunately breaks in a number of ways. We are unlikely to improve it in its current form anytime soon. But we do understand that cross-building is desirable, and we hope to add a more supportable mechanism in the future.

Perhaps you can consider using remote-build to build your snaps for a different arch?

1 Like