# Building mender client on master branch fails due to usrmerge

**URL:** <https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544>\
**Category:** General Discussions\
**Created:** [February 9, 2024, 9:44pm UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544 "2024-02-09T21:44:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zach-welch-aquabyte](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/zach-welch-aquabyte/32/1564_2.png) [@zach-welch-aquabyte](https://hub.mender.io/u/zach-welch-aquabyte)\
**Post date:** [February 9, 2024, 9:44pm UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/1 "2024-02-09T21:44:27Z")

</div>

I am working to bring up Mender on our board with the `master` branch, and I am seeing the `mender_4.0.0.bb` recipe fail with the following error:

```auto
sed: can't read .../build/tmp/work/armv8a_tegra-oe4t-linux/mender/4.0.0/image/usr/lib/systemd/system/mender-updated.service: No such file or directory

```

That file gets installed in `/lib/...`, not `/usr/lib/...`. This appears to be due to the new `usrmerge` feature, but I have not been able to track down the exact place where things go sideways.

Any ideas?

---

<div class="post-metadata">

**Author:** ![zach-welch-aquabyte](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/zach-welch-aquabyte/32/1564_2.png) [@zach-welch-aquabyte](https://hub.mender.io/u/zach-welch-aquabyte)\
**Post date:** [February 13, 2024, 4:04am UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/2 "2024-02-13T04:04:20Z")

</div>

I dug into this a little deeper and found that this service unit is installed by `support/CMakeLists.txt`, in the mender client source repository. That’s where I stopped digging, as I have a nasty allergy to cmake. 😷

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 13, 2024, 10:51am UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/3 "2024-02-13T10:51:59Z")

</div>

Hi @zach-welch-aquabyte,

I could reproduce it and it is indeed a mixture of the `usrmerge`-aware pieces in the Yocto build, and the non-aware parts in the `cmake` parts. Already poked the devs, will keep you updated.

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [February 13, 2024, 11:59am UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/4 "2024-02-13T11:59:29Z")

</div>

Thanks, we’ve created [MEN-7038](https://northerntech.atlassian.net/browse/MEN-7038) to investigate this.

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [February 13, 2024, 5:10pm UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/5 "2024-02-13T17:10:56Z")

</div>

@zach-welch-aquabyte as a side note, I think the Golang client is not affected by the `usrmerge` issue. Maybe sticking with it for a bit more time until this is fixed is a viable workaround for you?

Greets,  
Josef

---

<div class="post-metadata">

**Author:** ![zach-welch-aquabyte](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/zach-welch-aquabyte/32/1564_2.png) [@zach-welch-aquabyte](https://hub.mender.io/u/zach-welch-aquabyte)\
**Post date:** [February 13, 2024, 7:31pm UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/6 "2024-02-13T19:31:03Z")

</div>

I just took a quick look at switching back to the Go client, and my experiments with `PREFERRED_VERSION` and `PREFERRED_PROVIDER` did not work to select the old `mender-client` recipes over the new `mender` client. What’s the trick?

---

<div class="post-metadata">

**Author:** ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)\
**Post date:** [February 14, 2024, 7:00am UTC](https://hub.mender.io/t/building-mender-client-on-master-branch-fails-due-to-usrmerge/6544/7 "2024-02-14T07:00:03Z")

</div>

You just need to do the opposite of [enabling the 4.0 client](https://docs.mender.io/3.7/troubleshoot/yocto-project-build#mender-client-version-4-0-0-have-been-released-but-my-build-stil). The old client provider is “mender-client”, the new one is simply “mender”:

```auto
PREFERRED_PROVIDER_mender-native = "mender-client-native"
PREFERRED_RPROVIDER_mender-auth = "mender-client"
PREFERRED_RPROVIDER_mender-update = "mender-client"

```

`PREFERRED_VERSION` doesn’t need to be set, since they are different packages.
