Create .deb package
@Brent-A, @wes-b, and @cdedmonds how does the versioning proposal look to you?
I'm in the middle of creating these debian packages and have started to look at versioning. I am looking at creating 3 debian package
- runtime package (this will include libk4a.so, libk4arecord.so, libdepthengine.so)
- development package (this will include k4a headers and cmake files)
- tools package (this will include AzureKinectFirmwareTool, k4aviewer, k4arecorder)
For the runtime package. I'd like to have a separate package per major and minor version. The package name would be libk4a-major.minor. So, for example, package names would look like this:
- libk4a-1.1
- libk4a-1.2
- libk4a-1.3
- libk4a-2.0
- libk4a-2.2
The shared object in the the package will be named libk4a-major.minor.so (matching its package name). This will allow multiple versions to be installed next to each other. So for example, package libk4a-1.1 will install the following
- /usr/lib/<arch>/libk4a-1.1.so
- /usr/lib/<arch>/libk4arecord-1.1.so
- /usr/lib/<arch>/libk4a-1.1/libdepthengine-1.0.so
Notice that libdepthengine is placed into a folder within the libs folder. This is because libdepthengine is a private shared object and so should not be loaded by other programs.
For development packages, we will only allow one development package to be installed at a time (no side by side installments). This is to avoid nasty conflicts with mismatched header files or cmake files between versions. Package names will follow their runtime counterparts names followed by a "-dev". For example, libk4a-1.1 will have a development package libk4a-1.1-dev and will have a dependency on libk4a-1.1.
The tools package will not be versioned. We will just have one tools package libk4a-tools which depends on the latest version of libk4a.
For reference, I have been reading up on Ubuntu's Versioning Guide, Debian's Versioning Guide, and OpenSUSE's Versioning Guide
Thanks for the detailed explanation Matt. The only thing that may be concerning is that if we release a new -dev package a developer has to choose between keeping the tools package or upgrading their app to reference a newer version of the library.
I don't think I fully followed your point her Chris. You said
The only thing that may be concerning is that if we release a new -dev package a developer has to choose between keeping the tools package or upgrading their app to reference a newer version of the library.
I don't think this is true. Let's say I'm a developer with libk4a-1.1, libk4a-1.1-dev, and libk4a-tools installed on my machine. libk4a-tools has a dependency on libk4a-1.1. libk4a-1.1.-dev also has a dependency on libk4a-1.1.
We now release libk4a-1.2. We update libk4a-tools to have a dependency on libk4a-1.2. We also release libk4a-1.2.-dev, which has a dependency on libk4a-1.2.
The developer now has two options.
- Keep libk4a-1.1-dev installed on their machine and continue to development against that.
- Remove libk4a-1.1-dev and install libk4a-1.2-dev to move to develop against libk4a-1.2.
libk4a-1.1 and libk4a-1.2 can live along side each other. So the fact that libk4a-tools was upgraded to need libk4a-1.2 should not affect the developer.
Ok, Thanks for the further explanation. I was confused on what was allowed side-by-side. I think the proposal looks good!
Will we have any way to roll tools back? If we developing for 1.1, then want to try out a new feature in 1.2, so we deploy 1.2 tools and dev package. When our testing is done and we want to go back to 1.1 dev package and tools, can that be done?
There is no 1.1 or 1.2 tools package. There is only the tools package which will have a dependency on the latest released runtime package.
If we are developing for 1.1 you will be able to run apt-get install libk4a-1.2-dev to test the 1.2 version. This will remove only the headers and cmake files needed to develop for 1.1 and add the headers and cmake files needed to develop for 1.2. libk4a-1.1.so and libk4a-1.2.so will both still be installed.
We want to go back to 1.1 we would run apt-get install libk4a-1.1.dev which will remove the libk4a-1.2-dev files and install the 1.1 dev files.
Is there a way to prevent having multiple "-dev" packages even enough they all have different names? It looks like we would have to list all packages we ever released? A dev would then have to actively remove and install the "-dev" packages every time they upgrade? And there won't be an automatic notification that the update is available?
Derek and I talked in person. We agreed it was ok that a developer would need to manually upgrade if they wanted to move from version 1.1 to version 1.2. We also agreed it was ok they would not get automatic notifications when the update is available.
After a lot of work on this, I'd like to change my original in library naming. Instead of having
- libk4a-1.1.so
- libk4arecord-1.2.so
- libk4arecord-2.1.so
Our libraries will be named
- libk4a.so.1.1.0
- libk4a.so.1.2.1
- libk4a.so.2.1.0
Our library soname will be
- libk4a.so.1.1
- libk4a.so.1.2
- libk4a.so.2.1
This will change our Debian package name to
- libk4a1.1
- libk4a1.2
- libk4a2.1
The main recent for this change is, even though both versioning formats (libname-version.so and libname.so.version), CMake only supports libname.so.version.
Instead of trying build hacks around CMake, I'd rather just use the supported method.
@cdedmonds, @wes-b, @MsDerekMa, and @Brent-A
Do you all have any opinion on this?
I am good with this
I talked with Brent in person. He is fine with this as well.
Two things that I see that we still need to update.
- Split the deb package into Runtime, Development, and Tools.
- Add the "LICENSE", "REDIST", and "ThirdPartyNotices" files.
This is all done. Debian packages are available on packages.microsoft.com. Instructions on how to add packages.microsoft.com are here
I'm working on getting them updated to include more recent versions of Ubuntu