unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Corwin Brust <corwin@bru.st>
To: Phillip Lord <phillip.lord@russet.org.uk>
Cc: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>,
	Arash Esbati <arash@gnu.org>, Eli Zaretskii <eliz@gnu.org>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Native compilation on Windows, was Re: Bootstrap Compilation Speed
Date: Wed, 2 Feb 2022 17:28:01 -0600	[thread overview]
Message-ID: <CAJf-WoQm_VNsGzbnmg1GMFYQNJ68c=pLsTrKPYzzT13mnHOuhg@mail.gmail.com> (raw)
In-Reply-To: <878rusapod.fsf@russet.org.uk>

[-- Attachment #1: Type: text/plain, Size: 3567 bytes --]

On Wed, Feb 2, 2022 at 4:07 PM Phillip Lord <phillip.lord@russet.org.uk> wrote:
>
> Corwin Brust <corwin@bru.st> writes:
>
> > On Mon, Jan 31, 2022 at 9:58 AM H. Dieter Wilhelm
> > <dieter@duenenhof-wilhelm.de> wrote:
> >>
> >> Currently we have 19 DLLs in the /bin folder (28.0.91), whereas 27.2 has
> >> 77 DLLs!  Corwin could you please check your build configuration, maybe
> >> together with Phil?  (I'm sorry, I'm still of no help here.)
> >
> > Excellent observation.
> >
> > I hope Phil will chime-in with suggestions of what I may have
> > missed/broken.  I'll investigate also, obviously, and others'
> > kibitzing most welcome too.
>
>
> Strange. What are the differences?

Firstly:  I'm not too sure yet.  I still need to download the Emacs
27.2 zip from the official source and do a direct "gap" comparison.

Overall, I'm leaning toward ditching automation of dependency
detection in favor of adding a separate file.   All efforts to
automating dependency recursion seem britle, ultimating causing more
work than they save us as we have to track down one mystery after
another. The proposed new file will
 - exhaustively lists each DLL we ship
 - be referenced in by documentation (such as README.W32)
 - be loaded by scripts, e.g. build-dep-zips.py
 - have additional "columns" to name the msys package, and
 - document why the dependency is required.

I have attached a txt file which is the complete list of what I would
start out including in that file.  Obviously, it's missing the msys
package names and has no commentary, so far.   I would probably call
it admin/nt/dist-build/deps.txt but I don't feel strongly about the
filename.

WDYT?

Meanwhile, in mesier news:

I wrote a perl script (also attached but don't bother) to find second
(and etc) order dependances using LDD that I believe should have been
(but have not been) getting pulled into the build.  I thought that the
msys installation folder path change Dieter caught would sort this,
but the numbers seem to don't add up (yet), probably because of the
undependability of the msys dependency checking that you mentioned.

I thought this would get me up to the same count (77) as Dieter reported, but:

  $ ls *.dll | wc -l
  19

  $ perl ../../../find-deps.pl | xargs -I '{}' cp '{}' .
  searched: 19, found: 392, of which 43 are missing in
/c/Users/corwi/emacs-build/install/emacs-28.0.91/bin

  $ ls *.dll | wc -l
  62

Note, these are the 62 DLLs listed in the attached textt file.

I also used this rather henus string of pipelined commands to
"cross-check" for missing dependencies and only came up with one,
which appears to be an optional dependency of harfbuzz:

  $  find ./ -name '*.dll' -print0 | xargs -0 -I '{}' cygcheck '{}'
2>&1 | grep 'could not' | cut -d ' ' -f 6 | sort | uniq
  libicuuc69.dll

Finally, I double-checked using an even more rediculous set of
pipeline commands. seemingly confirming everything the prior finds are
in the bin directory:

  $ find ./ -name '*.dll' -print0 | xargs -0 -I '{}' cygcheck '{}'
2>&1 | grep -v 'could not' | cut -d ' ' -f 6 | sort | uniq | xargs -0
-L1 echo | xargs -0 cygpath | perl -npe 's|c:|/c|g' | xargs -L1
basename | xargs ls >/dev/null

All this has me convinced some DLLs that shipped with Emacs 27.2
aren't findable as dependencies of anything we currently need for
Emacs 28, but not why.  And that leads me to the suggestion, above:  I
think we should hard-code the DLLs along with their source packages.
We can consider automatically generating/updating the deps file once
we get that far.

Warmest regards,
Corwin

[-- Attachment #2: dll-list.txt --]
[-- Type: text/plain, Size: 1062 bytes --]

libLerc.dll
libXpm-noX4.dll
libbrotlicommon.dll
libbrotlidec.dll
libbz2-1.dll
libcairo-2.dll
libcairo-gobject-2.dll
libdatrie-1.dll
libdeflate.dll
libexpat-1.dll
libffi-7.dll
libfontconfig-1.dll
libfreetype-6.dll
libfribidi-0.dll
libgcc_s_seh-1.dll
libgdk_pixbuf-2.0-0.dll
libgif-7.dll
libgio-2.0-0.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgmp-10.dll
libgmpxx-4.dll
libgnutls-30.dll
libgnutls-openssl-27.dll
libgnutlsxx-28.dll
libgobject-2.0-0.dll
libgraphite2.dll
libharfbuzz-0.dll
libharfbuzz-gobject-0.dll
libharfbuzz-icu-0.dll
libharfbuzz-subset-0.dll
libhogweed-6.dll
libiconv-2.dll
libidn2-0.dll
libintl-8.dll
libjansson-4.dll
libjbig-0.dll
libjpeg-8.dll
liblcms2-2.dll
liblzma-5.dll
libnettle-8.dll
libp11-kit-0.dll
libpango-1.0-0.dll
libpangocairo-1.0-0.dll
libpangoft2-1.0-0.dll
libpangowin32-1.0-0.dll
libpcre-1.dll
libpixman-1-0.dll
libpng16-16.dll
librsvg-2-2.dll
libstdc++-6.dll
libtasn1-6.dll
libthai-0.dll
libtiff-5.dll
libtiffxx-5.dll
libturbojpeg.dll
libunistring-2.dll
libwebp-7.dll
libwinpthread-1.dll
libxml2-2.dll
libzstd.dll
zlib1.dll

[-- Attachment #3: find-deps.pl --]
[-- Type: application/octet-stream, Size: 2749 bytes --]

#!/usr/bin/env perl
#
# find-deps - find DLLs required by (but not in) the DLLs in CWD
#
# Copyright (C) 2022 Corwin Brust
#
# Quick and dirty check for missing dependancies of the DLLs included
# with a recently packaged build of Emacs. This should work given
# building Emacs works.  Run it from the install folder used for
# packaging, e.g.:
#
#   cd ~/emacs-build/install/emacs-28.0.91/bin
#   perl ../../../find-deps.pl > ~/emacs-build/dep-search.txt
# Or:
#  perl ../../../find-deps.pl | xargs -I '{}' cp '{}' .
#
# this rather obtuse alternative catches a couple more:
#   find ./ -name '*.dll' -print0 | \
#    xargs -0 -I '{}' cygcheck '{}' 2>&1 | \
#    grep 'could not' | cut -d ' ' -f 6 | \
#    sort | uniq | xargs -I '{}' cp '{}' .

## This file is not part of GNU Emacs.

## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <https://www.gnu.org/licenses/>.

use strict;
use warnings qw[all];

use File::Basename;

my %deps;

# use ldd to find deps
sub deps_of(_) {
  local $_ = `ldd $_`;
  s/^\s+//msg;
  map [ split / => / ]->[1] || $_,
    map { s/ \(.*?\)//; $_ }
    grep !/not found/,  # ignore optional
    grep !m|/Windows/|i,# ignore */Windows/*
    split /\n/
}

# call deps_of for each arg (unless we already have)
sub walk_deps(@) {
  my $found_count = 0;
  for (@_) {
    my $key = fileparse($_);
    next if exists $deps{$key} or !/.dll$/;
    my @found = deps_of $_;
    if(@found) {
      $deps{$key} = \@found;
      $found_count += 1;
    }
  }
  return $found_count;
}

# get a list of DLLs to start with
my @libs = glob('*.dll');

# search for deps of DLLs we included
walk_deps @libs;

# search for deps of our deps
my $added_count = 0;
do {
  $added_count = walk_deps map @$_, values %deps
} while($added_count > 0);

# de-dup
my %uniq;
for(map @$_, values %deps) {
  my $dll = fileparse($_);
  next if -e $dll; # skip those we included
  $uniq{$_} += 1;
}

# report
$\ = "\n";
print for sort keys %uniq;
warn
  "searched: ",  scalar(@libs),
  ", found: ",   scalar( map @$_, values %deps),
  ", of which ", scalar(keys %uniq),
  " are missing in ", `pwd`;

  reply	other threads:[~2022-02-02 23:28 UTC|newest]

Thread overview: 186+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 11:36 Bootstrap Compilation Speed phillip.lord
2022-01-14 13:21 ` Eli Zaretskii
2022-01-14 14:16   ` phillip.lord
2022-01-15  9:34 ` Eli Zaretskii
2022-01-15 11:29   ` phillip.lord
2022-01-15 10:29 ` H. Dieter Wilhelm
2022-01-15 11:28   ` phillip.lord
2022-01-15 16:24     ` Corwin Brust
2022-01-15 19:06       ` Native compilation on Windows, was " H. Dieter Wilhelm
2022-01-15 19:15         ` Eli Zaretskii
2022-01-15 19:27           ` H. Dieter Wilhelm
2022-01-16 11:47             ` H. Dieter Wilhelm
2022-01-16 12:13               ` Eli Zaretskii
2022-01-17  9:39                 ` Phillip Lord
2022-01-17 12:35                   ` Eli Zaretskii
2022-01-17 14:07                     ` Phillip Lord
2022-01-17 14:09                       ` Eli Zaretskii
2022-01-17 16:25                       ` H. Dieter Wilhelm
2022-01-17 18:07                         ` Corwin Brust
2022-01-17 18:13                         ` Eli Zaretskii
2022-01-17 20:25                         ` Phillip Lord
2022-01-17 20:46                           ` H. Dieter Wilhelm
2022-01-18 16:38                             ` Phillip Lord
2022-01-18 19:37                               ` H. Dieter Wilhelm
2022-01-18 19:46                                 ` Eli Zaretskii
2022-01-18 21:36                                   ` H. Dieter Wilhelm
2022-01-19  0:02                                     ` Corwin Brust
2022-01-19  7:45                                       ` Eli Zaretskii
2022-01-19 14:26                                         ` Corwin Brust
2022-01-19 14:42                                           ` Eli Zaretskii
2022-01-19 18:38                                         ` Phillip Lord
2022-01-19 14:01                                       ` H. Dieter Wilhelm
2022-01-19 18:59                                         ` H. Dieter Wilhelm
2022-01-19 20:21                                           ` Corwin Brust
2022-01-20  7:12                                             ` H. Dieter Wilhelm
2022-01-20 14:32                                               ` Corwin Brust
2022-01-20 22:56                                                 ` H. Dieter Wilhelm
2022-01-21  6:58                                                   ` Eli Zaretskii
2022-01-21 11:07                                                     ` H. Dieter Wilhelm
2022-01-21 12:04                                                       ` Eli Zaretskii
2022-01-21 19:22                                                         ` H. Dieter Wilhelm
2022-01-21 19:57                                                           ` Eli Zaretskii
2022-01-22 10:30                                                             ` H. Dieter Wilhelm
2022-01-22 10:44                                                               ` Eli Zaretskii
2022-01-25 19:45                                                               ` H. Dieter Wilhelm
2022-01-25 19:56                                                                 ` Eli Zaretskii
2022-01-26 19:49                                                                   ` H. Dieter Wilhelm
2022-01-21 12:21                                                       ` Phillip Lord
2022-01-21 12:51                                                         ` H. Dieter Wilhelm
2022-01-21 12:59                                                           ` Eli Zaretskii
2022-01-21 17:48                                                             ` phillip.lord
2022-01-21 19:36                                                               ` Eli Zaretskii
2022-01-21 19:47                                                                 ` Corwin Brust
2022-01-21 19:58                                                                   ` Eli Zaretskii
2022-01-21 19:58                                                                 ` H. Dieter Wilhelm
2022-01-22 12:52                                                                   ` Phillip Lord
2022-01-22 12:40                                                                 ` Phillip Lord
2022-01-22 12:46                                                                   ` Eli Zaretskii
2022-01-22 17:56                                                                     ` Phillip Lord
2022-01-21  9:05                                                   ` Corwin Brust
2022-01-22 21:51                                                     ` H. Dieter Wilhelm
2022-01-22 22:52                                                       ` Corwin Brust
2022-01-23 21:16                                                         ` H. Dieter Wilhelm
2022-01-24  3:24                                                           ` Eli Zaretskii
2022-01-24  4:17                                                           ` Corwin Brust
2022-01-24 15:43                                                             ` H. Dieter Wilhelm
2022-01-24 16:56                                                               ` Eli Zaretskii
2022-01-24 18:28                                                                 ` H. Dieter Wilhelm
2022-01-24 18:35                                                                   ` Eli Zaretskii
     [not found]                                                                     ` <86czkgztcv.fsf@duenenhof-wilhelm.de>
     [not found]                                                                       ` <83zgnkijfo.fsf@gnu.org>
2022-01-25 10:34                                                                         ` H. Dieter Wilhelm
2022-01-25 12:32                                                                           ` Eli Zaretskii
2022-01-25 13:46                                                                             ` H. Dieter Wilhelm
2022-01-25 13:50                                                                               ` Eli Zaretskii
2022-01-30 11:57                                                                                 ` H. Dieter Wilhelm
2022-01-30 14:12                                                                                   ` Eli Zaretskii
2022-01-30 18:12                                                                                     ` H. Dieter Wilhelm
2022-01-30 18:34                                                                                       ` Eli Zaretskii
2022-01-30 21:31                                                                                         ` H. Dieter Wilhelm
2022-01-25 10:45                                                               ` H. Dieter Wilhelm
2022-01-26  4:40                                                                 ` Corwin Brust
2022-01-19 18:33                                       ` Phillip Lord
2022-01-19  7:28                                     ` Eli Zaretskii
2022-01-19 13:57                                       ` H. Dieter Wilhelm
2022-01-19 14:39                                         ` Eli Zaretskii
2022-01-19 18:48                                           ` Phillip Lord
2022-01-29 21:32                                           ` H. Dieter Wilhelm
2022-01-29 22:01                                             ` Corwin Brust
2022-01-29 22:23                                               ` H. Dieter Wilhelm
2022-01-30  1:58                                                 ` Corwin Brust
2022-01-30 10:13                                                   ` H. Dieter Wilhelm
2022-01-30 10:19                                                     ` Eli Zaretskii
2022-01-30 21:33                                                     ` Arash Esbati
2022-01-30 22:16                                                       ` Corwin Brust
2022-01-31 10:57                                                         ` Arash Esbati
2022-01-31 15:58                                                           ` H. Dieter Wilhelm
2022-01-31 22:17                                                             ` Corwin Brust
2022-02-01 12:45                                                               ` H. Dieter Wilhelm
2022-02-01 15:28                                                                 ` Óscar Fuentes
2022-02-01 19:26                                                                   ` H. Dieter Wilhelm
2022-02-01 18:38                                                                 ` Arash Esbati
2022-02-01 19:02                                                                   ` H. Dieter Wilhelm
2022-02-01 19:10                                                                     ` Arash Esbati
2022-02-01 19:27                                                                       ` H. Dieter Wilhelm
2022-02-01 21:56                                                                   ` H. Dieter Wilhelm
2022-02-03  3:22                                                                 ` Corwin Brust
2022-02-03  7:10                                                                   ` H. Dieter Wilhelm
2022-02-03  7:47                                                                   ` Eli Zaretskii
2022-02-03 13:57                                                                     ` Corwin Brust
2022-02-03 16:53                                                                       ` Eli Zaretskii
2022-02-03 17:45                                                                         ` Corwin Brust
2022-02-02 22:06                                                               ` Phillip Lord
2022-02-02 23:28                                                                 ` Corwin Brust [this message]
2022-02-04 10:12                                                                   ` Phillip Lord
2022-02-02 23:31                                                                 ` Corwin Brust
2022-01-31 12:27                                                         ` Eli Zaretskii
2022-02-02 22:04                                                         ` Phillip Lord
2022-02-02 22:22                                                           ` Corwin Brust
2022-02-04 10:05                                                             ` Phillip Lord
2022-02-03  7:10                                                           ` Eli Zaretskii
2022-02-21 21:59                                                             ` H. Dieter Wilhelm
2022-02-22  3:31                                                               ` Eli Zaretskii
2022-02-23  6:44                                                                 ` H. Dieter Wilhelm
2022-02-23  9:32                                                                   ` Arash Esbati
2022-02-23 18:30                                                                     ` H. Dieter Wilhelm
2022-02-23 12:39                                                                   ` Eli Zaretskii
2022-02-27 10:49                                                                     ` Acquiring dependencies for Windows builds, was: Native compilation on Windows H. Dieter Wilhelm
2022-02-27 11:07                                                                       ` Eli Zaretskii
2022-02-28 21:51                                                                         ` H. Dieter Wilhelm
2022-03-01 13:32                                                                           ` Eli Zaretskii
2022-03-08 15:52                                                                             ` Acquiring dependencies for Windows builds H. Dieter Wilhelm
2022-03-08 16:48                                                                               ` Eli Zaretskii
2022-01-31 12:26                                                       ` Native compilation on Windows, was Re: Bootstrap Compilation Speed Eli Zaretskii
2022-01-30  2:37                                                 ` chad
2022-01-30 12:29                                                   ` H. Dieter Wilhelm
2022-02-01 17:17                                                   ` H. Dieter Wilhelm
2022-02-01 17:53                                                     ` Eli Zaretskii
2022-02-01 18:59                                                       ` H. Dieter Wilhelm
2022-02-01 19:23                                                         ` Eli Zaretskii
2022-02-02 10:36                                                           ` Robert Pluim
2022-02-02 11:28                                                             ` H. Dieter Wilhelm
2022-02-02 12:57                                                             ` Eli Zaretskii
2022-02-02 13:00                                                               ` Robert Pluim
2022-02-02 15:23                                                                 ` H. Dieter Wilhelm
2022-02-02 16:20                                                                   ` Robert Pluim
2022-02-02 17:04                                                                   ` Eli Zaretskii
2022-02-02 17:58                                                                     ` H. Dieter Wilhelm
2022-02-02 18:18                                                                       ` Robert Pluim
2022-02-01 19:00                                                       ` chad
2022-02-01 19:08                                                         ` H. Dieter Wilhelm
2022-02-02 22:12                                                       ` Phillip Lord
2022-02-05 21:46                                                         ` H. Dieter Wilhelm
2022-02-05 23:18                                                           ` Corwin Brust
2022-02-06 15:00                                                             ` Stefan Monnier
2022-02-06 17:21                                                               ` H. Dieter Wilhelm
2022-02-07 12:54                                                                 ` Stefan Monnier
2022-02-09 18:23                                                                   ` H. Dieter Wilhelm
2022-02-09 19:09                                                                     ` Eli Zaretskii
2022-02-09 20:13                                                                     ` Stefan Monnier
2022-02-09 23:32                                                                     ` Corwin Brust
2022-02-10 10:28                                                                     ` Robert Pluim
2022-02-02 21:58                                               ` Phillip Lord
2022-02-02 22:09                                                 ` Corwin Brust
2022-02-03  6:25                                                 ` H. Dieter Wilhelm
2022-02-03 13:30                                                   ` Stefan Monnier
2022-02-05 21:34                                                     ` H. Dieter Wilhelm
2022-01-30  7:59                                             ` Eli Zaretskii
2022-01-19 18:46                                         ` Phillip Lord
2022-01-19 19:25                                           ` H. Dieter Wilhelm
2022-01-19 18:28                                 ` Phillip Lord
2022-01-17  9:44               ` Phillip Lord
2022-01-17 16:08                 ` Óscar Fuentes
2022-01-17 17:23                   ` H. Dieter Wilhelm
2022-01-17 17:46                     ` Óscar Fuentes
2022-01-17 19:09                       ` H. Dieter Wilhelm
2022-01-17 20:21                   ` Phillip Lord
2022-01-18  9:03                     ` Robert Pluim
2022-01-18 14:50                       ` Eli Zaretskii
2022-01-18 15:09                       ` Óscar Fuentes
2022-01-18 16:40                       ` Phillip Lord
2022-01-15 22:14         ` phillip.lord
2022-01-15 22:32           ` H. Dieter Wilhelm
2022-01-16  8:54           ` Eli Zaretskii
2022-01-17  9:34             ` Andrea Corallo
2022-01-17  9:56             ` Phillip Lord
2022-01-17 12:37               ` Eli Zaretskii
2022-01-16 14:31       ` H. Dieter Wilhelm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJf-WoQm_VNsGzbnmg1GMFYQNJ68c=pLsTrKPYzzT13mnHOuhg@mail.gmail.com' \
    --to=corwin@bru.st \
    --cc=arash@gnu.org \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=phillip.lord@russet.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).