# CPackDeb default when dpkg not found

**URL:** https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755
**Category:** Development
**Tags:** cpack:deb
**Created:** [January 2, 2024, 12:55am UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755 "2024-01-02T00:55:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hpkfft](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@hpkfft](https://discourse.cmake.org/u/hpkfft)
#### Post date: [January 2, 2024, 12:55am UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755/1 "2024-01-02T00:55:14Z")

</div>

The documentation at [deb](https://cmake.org/cmake/help/latest/cpack_gen/deb.html) indicates that `CPACK_DEBIAN_PACKAGE_ARCHITECTURE` defaults to `i386` when `dpkg` is not found.

However, the `execute_process()` on line 459 in the file `cmake-3.25/Modules/Internal/CPack/CPackDeb.cmake` is not in an `else()` block. Therefore, the variable is set to an empty string when `execute_process()` is run, overwriting the string “i386”.

Since it’s not set to “i386” now, nobody is relying on this as a default. I would suggest making the default “amd64”.

Also, I would suggest mentioning the variable name in the status message to help users for whom `dpkg` is not available.  
Perhaps, “CPackDeb: Cannot find program dpkg, setting CPACK\_DEBIAN\_PACKAGE\_ARCHITECTURE to amd64.”

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 2, 2024, 1:47pm UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755/2 "2024-01-02T13:47:06Z")

</div>

The status message is certainly reasonable (WIX does it). I’m not sure how the default can be updated reliably as policies aren’t really in effect there AFAIK.

Cc: @brad.king

---

<div class="post-metadata">

### Author: ![hpkfft](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@hpkfft](https://discourse.cmake.org/u/hpkfft)
#### Post date: [January 4, 2024, 12:55am UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755/3 "2024-01-04T00:55:02Z")

</div>

If the default cannot be updated, then the documentation should be changed to state that the default is “”.

The unfortunate part is that the current default of “” is not useful to anyone. So, I would suggest updating the code (to put `execute_process()` in an `else` clause) and updating the default to what is thought to be the most useful. I suggest “amd64”. Other options would be “noarch” or “unknown” or the value of `CMAKE_SYSTEM_PROCESSOR` or something more complicated (like using “amd64” when the processor is `x86_64` and “arm64” when the processor is `aarch64`). Probably simpler is better…

---

<div class="post-metadata">

### Author: ![hpkfft](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@hpkfft](https://discourse.cmake.org/u/hpkfft)
#### Post date: [January 4, 2024, 1:11am UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755/4 "2024-01-04T01:11:05Z")

</div>

Or, “any”.  
See: [architecture](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-architecture)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 5, 2024, 2:01am UTC](https://discourse.cmake.org/t/cpackdeb-default-when-dpkg-not-found/9755/5 "2024-01-05T02:01:55Z")

</div>

Filing an issue would be the next step here. Whether a new default is OK or not can be determined there.
