From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration in python.el Date: Tue, 04 Oct 2022 19:11:34 +0200 Message-ID: <8735c3h5tl.fsf@gmail.com> References: <3A68545C-2E40-4BB4-8563-8041A5452634@gmail.com> <87y1twlr0v.fsf@gmail.com> <83czb8ycpo.fsf@gnu.org> <87tu4klfcw.fsf@gmail.com> <83sfk4w1yu.fsf@gnu.org> <877d1fhm0m.fsf@gmail.com> <83sfk3vkd7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34959"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: casouri@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 04 19:28:10 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ofliE-0008s8-7D for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 19:28:10 +0200 Original-Received: from localhost ([::1]:49964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofliC-0007gj-9P for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Oct 2022 13:28:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oflSU-0008EM-SN for emacs-devel@gnu.org; Tue, 04 Oct 2022 13:11:54 -0400 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oflSG-0008DU-OD; Tue, 04 Oct 2022 13:11:42 -0400 Original-Received: by mail-wr1-x432.google.com with SMTP id w18so13596992wro.7; Tue, 04 Oct 2022 10:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=8ZaCBdNGTC5RRsxgc0IeLFy2EczxX6NZ/xysFG3SmRg=; b=LVyn1Uw6NF9rXKLXPI/JXVaiPKY837LvYnjkJdHehoQu5jEPDC1TchEYbeEFvmAefJ 0mqS+EgRkokEkRkbFC8QgmAaDD4nfCht+y+N+uTVVDabNNcn5ABWB/jtBJIF+RDAUBG/ a+ygmRVpCOr1YHnl6OuWw4Y6s/s4kuB3td473EKXFZn3eNWqWkOWLvQ+zZ5XtgBmeUrY SnNvJzMMN5AQS3rubb4Tx20a6QteCAGnYfQ2Vi3FHYKFbMFFJYUtqXkUbxWW/mbMMCHZ +xtZ5//pjaa6cIJ99gejArxi9XkM77sCTXhVdK9+Itesh/REUPKSXRCM61R3fI6Yam/b 9tbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=8ZaCBdNGTC5RRsxgc0IeLFy2EczxX6NZ/xysFG3SmRg=; b=eamU9UMijYuDZW4041X7UtIryUhli5ORG+3BIF/LtU9Cj8vAjDVEyT7TdxbnqZOp5H UpALThoNU4mrJ0uHM/7dxTg1UPNU5RYc3470xb1zVXyPwcPZN5bePTg1Bio1XzJ+K3ao T4p158XEICimq8cEp4jkhQQTPGY4aF8UnBxNrE9qFbSwEUZ0H/1kKnV+KUZWD75FS4KR a0EyUl5G/ERBqLnzZIDJj4c4Pjf6oHJ+XXNogSkzsMX71saKjg84oQjF+dFKzMhjQy5C 29jfNXqQA3+3InZXKkK+FS0ogcO7mEGnx5GOQjvoqc5MeubORlGR2uFYqf0alHz5ck1C sGSw== X-Gm-Message-State: ACrzQf1su4+fOWYKIzrKovc+NBiuDFkounQ6+0q6sxJLdJOYV+8LBnef aXKKAUWTvyRE+DVtd8sEK63KZSjizKs= X-Google-Smtp-Source: AMsMyM7OLbOtxoYQmHIp6DrdDDcQYsd7d4ShVNiHdUGmtkRe45ouT/gKhyzEgGFkfxqMy6EgBnB1KA== X-Received: by 2002:a05:6000:144f:b0:22a:94f1:25d6 with SMTP id v15-20020a056000144f00b0022a94f125d6mr16303408wrx.422.1664903497406; Tue, 04 Oct 2022 10:11:37 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id l19-20020a5d5273000000b00228dbf15072sm13030752wrc.62.2022.10.04.10.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 10:11:36 -0700 (PDT) In-Reply-To: <83sfk3vkd7.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 04 Oct 2022 15:33:40 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=orontee@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:296900 Archived-At: Eli Zaretskii writes: >> From: Matthias Meulien >> Cc: casouri@gmail.com, emacs-devel@gnu.org >> Date: Tue, 04 Oct 2022 13:21:45 +0200 >> >> Eli Zaretskii writes: >> >> > (...) Would you please share the changes you made, FTR? Then others >> > who face the same problem could easily find the solution. TIA. >> >> Sure, but let me make clear that it's an unclean hack and using >> https://github.com/casouri/tree-sitter-module may prove to be more >> robust. > > Understood, thanks. > >> diff --unified tree-sitter-ruby/Makefile tree-sitter-python/Makefile >> --- tree-sitter-ruby/Makefile 2022-10-03 23:01:34.963750322 +0200 >> +++ tree-sitter-python/Makefile 2022-10-04 13:06:46.014817832 +0200 >> @@ -31,7 +31,7 @@ >> ifeq (, $(CPPSRC)) >> ADDITIONALLIBS := >> else >> - ADDITIONALLIBS := -lc++ >> + ADDITIONALLIBS := >> endif > > Any reason why you needed to use the C++ compiler? Well, I saw the C++ file tree-sitter-python/src/parser.cc (cf. https://github.com/tree-sitter/tree-sitter-python/blob/master/src/scanner.cc#L1) and also got a linker error when using the original Makefile where gcc use option -lc++. I didn't try to understand that error, I am used to compile C++ using g++ so I just changed the Makefile to fix an error I've not truly understood. Note that https://github.com/casouri/tree-sitter-module/blob/master/build.sh#L46 switch to using c++ compiler when a parser.cc file is found. -- Matthias