From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Phillip Lord" Newsgroups: gmane.emacs.devel Subject: Re: What's the right way to detect libxml2? Date: Sun, 22 Oct 2017 16:27:15 -0000 Message-ID: <7f80cde1944261b7ee29020ff953f14c.squirrel@cloud103.planethippo.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1508689687 17188 195.159.176.226 (22 Oct 2017 16:28:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Oct 2017 16:28:07 +0000 (UTC) User-Agent: SquirrelMail/1.5.2 [SVN] Cc: Emacs developers To: =?utf-8?B?IkNsw6ltZW50IFBpdC1DbGF1ZGVsIg==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 22 18:28:03 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e6J6M-0002Fr-PD for ged-emacs-devel@m.gmane.org; Sun, 22 Oct 2017 18:27:50 +0200 Original-Received: from localhost ([::1]:33544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6J6U-0001Rq-1T for ged-emacs-devel@m.gmane.org; Sun, 22 Oct 2017 12:27:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6J5s-0001RY-00 for emacs-devel@gnu.org; Sun, 22 Oct 2017 12:27:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6J5o-0001vC-St for emacs-devel@gnu.org; Sun, 22 Oct 2017 12:27:20 -0400 Original-Received: from cloud103.planethippo.com ([78.129.138.110]:43654) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6J5o-0001ur-IH for emacs-devel@gnu.org; Sun, 22 Oct 2017 12:27:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Cc:To:From:Subject:Date:References:In-Reply-To:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=XWkDE2Cg71/8txV5dDLKekSeRSNAOhMEr4Rgv8Z6UxY=; b=HDrroNG0rBTLNpKmbhk+Bda1Qd eioC0bSr6HCUZ/1vkKUgfrtZ9XWlaOJYlJU5cf/zZC5UD2mqDHhYBR7NhX5NdCNpYSNOHxKKrs6OL +q8tBZPRVyDWpaD+GuXwOlqI8/s/+xwuFrn0ceC2dPLm+X4jhEyOLqCogNJOlCStd+hFGIAAFIj6y wq5fhNuXf6l9p64/3N/8WkVNWtg90HYNECIgvkv6GQXfw3j79UhNtZwkzAmRwfRrnbNSAmAmJi3X1 lh17OWG/REZ8RGBjql5tVJivWIJ4mPd+u3qHZs0MhUrtki/F031Z+hLWVmkX8/I9ZsatMyhFOWgs+ JwNxLx2Q==; Original-Received: from [127.0.0.1] (port=57421 helo=cloud103.planethippo.com) by cloud103.planethippo.com with esmtpa (Exim 4.89) (envelope-from ) id 1e6J5n-003VL2-9x; Sun, 22 Oct 2017 16:27:15 +0000 Original-Received: from 92.233.204.101 ([92.233.204.101]) (SquirrelMail authenticated user phillip.lord@russet.org.uk) by cloud103.planethippo.com with HTTP; Sun, 22 Oct 2017 16:27:15 -0000 In-Reply-To: X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 78.129.138.110 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219677 Archived-At: On Sun, October 22, 2017 2:14 pm, Clément Pit-Claudel wrote: > Hi emacs-devel, > > > In Flycheck we use ``libxml-parse-region`` if available, and fall back to > ``xml-parse-region`` otherwise. We recently realized that our libxml > detection code was wrong, however. > > We used to write ``(if (fboundp 'libxml-parse-region) > (libxml-parse-region …) (xml-parse-region …))``, but this isn't > sufficient on Windows, where ``fboundp`` succeeds if Emacs was compiled > with libxml support, even if the appropriate DLL isn't installed on the > user's system. > > What's the proper way to autodetect libxml? We're thinking of doing this > instead:: > > > (if (and (fboundp 'libxml-parse-region) > (with-temp-buffer > (insert "") > (libxml-parse-region (point-min) (point-max)))) > (libxml-parse-region …) > (xml-parse-region …)) > > > Do we have better options? We need a better option, as it happens. I have the same problem when building the windows binary package. I've got no way of testing whether libxml (or any of the other DLLs) are present or work. Phil