Build: Empty Packages

A project that fails installation to the point were no files were installed in the WPKG directory ends up being empty. Such an installation is not considered valid because a package must have a data.tar file which is not empty (even dpkg chocks on completely empty data.tar files inside a .deb file!)

To palliate to this problem, the packager verifies that there were files added to the data.tar file. If not, an error is generated and the build process fails.

However, in some cases it is normal that a package ends up empty. An example is a system that always wants to create a set of packages. Say for example your build system generates those packages:

  • runtime
  • development
  • documentation
  • source

The runtime may end up being empty because that one project you are compiling only includes an Archive library. So you'll get files in the development environment, in the documentation, and in the source, but nothing in the runtime directory. That fails by default unless your build system is knowledgeable enough to skip on the creation of the runtime package in this case1, or you understand that the error returned by wpkg is expected.

Another way is to use the --ignore-empty-packages option to avoid the error generated by wpkg (that command line option transforms the error in a warning so wpkg still exists with 0.) Running that process may still be useful to know whether anything else is awry.

  • 1. Note that it may be better for you to make use of a file specific to each project so that you can specify a list of packages that need to be created for the project.