Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 667634 - sys-apps/nvme-cli: libuuid selection broken when cross compiling
Summary: sys-apps/nvme-cli: libuuid selection broken when cross compiling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Zac Medico
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-03 07:37 UTC by gwendal grignou
Modified: 2018-10-04 17:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch that remove udev and add uuid variables. (0001-nvme-cli-Use-uuid-USE-variable.patch,2.86 KB, application/mbox)
2018-10-03 07:37 UTC, gwendal grignou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gwendal grignou 2018-10-03 07:37:04 UTC
Created attachment 549132 [details]
Patch that remove udev and add uuid variables.

nmve-cli decides to use uuid library by using LD:

LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)

nvme-cli cross-compilation will fail if libuuid is present on the host machine but util-linux is not on the target machine.
Comment 1 gwendal grignou 2018-10-03 18:19:48 UTC
See https://bugs.chromium.org/p/chromium/issues/detail?id=891527 for emerge error:

  nvme-cli-1.6: >>> Compiling source in /build/fizz/tmp/portage/sys-apps/nvme-cli-1.6/work/nvme-cli-1.6 ...
  nvme-cli-1.6: make -j32 LIBUDEV=1 
  nvme-cli-1.6: NVME_VERSION = 1.6
  nvme-cli-1.6: x86_64-cros-linux-gnu-clang -D_GNU_SOURCE -D__CHECK_ENDIAN__  -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.6"' -c argconfig.c
  nvme-cli-1.6: x86_64-cros-linux-gnu-clang -D_GNU_SOURCE -D__CHECK_ENDIAN__  -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.6"' -c suffix.c
  nvme-cli-1.6: x86_64-cros-linux-gnu-clang -D_GNU_SOURCE -D__CHECK_ENDIAN__  -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.6"' -c parser.c
  nvme-cli-1.6: x86_64-cros-linux-gnu-clang -D_GNU_SOURCE -D__CHECK_ENDIAN__  -O2 -pipe  -march=corei7 -g -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 -DLIBUUID -DNVME_VERSION='"1.6"' -c nvme-print.c
...
  nvme-cli-1.6: In file included from nvme-print.c:6:
  nvme-cli-1.6: In file included from ./nvme-print.h:4:
  nvme-cli-1.6: [1m./nvme.h:27:10: [0m[0;1;31mfatal error: [0m[1m'uuid/uuid.h' file not found[0m
  nvme-cli-1.6: #include <uuid/uuid.h>
  nvme-cli-1.6: [0;1;32m         ^~~~~~~~~~~~~
  nvme-cli-1.6: [0mIn file included from lnvm-nvme.c:4:
  nvme-cli-1.6: [1m./nvme.h:27:10: [0m[0;1;31mfatal error: [0m[1m'uuid/uuid.h' file not found[0m
  nvme-cli-1.6: #include <uuid/uuid.h>
  nvme-cli-1.6: [0;1;32m         ^~~~~~~~~~~~~
  nvme-cli-1.6: [0m1 error generated.
...

Makefile is checking against the host library, not the target environment.

Add USE flag uuid, remove USE flag udev as nvme-cli does not depend on udev anymore. [http://lists.infradead.org/pipermail/linux-nvme/2016-December/007493.html]
Comment 2 Larry the Git Cow gentoo-dev 2018-10-04 17:35:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca10e85174d27707ad3fe879f664f43f405d43ab

commit ca10e85174d27707ad3fe879f664f43f405d43ab
Author:     Gwendal Grignou <gwendal@chromium.org>
AuthorDate: 2018-10-03 06:50:34 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-10-04 17:35:47 +0000

    sys-apps/nvme-cli: Use uuid USE variable
    
    Remove udev variable, nvme-cli does not use LIBUDEV anymore.
    Add option to choose uuid based on USE variable.
    
    BUG=chromium:891527
    TEST=build_package --board fizz nvme-cli compiles, without uuid code.
    
    Change-Id: I508d2776f58b7a1c96ed968dfa109acbb90e7b6d
    Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>
    Closes: https://bugs.gentoo.org/667634
    Package-Manager: Portage-2.3.50, Repoman-2.3.10

 sys-apps/nvme-cli/metadata.xml           |  3 +++
 sys-apps/nvme-cli/nvme-cli-1.6-r1.ebuild | 30 ++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)
Comment 3 Zac Medico gentoo-dev 2018-10-04 17:37:33 UTC
Thanks!