From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59737: 29.0.60; Fix tree-sitter-build-scripts Date: Thu, 01 Dec 2022 09:49:31 +0100 Message-ID: <87mt87zexw.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26169"; mail-complaints-to="usenet@ciao.gmane.io" To: 59737@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 01 09:50:40 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0fHD-0006e3-Fd for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 01 Dec 2022 09:50:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0fGh-0008Sy-I7; Thu, 01 Dec 2022 03:50:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0fGc-0008Ra-MC for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 03:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0fGc-0007wU-Bc for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 03:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p0fGc-0006bQ-6c for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 03:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Dec 2022 08:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59737 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166988458225363 (code B ref -1); Thu, 01 Dec 2022 08:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Dec 2022 08:49:42 +0000 Original-Received: from localhost ([127.0.0.1]:38384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0fGH-0006b1-LX for submit@debbugs.gnu.org; Thu, 01 Dec 2022 03:49:42 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:53296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0fGF-0006av-7R for submit@debbugs.gnu.org; Thu, 01 Dec 2022 03:49:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0fGC-0007wF-7W for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 03:49:37 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p0fGA-0007sS-8k for bug-gnu-emacs@gnu.org; Thu, 01 Dec 2022 03:49:35 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1669884571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=j7qBNhMud3O1JqlAq1rSlNIqgWKDyylw9DZJHdxR6No=; b=spsBmcRIQyf0OeeLzPzQmpQ/Xe4hQ4abtTEtiwdeLz8mUxMoMSLq1N9aL1wz4QNyGigLME WG1v/am04HGyJ3FZxiYLB8kxvhZX9l+/V5dCyhtZlbv4OONa1lh4pVcqDNid8SbDuWq0i4 o4fj8Cf17kMAMvmVAW5d9pqLj11uC3YKlBPenWZBq2K6t7zcCqhzldlMy2r1fTo9zutdbq JfYZWExLWhC+rFK0Srui22rkwoagx8MdGtbzkcbXHfbnInalkywWVZkSIF0B5Hw8Ujlb0/ d27hGy7zvgLacNRZenQfy4mdjZ0gyRYq/5GOe6hStV2h1zF+yiUWJcTff4efag== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=188.165.223.204; envelope-from=theo@thornhill.no; helo=out2.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249615 Archived-At: --=-=-= Content-Type: text/plain Hello there! Attached is a patch to build typescript in addition to tsx. Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-tree-sitter-build-scripts.patch >From 077bd1ff9825721bc6023f9e81e379774429bb13 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Thu, 1 Dec 2022 09:39:17 +0100 Subject: [PATCH] Fix tree-sitter build scripts * admin/notes/tree-sitter/build-module/batch.sh (languages): Add tsx. * admin/notes/tree-sitter/build-module/build.sh (lang): Make guards to account for typescript/tsx. It's a little hacky because of the nested nature of that particular repository. --- admin/notes/tree-sitter/build-module/batch.sh | 1 + admin/notes/tree-sitter/build-module/build.sh | 29 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/admin/notes/tree-sitter/build-module/batch.sh b/admin/notes/tree-sitter/build-module/batch.sh index deed18978a..d45f37f4b6 100755 --- a/admin/notes/tree-sitter/build-module/batch.sh +++ b/admin/notes/tree-sitter/build-module/batch.sh @@ -12,6 +12,7 @@ languages= 'python' 'rust' 'typescript' + 'tsx' ) for language in "${languages[@]}" diff --git a/admin/notes/tree-sitter/build-module/build.sh b/admin/notes/tree-sitter/build-module/build.sh index 102ab310fa..02c6ebaf5d 100755 --- a/admin/notes/tree-sitter/build-module/build.sh +++ b/admin/notes/tree-sitter/build-module/build.sh @@ -12,20 +12,23 @@ lang= echo "Building ${lang}" # Retrieve sources. -git clone "https://github.com/tree-sitter/tree-sitter-${lang}.git" \ - --depth 1 --quiet -if [ "${lang}" == "typescript" ] +if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ] then - lang="typescript/tsx" + git clone "https://github.com/tree-sitter/tree-sitter-typescript.git" \ + --depth 1 --quiet + + lang="typescript/${lang}" +else + git clone "https://github.com/tree-sitter/tree-sitter-${lang}.git" \ + --depth 1 --quiet fi -cp tree-sitter-lang.in "tree-sitter-${lang}/src" -cp emacs-module.h "tree-sitter-${lang}/src" + cp "tree-sitter-${lang}/grammar.js" "tree-sitter-${lang}/src" cd "tree-sitter-${lang}/src" -if [ "${lang}" == "typescript/tsx" ] +if [ "${lang}" == "typescript/$1" ] then - lang="tsx" + lang=$1 fi # Build. @@ -50,7 +53,7 @@ lang= # Copy out. -if [ "${lang}" == "typescript" ] +if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ] then cp "libtree-sitter-${lang}.${soext}" .. cd .. @@ -59,4 +62,10 @@ lang= mkdir -p ../../dist cp "libtree-sitter-${lang}.${soext}" ../../dist cd ../../ -rm -rf "tree-sitter-${lang}" + +if [ "${lang}" == "typescript" ] || [ "${lang}" == "tsx" ] +then + rm -rf "tree-sitter-typescript" +else + rm -rf "tree-sitter-${lang}" +fi -- 2.34.1 --=-=-=--