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, was: Native compilation on Windows Date: Tue, 01 Mar 2022 15:32:41 +0200 Message-ID: <83ee3llrwm.fsf@gnu.org> References: <83tue0u8sh.fsf@gnu.org> <86sftk3evj.fsf@duenenhof-wilhelm.de> <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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9740"; 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 01 14:34:05 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 1nP2dh-0002LQ-Ec for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Mar 2022 14:34:05 +0100 Original-Received: from localhost ([::1]:35622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP2dg-0003ip-Bq for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Mar 2022 08:34:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP2cU-0002u0-Ov for emacs-devel@gnu.org; Tue, 01 Mar 2022 08:32:51 -0500 Original-Received: from [2001:470:142:3::e] (port=35122 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 1nP2cT-0003yU-D4; Tue, 01 Mar 2022 08:32:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=APCIv2crgfy/dJe3ozVvtxaQj8Vu9QA7rz4+8gdvb9E=; b=rHLzkErBQ+He 4cXxMC7VjZEYyr+Oi85oYdE3OJdqyO5vo/WDgRZ0HlkarmsLlzNiKE+qMae2ZHQA7rQJunMbxaSZp Pdu42yRSAAi5q/z/yXpdFEqWNu6nDL5g0iGkBjbZo8++C9QCkB9aK8ZyQ2512YCZVGnpiyIJ8PEc4 4b/ptHp6LBMCtLMT4l8U1lFVBt6byqHr3SyWxKa7J8xARfJK2o61dyf3u4PCwSpNJWkUXtVVPibyS HxMg2sqd4VktQkb2v6Esul2WxX4RMFB+AlsJ2v3W3/oDsnB53mJRDEsmrOSqUX98nX1FGY6EHmLcf Srng+edYta5uV7fvFet1YQ==; Original-Received: from [87.69.77.57] (port=2558 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 1nP2cS-0000Oz-Nf; Tue, 01 Mar 2022 08:32:49 -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:286751 Archived-At: > From: "H. Dieter Wilhelm" > Cc: arash@gnu.org, corwin@bru.st, emacs-devel@gnu.org, > phillip.lord@russet.org.uk > Date: Mon, 28 Feb 2022 22:51:57 +0100 > > >> It seems to me that all MSYS DLLs on which Emacs depends have a name > >> component "lib", whereas the Windows libraries have no such substring. > >> (So I can easily filter them out.) > > > > There are exceptions: zlib1.dll. For now, it's the only exception > > AFAIK, but watch out for others. > > 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. > 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, but you should stop copying when you find the first existing DLL for each feature in dynamic-library-alist. We arrange the DLLs there in the descending order of versions/importance/quality, so the leftmost DLL that is found is always the best, and should not be overwritten by any existing DLLs for the same feature whose names are to the right of that. For example: '(tiff "libtiff-5.dll" "libtiff3.dll" "libtiff.dll") If you find libtiff-5.dll, you should not overwrite it with libtiff3.dll, even if the latter exists. 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"))) 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. Thanks.