From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 381C615ACFC for ; Thu, 4 May 2023 06:54:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E1B5E0B8B; Thu, 4 May 2023 06:54:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 45675E0B8B for ; Thu, 4 May 2023 06:54:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54E36341330 for ; Thu, 4 May 2023 06:54:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E4F9F8E4 for ; Thu, 4 May 2023 06:54:28 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1683183264.0fdb4d178e8a25d512d190c2cbef06c9b7a3dacb.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/spirv-llvm-translator/, dev-util/spirv-llvm-translator/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-ld_library_path.patch dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild X-VCS-Directories: dev-util/spirv-llvm-translator/files/ dev-util/spirv-llvm-translator/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 0fdb4d178e8a25d512d190c2cbef06c9b7a3dacb X-VCS-Branch: master Date: Thu, 4 May 2023 06:54:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 689a43fb-0741-4ff4-897a-d0f781db5c5a X-Archives-Hash: a31523f811ad3eba8e7a3350205c0687 commit: 0fdb4d178e8a25d512d190c2cbef06c9b7a3dacb Author: Michał Górny gentoo org> AuthorDate: Thu May 4 06:54:02 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu May 4 06:54:24 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fdb4d17 dev-util/spirv-llvm-translator: Fix tests to use LD_LIBRARY_PATH Fix tests to use LD_LIBRARY_PATH to test the freshly built library instead of the previous version already installed to the system. Closes: https://bugs.gentoo.org/905654 Signed-off-by: Michał Górny gentoo.org> ...rv-llvm-translator-16.0.0-ld_library_path.patch | 63 ++++++++++++++++++++++ .../spirv-llvm-translator-16.0.0.ebuild | 5 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-ld_library_path.patch b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-ld_library_path.patch new file mode 100644 index 000000000000..3068cd535005 --- /dev/null +++ b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-ld_library_path.patch @@ -0,0 +1,63 @@ +From c2133b18cb48b9bb9c47897b16d64c5f0547cde6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Thu, 4 May 2023 08:44:25 +0200 +Subject: [PATCH] [test] Use LD_LIBRARY_PATH to ensure that a new lib is used + (#1989) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add the library `BINARY_DIR` to `LD_LIBRARY_PATH` to ensure that +the freshly built `libLLVMSPIRVLib.so` is tested. Otherwise, llvm-spirv +spawned by the test suite may use the previously installed +`libLLVMSPIRVLib.so`. + +I have noticed the problem after rebuilding LLVM with +`-DLLVM_ENABLE_ASSSERTIONS=ON`. This meant that the previous version +of `libLLVMSPIRVLib.so` now crashed, effectively causing the test suite +to fail incorrectly. + +Signed-off-by: Michał Górny +--- + test/CMakeLists.txt | 1 + + test/lit.cfg.py | 3 ++- + test/lit.site.cfg.py.in | 1 + + 3 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 235f6d0a0..355baffb8 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -3,6 +3,7 @@ llvm_canonicalize_cmake_booleans(SPIRV_SKIP_DEBUG_INFO_TESTS) + + # required by lit.site.cfg.py.in + get_target_property(LLVM_SPIRV_DIR llvm-spirv BINARY_DIR) ++get_target_property(LLVM_SPIRV_LIB_DIR LLVMSPIRVLib BINARY_DIR) + set(LLVM_SPIRV_TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + if(SPIRV_TOOLS_FOUND AND NOT SPIRV-Tools-tools_FOUND) +diff --git a/test/lit.cfg.py b/test/lit.cfg.py +index 4b66412c3..fd8d3f94c 100644 +--- a/test/lit.cfg.py ++++ b/test/lit.cfg.py +@@ -76,6 +76,7 @@ + else: + config.substitutions.append(('spirv-val', ':')) + ++llvm_config.with_system_environment('LD_LIBRARY_PATH') + if using_spirv_tools: +- llvm_config.with_system_environment('LD_LIBRARY_PATH') + llvm_config.with_environment('LD_LIBRARY_PATH', config.spirv_tools_lib_dir, append_path=True) ++llvm_config.with_environment('LD_LIBRARY_PATH', config.llvm_spirv_lib_dir, append_path=True) +diff --git a/test/lit.site.cfg.py.in b/test/lit.site.cfg.py.in +index a01f2bb34..fdc4f4319 100644 +--- a/test/lit.site.cfg.py.in ++++ b/test/lit.site.cfg.py.in +@@ -6,6 +6,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" + config.llvm_obj_root = "@LLVM_BINARY_DIR@" + config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" + config.llvm_spirv_dir = "@LLVM_SPIRV_DIR@" ++config.llvm_spirv_lib_dir = "@LLVM_SPIRV_LIB_DIR@" + config.llvm_libs_dir = "@LLVM_LIBS_DIR@" + config.llvm_shlib_dir = "@SHLIBDIR@" + config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@" diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild b/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild index 133019091e6e..fd9d9851fd82 100644 --- a/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild +++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild @@ -34,7 +34,10 @@ BDEPEND=" test? ( dev-python/lit ) " -PATCHES=( "${FILESDIR}/${PN}-16.0.0-llvm-link-llvm-dylib.patch" ) +PATCHES=( + "${FILESDIR}/${PN}-16.0.0-llvm-link-llvm-dylib.patch" + "${FILESDIR}/${PN}-16.0.0-ld_library_path.patch" +) src_prepare() { append-flags -fPIC