Starting from the latest gentoo stage3 docker image, emerge hip fails with: FAILED: src/CMakeFiles/amdhip64.dir/hip_global.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DATI_ARCH_X86 -DATI_OS_LINUX -DCL_TARGET_OPENCL_VERSION=220 -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DCOMGR_DYN_DLL -DHAVE_CL2_HPP -DLITTLEENDIAN_CPU -DOPENCL_C_MAJOR=2 -DOPENCL_C_MINOR=0 -DOPENCL_MAJOR=2 -DOPENCL_MINOR=2 -DROCCLR_SUPPORT_NUMA_POLICY -DUSE_COMGR_LIBRARY -DWITH_HSA_DEVICE -DWITH_LIGHTNING_COMPILER -DWITH_LIQUID_FLASH=0 -D__HIP_ENABLE_RTC -D__HIP_PLATFORM_AMD__ -Damdhip64_EXPORTS -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/HIP-rocm-5.0.2/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2_build/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib/backends/common -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../device -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../elf -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../../../amdocl -isystem /usr/include/hsa -O2 -pipe -fPIC -std=c++17 -MD -MT src/CMakeFiles/amdhip64.dir/hip_global.cpp.o -MF src/CMakeFiles/amdhip64.dir/hip_global.cpp.o.d -o src/CMakeFiles/amdhip64.dir/hip_global.cpp.o -c /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp: In function ‘size_t amd_dbgapi_get_build_id()’: /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:18:3: error: return-statement with no value, in function returning ‘size_t’ {aka ‘long unsigned int’} [-fpermissive] 18 | return HIP_VERSION_BUILD_ID; | ^~~~~~ /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp: In destructor ‘hip::DeviceVar::~DeviceVar()’: /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:65:22: warning: ignoring returned value of type ‘hipError_t’, declared with attribute ‘nodiscard’ [-Wunused-result] 65 | ihipUnbindTexture(texRef); | ~~~~~~~~~~~~~~~~~^~~~~~~~ In file included from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.hpp:9, from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:1: /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_internal.hpp:439:19: note: in call to ‘hipError_t ihipUnbindTexture(textureReference*)’, declared here 439 | extern hipError_t ihipUnbindTexture(textureReference* texRef); | ^~~~~~~~~~~~~~~~~ In file included from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.hpp:7, from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:1: /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/HIP-rocm-5.0.2/include/hip/hip_runtime_api.h:317:3: note: ‘hipError_t’ declared here 317 | } hipError_t; | ^~~~~~~~~~ Reproducible: Always Steps to Reproduce: 1. docker pull gentoo/stage3 2. docker run -it gentoo/stage3 bash 3. emerge hip
Created attachment 786695 [details] build.log
Created attachment 786698 [details] emerge --info output
This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is somehow lost when cmake processes to line 293.
(In reply to Yiyang Wu from comment #3) > This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is > somehow lost when cmake processes to line 293. Oh, so if git is not installed HIP_VERSION_BUILD_ID is not set.
(In reply to Yiyang Wu from comment #4) > (In reply to Yiyang Wu from comment #3) > > This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is > > somehow lost when cmake processes to line 293. > > Oh, so if git is not installed HIP_VERSION_BUILD_ID is not set. hip build depends on git... too bad.
(In reply to Benda Xu from comment #5) > hip build depends on git... too bad. Should we add a BDEPEND or just patch it? Adding BDEPEND means we won't have to patch CMakeLists.txt, and future -9999.ebuild may benefit (upstream use git in cmake to determine various version strings).
On the other hand this should be a upstream bug -- we should patch CMakelists and submit to upstream.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93ff73188c29fe12088f6166df669847cde9b2b4 commit 93ff73188c29fe12088f6166df669847cde9b2b4 Author: Yiyang Wu <xgreenlandforwyy@gmail.com> AuthorDate: 2022-06-22 11:39:27 +0000 Commit: Benda Xu <heroxbd@gentoo.org> CommitDate: 2022-06-22 13:00:00 +0000 dev-util/hip: fix build failure when git not installed Closes: https://bugs.gentoo.org/853718 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Benda Xu <heroxbd@gentoo.org> dev-util/hip/files/hip-5.0.2-set-build-id.patch | 20 ++++++++++++++++++++ dev-util/hip/hip-5.0.2-r2.ebuild | 1 + 2 files changed, 21 insertions(+)
(In reply to Yiyang Wu from comment #7) > On the other hand this should be a upstream bug -- we should patch > CMakelists and submit to upstream. Yes, please forward the patch upstream.