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 2D49D15808B for ; Sun, 18 Feb 2024 22:49:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 84BA92BC059; Sun, 18 Feb 2024 22:49:25 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 6C8552BC059 for ; Sun, 18 Feb 2024 22:49:25 +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 31C8334310E for ; Sun, 18 Feb 2024 22:49:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D173D14D8 for ; Sun, 18 Feb 2024 22:49:21 +0000 (UTC) From: "Horodniceanu Andrei" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Horodniceanu Andrei" Message-ID: <1708266168.d5063fd94813514c29539b5bd9baddfa3954b2f6.a.horodniceanu@gentoo> Subject: [gentoo-commits] repo/user/dlang:master commit in: eclass/ X-VCS-Repository: repo/user/dlang X-VCS-Files: eclass/dmd.eclass X-VCS-Directories: eclass/ X-VCS-Committer: a.horodniceanu X-VCS-Committer-Name: Horodniceanu Andrei X-VCS-Revision: d5063fd94813514c29539b5bd9baddfa3954b2f6 X-VCS-Branch: master Date: Sun, 18 Feb 2024 22:49:21 +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: 79748138-b0b6-48f6-bd91-17453c0c663d X-Archives-Hash: 5bdf8e05ebd773701685a4b78b3dd38f commit: d5063fd94813514c29539b5bd9baddfa3954b2f6 Author: Horodniceanu Andrei proton me> AuthorDate: Sun Feb 18 14:22:48 2024 +0000 Commit: Horodniceanu Andrei proton me> CommitDate: Sun Feb 18 14:22:48 2024 +0000 URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=d5063fd9 dmd.eclass: explicitly specify arguments to dmd in tests Refactor the test code a little for better readability and prevent linking by default to libphosbos2.a, which happens to work only because the build wrongfully generates both shared and static libraries regardless of USE=static-libs. Pass the same options to dmd as the ones in the installed dmd.conf to get a closer setup to what the user will have installed on their system. Signed-off-by: Horodniceanu Andrei proton.me> eclass/dmd.eclass | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/eclass/dmd.eclass b/eclass/dmd.eclass index 1e49af7..52e4209 100644 --- a/eclass/dmd.eclass +++ b/eclass/dmd.eclass @@ -233,7 +233,22 @@ dmd_src_compile() { dmd_src_test() { test_hello_world() { - "$(dmd_gen_exe_dir)/dmd" -m${MODEL} -fPIC -Iphobos -Idruntime/import -L-Lphobos/generated/linux/release/${MODEL} samples/d/hello.d || die "Failed to build hello.d (${MODEL}-bit)" + local phobosDir=phobos/generated/linux/release/"${MODEL}" + local commandArgs=( + # Copied from below, where dmd.conf is generated + -L--export-dynamic + -defaultlib=phobos2 # If unspecified, defaults to libphobos2.a + -fPIC + -L-L"${phobosDir}" + -L-rpath="${phobosDir}" + + -conf= # Don't use dmd.conf + -m"${MODEL}" + -Iphobos + -Idruntime/import + ) + "$(dmd_gen_exe_dir)/dmd" "${commandArgs[@]}" samples/d/hello.d \ + || die "Failed to build hello.d (${MODEL}-bit)" ./hello ${MODEL}-bit || die "Failed to run test sample (${MODEL}-bit)" rm hello.o hello || die "Could not remove temporary files" }