From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Acquiring dependencies for Windows builds Date: Tue, 08 Mar 2022 18:48:06 +0200 Message-ID: <83a6e0fl15.fsf@gnu.org> References: <83o848tc92.fsf@gnu.org> <86o8473k13.fsf@duenenhof-wilhelm.de> <83ee53ssbx.fsf@gnu.org> <86sft4c3ij.fsf@gnu.org> <87czk59b7p.fsf@russet.org.uk> <83k0ec5st1.fsf@gnu.org> <83v8x7tw4a.fsf@gnu.org> <834k4pu57x.fsf@gnu.org> <83mtico9e3.fsf@gnu.org> <83ee3llrwm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12786"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arash@gnu.org, corwin@bru.st, phillip.lord@russet.org.uk, emacs-devel@gnu.org To: "H. Dieter Wilhelm" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 08 17:55:35 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 1nRd7W-00035h-LM for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Mar 2022 17:55:34 +0100 Original-Received: from localhost ([::1]:59600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRd7V-0007hO-Bu for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Mar 2022 11:55:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRd0d-0007WE-2v for emacs-devel@gnu.org; Tue, 08 Mar 2022 11:48:27 -0500 Original-Received: from [2001:470:142:3::e] (port=41098 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRd0R-0003mx-I4; Tue, 08 Mar 2022 11:48:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=aIvRtKRg/2H/+Nqsm/cK8PpE/sh3eyuxuSi+0tob0O4=; b=A8nJUIADMkdPaAX5Srvp Gayw8OEWtdZutuB2clCsdRfQD6sdRlYFvHcTLuUvqdoXXsLVVEz2E+VPZRqg9fT0GDfO/jVh03O/P jVFnvBCj4FiAhG75ttsa8ByWyJR9QHFCu7hZUP4Qmzfemc+vIWEtYJFYOWrjN606F7WVhYt+oquS5 oktpYkyTF0bS7SK5EejZxdyUhGxJXVm6abX8PO7ZoV+ouTpC987ykg8/SAjs82I+FfWJkSbdu4dA5 HAM/tEZSgD75xPO6XxYpqTEHR4uMu5lGjXpNC6VPNMzKoCScLYzrLyWQTeBqeWB049tnzTFR0L1tU k+573drItOPKqw==; Original-Received: from [87.69.77.57] (port=4668 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRd0P-0006yK-Bv; Tue, 08 Mar 2022 11:48:14 -0500 In-Reply-To: (dieter@duenenhof-wilhelm.de) 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:286935 Archived-At: > From: "H. Dieter Wilhelm" > Cc: arash@gnu.org, corwin@bru.st, emacs-devel@gnu.org, > phillip.lord@russet.org.uk > Date: Tue, 08 Mar 2022 16:52:52 +0100 > > >> Luckily zlib1.dll contains also "lib". :-) > > > > You are relying on luck too much: look in your Windows/system32 > > directory, and you will see there quite a few system DLLs that match > > "lib". My suggestion is to have an explicit list of system DLLs that > > should be filtered out. > > I understand, thanks. I'll grab all DLL filenames of the > Windows/system32 folder and filter them out. Or how would you build or > hard-code such a filter list? I'd maintain a hand-crafted list. There aren't so many system DLLs you will see in the dependencies. > >> In the following I'm using copy-file. But I'm wondering why the argument > >> OK-IF-ALREADY-EXISTS can't be used to skip a copy process if the file > >> exists? > > > > I'm not sure I understand, > > Would it make sense to you to have the (additonal) capability for > copy-file to do nothing if the target file already exists? > > At the moment I can 1) trigger an error, 2) overwrite an existing file > and 3) ask for confirmation either to overwrite or to have an error. So > 3) is actually only an - annoying - way to have 1) or 2), there's no way > to leave an existing file alone without an error. I think this is answered by the below: > > If you find libtiff-5.dll, you should not overwrite it with > > libtiff3.dll, even if the latter exists. > > I see, I'll just copy the available, leftmost DLLs. Yes. > > Also, I don't see that you ignore DLLs that don't match the version > > with which Emacs was compiled. E.g., this part of > > dynamic-library-alist: > > > > (if (>= libgif-version 50100) > > ;; Yes, giflib 5.0 uses 6 as the major version of the API, > > ;; and giflib 5.1 uses 7, thus "libgif-7.dll" and > > ;; "libgif-6.dll" below (giflib 4.x used 5 as the major API > > ;; version). giflib5.dll is from the lua-files project, > > ;; and gif.dll is from luapower. > > '(gif "libgif-7.dll") > > (if (>= libgif-version 50000) > > '(gif "libgif-6.dll" "giflib5.dll" "gif.dll") > > '(gif "libgif-5.dll" "giflib4.dll" "libungif4.dll" "libungif.dll"))) > > Please tell me where I can find above definition of > dynamic-library-alist? Mine (Emacs-27.2) just says: > > dynamic-library-alist is a variable defined in ‘C source code’. > > ((harfbuzz "libharfbuzz-0.dll") > (gdiplus "gdiplus.dll") > (shlwapi "shlwapi.dll") > (xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll") > (png "libpng16.dll" "libpng16-16.dll") > (tiff "libtiff-5.dll" "libtiff3.dll" "libtiff.dll") > (jpeg "libjpeg-8.dll") > (gif "libgif-7.dll") > (svg "librsvg-2-2.dll") > (webp "libwebp-7.dll" "libwebp.dll") > (sqlite3 "libsqlite3-0.dll") > (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") > (glib "libglib-2.0-0.dll") > (gio "libgio-2.0-0.dll") > (gobject "libgobject-2.0-0.dll") > (gnutls "libgnutls-30.dll") > (libxml2 "libxml2-2.dll" "libxml2.dll") > (zlib "zlib1.dll" "libz-1.dll") > (lcms2 "liblcms2-2.dll") > (json "libjansson-4.dll") > (gccjit "libgccjit-0.dll")) I guess you took this from a running Emacs? The original is in w32-win.el, and that's where I took the fragment I've shown. If you intend to collect the dependencies by running the same Emacs binary as the one you will be packaging, then using the list from the running Emacs will solve you the versions problem, because Emacs filters it to have the DLLs it needs. > > means that Emacs compiled against giflib 5.1 and later should not try > > to use libgif-6.dll or libgif-5.dll, it should only use libgif-7.dll. > > We do this when a newer version is binary incompatible with an older > > one, so you cannot just choose whichever DLL you have, you must use > > the one that is binary-compatible with Emacs. > > I'm struggling to understand that, I thought ./configure would sort out > what is necessary and available on my system? Not configure, but Emacs itself when it starts up.