# Mender-client version unknown

**URL:** <https://hub.mender.io/t/mender-client-version-unknown/656>\
**Category:** General Discussions\
**Created:** [June 1, 2019, 3:49pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656 "2019-06-01T15:49:03Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 1, 2019, 3:49pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/1 "2019-06-01T15:49:03Z")

</div>

Hello everybody.

I have a minor problem with the cross compilation of Mender-client.  
Everything works great but when I run “mender -version” the shown version is unknown. (So in mender server the version of Mender client for every device is unknown too).

Perhaps I am missing some parameter that has to be given when compailing.

Any body has faced this?

best regards.

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [June 1, 2019, 4:05pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/2 "2019-06-01T16:05:49Z")

</div>

Hi @aro86 welcome. How do you crosscompile mender-client? Using some build system or manually? Thanks.

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 1, 2019, 4:47pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/3 "2019-06-01T16:47:58Z")

</div>

Hi @MarekBelisko, thanks for your response.

I compile it with a script:

LIBLZMA\_INSTALL\_PATH="$(pwd)/install"

cd $GOPATH  
if [cpu == "armv8"]; then GOARCH="arm64" CGO\_CFLAGS="-mtune=cortex-a53 -I{LIBLZMA\_INSTALL\_PATH}/include"  
CGO\_LDFLAGS="-L${LIBLZMA\_INSTALL\_PATH}/lib"  
else  
echo “Error: unsupported processor type: $cpu”  
exit 1  
fi

printf -v ARCH “%sv%s” $GOARCH  
echo “Building binary for $ARCH architecture…”

go clean $package  
env CGO\_ENABLED=1 CC=$CC GOOS=$GOOS GOARCH=$GOARCH CGO\_CFLAGS="$CGO\_CFLAGS" CGO\_LDFLAGS="$CGO\_LDFLAGS" go build -o $output\_file $package

---

<div class="post-metadata">

**Author:** ![MarekBelisko](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/marekbelisko/32/33_2.png) [@MarekBelisko](https://hub.mender.io/u/MarekBelisko)\
**Post date:** [June 1, 2019, 4:51pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/4 "2019-06-01T16:51:03Z")

</div>

Thanks.Looks like yo want to crossompile it so in this case pls use info (scripts) from this [repo](https://github.com/mendersoftware/mender-crossbuild)

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 1, 2019, 5:01pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/5 "2019-06-01T17:01:13Z")

</div>

@MarekBelisko I based my script on [https://github.com/mendersoftware/mender-crossbuild/blob/master/go-executable-build.sh](https://github.com/mendersoftware/mender-crossbuild/blob/master/go-executable-build.sh) , but the version in the bianry is missing. Nevertheless the binary is well compiled and works fine in my board.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 3, 2019, 7:45am UTC](https://hub.mender.io/t/mender-client-version-unknown/656/6 "2019-06-03T07:45:59Z")

</div>

The version is set if you use the `Makefile` in mendersoftware/mender, and specifically these lines,

> <https://github.com/mendersoftware/mender/blob/master/Makefile#L25-L28>

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 3, 2019, 8:52am UTC](https://hub.mender.io/t/mender-client-version-unknown/656/7 "2019-06-03T08:52:45Z")

</div>

Thanks a lot @mirzak

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 3, 2019, 10:17am UTC](https://hub.mender.io/t/mender-client-version-unknown/656/8 "2019-06-03T10:17:09Z")

</div>

@mirzak how can I open a pull request to add the needed changes to add the version when compiling with go-executable-build.sh?

I have tried with my github user but (as expected) I do not have permission for that.

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 3, 2019, 10:37am UTC](https://hub.mender.io/t/mender-client-version-unknown/656/9 "2019-06-03T10:37:59Z")

</div>

@mirzak I have created ticket:

[https://tracker.mender.io/browse/MEN-2576](https://tracker.mender.io/browse/MEN-2576)

Where i have added a possible solution for showing the version when compiling with go-executable-build.sh

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 3, 2019, 11:02am UTC](https://hub.mender.io/t/mender-client-version-unknown/656/10 "2019-06-03T11:02:49Z")

</div>

> [@aro86](#):
>
> @mirzak how can I open a pull request to add the needed changes to add the version when compiling with go-executable-build.sh?

You first need to fork the repository on github, make the necessary changes, push to your fork and then create the pull-request

---

<div class="post-metadata">

**Author:** ![aro86](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/aro86/32/66_2.png) [@aro86](https://hub.mender.io/u/aro86)\
**Post date:** [June 3, 2019, 2:07pm UTC](https://hub.mender.io/t/mender-client-version-unknown/656/11 "2019-06-03T14:07:09Z")

</div>

> [@mirzak](#):
>
> You first need to fork the repository on github, make the necessary changes, push to your fork and then create the pull-request

> <https://github.com/mendersoftware/mender-crossbuild/pull/2>
>
> Related issue: https://tracker.mender.io/browse/MEN-2576
