ZeroCM / zcm

Zero Communications and Marshalling
http://zerocm.github.io/zcm/
GNU Lesser General Public License v2.1
233 stars 67 forks source link

Debian package has wrong architecture on aarch64 #404

Closed jacobschloss closed 1 year ago

jacobschloss commented 1 year ago

When building the debian package with ./scripts/make_debian_package.sh, the created package uses a control file with the architecture hard-coded to amd64. The prevents use of the package on aarch64, even though it was built locally on a aarch64 host.

Eg, installing gives this error:

user@host:zcm$ sudo dpkg -i ./build/zcm_1.1.5_amd64.deb
dpkg: error processing archive ./build/zcm_1.1.5_amd64.deb (--install):
 package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
 ./build/zcm_1.1.5_amd64.deb

Using a detected architecture from eg dpkg --print-architecture, or something at configure time might be better (but this won't work during cross compile - I know how to set this for a cmake based cross packing system, but not waf + scripts)

jacobschloss commented 1 year ago

Manually setting zcm/DEBIAN/control.in Architecture line to arm64 did allow creating an installable ./build/zcm_1.1.5_arm64.deb file.

jacobschloss commented 1 year ago

Looks like waf can detect the platform in ctx.env.DEST_CPU, so maybe possible with a variable substitution?

Adding this to the wscript: print('waf thinks platform is: {:s}'.format(ctx.env.DEST_CPU))

prints out waf thinks platform is: aarch64

So the platform is being detected correctly. Would need to add the substitution to control.in and map from waf platform names to debian control file platform names.

jacobschloss commented 1 year ago

Ok basic detection for aarch64 and amd64 seems to work:

https://github.com/suburbanmarine/zcm/commit/6664f5c798053d1cf4fb49e21dcfdd2b92d5f72b