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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3ECF515800A for ; Sun, 27 Aug 2023 20:26:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 54F772BC019; Sun, 27 Aug 2023 20:26:36 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 29F8E2BC019 for ; Sun, 27 Aug 2023 20:26:36 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 00379335C39 for ; Sun, 27 Aug 2023 20:26:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 21342FC9 for ; Sun, 27 Aug 2023 20:26:33 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1693167973.21c41570673c156af3780b11cfbdf8cf42b3974d.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/tree-sitter-grammar.eclass X-VCS-Directories: eclass/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 21c41570673c156af3780b11cfbdf8cf42b3974d X-VCS-Branch: master Date: Sun, 27 Aug 2023 20:26:33 +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: e9ced428-c402-4e2c-aa7a-7996ac0c339d X-Archives-Hash: 491f21826c90e33b15f2a7c86f781216 commit: 21c41570673c156af3780b11cfbdf8cf42b3974d Author: Sam James gentoo org> AuthorDate: Sat Aug 26 17:52:19 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Aug 27 20:26:13 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21c41570 tree-sitter-grammar.eclass: force use of local parser.h There shouldn't be a system-wide copy of parser.h and upstream plan on dropping this from dev-libs/tree-sitter as it can cause issues if there's a mismatch between the version used for the bundled generated parser vs the header used to build the library. Force use of the correct one in the dist tarball at src/tree_sitter/parser.h instead. Drop the dependency on dev-libs/tree-sitter given we were only depending on it for this header. Bug: https://github.com/tree-sitter/tree-sitter-bash/issues/199 Bug: https://bugs.gentoo.org/912716 Signed-off-by: Sam James gentoo.org> eclass/tree-sitter-grammar.eclass | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eclass/tree-sitter-grammar.eclass b/eclass/tree-sitter-grammar.eclass index e74d18653b8a..b2563220cfc2 100644 --- a/eclass/tree-sitter-grammar.eclass +++ b/eclass/tree-sitter-grammar.eclass @@ -24,9 +24,6 @@ SRC_URI="https://github.com/tree-sitter/${PN}/archive/${TS_PV:-v${PV}}.tar.gz -> ${P}.tar.gz" S="${WORKDIR}"/${PN}-${TS_PV:-${PV}}/src -# Needed for tree_sitter/parser.h -DEPEND="dev-libs/tree-sitter" - BDEPEND+=" test? ( dev-util/tree-sitter-cli )" IUSE+=" test" RESTRICT+=" !test? ( test )" @@ -61,8 +58,10 @@ tree-sitter-grammar_src_compile() { # or scanner.cc. tc-export CC CXX - export CFLAGS="${CFLAGS} -fPIC" - export CXXFLAGS="${CXXFLAGS} -fPIC" + # We want to use the bundled parser.h, not anything lurking on the system, hence -I + # See https://github.com/tree-sitter/tree-sitter-bash/issues/199#issuecomment-1694416505 + export CFLAGS="${CFLAGS} -fPIC -I. -Itree_sitter" + export CXXFLAGS="${CXXFLAGS} -fPIC -I. -Itree_sitter" local objects=( parser.o ) if [[ -f "${S}"/scanner.c || -f "${S}"/scanner.cc ]]; then