Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCHv2: Allow parallel make



Could you try this on top of the previous, and without the DLLINK
hunks? (I realized that wouldn't have helped much anyway, even though
the final link is atomic, all the intermediate .o files it can trigger
are not.)

diff --git c/Src/Makefile.in w/Src/Makefile.in
index 99bafc065f..d656a0b594 100644
--- c/Src/Makefile.in
+++ w/Src/Makefile.in
@@ -133,7 +133,7 @@ FORCE:
 mymods.conf:
  @echo Linking with the standard modules.

-modules: $(@E@NTRYOBJ)
+modules: $(@E@NTRYOBJ) $(@L@IBZSH)

 $(ENTRYOBJ): FORCE
  @$(MAKE) -f Makemod $(MAKEDEFS) $@
diff --git c/Src/zsh.mdd w/Src/zsh.mdd
index 8480538501..eae12bff19 100644
--- c/Src/zsh.mdd
+++ w/Src/zsh.mdd
@@ -54,8 +54,8 @@ patchlevel.h: FORCE
  @if [ -f $(sdir)/$@.release ]; then \
   cp -f $(sdir)/$@.release $@; \
  else \
-  echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags
--long --abbrev=7`'"' > $@.tmp; \
-  cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv -f $@.tmp $@; \
+  echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags
--long --abbrev=7`'"' > $@.tmp.$$$$; \
+  cmp $@ $@.tmp.$$$$ >/dev/null 2>&1 && rm -f $@.tmp.$$$$ || mv -f
$@.tmp.$$$$ $@; \
  fi
 FORCE:


On Mon, Oct 5, 2026 at 6:14 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> This is already handled by the @L@ mechanism, around line 2850 in configure.ac
>
> if test "x$dynamic" = xyes; then
>   zsh_SYS_DYNAMIC_CLASH
>   zsh_SYS_DYNAMIC_GLOBAL
>   RTLD_GLOBAL_OK=$zsh_cv_sys_dynamic_rtld_global
>   zsh_SYS_DYNAMIC_EXECSYMS
>   if test "$zsh_cv_sys_dynamic_execsyms" != yes; then
>     L=L
>   fi
>   zsh_SYS_DYNAMIC_STRIP_EXE
>   zsh_SYS_DYNAMIC_STRIP_LIB
>   if $strip_exeldflags && test "$zsh_cv_sys_dynamic_strip_exe" = yes; then
>     EXELDFLAGS="$EXELDFLAGS -s"
>   fi
>   if $strip_libldflags && test "$zsh_cv_sys_dynamic_strip_lib" = yes; then
>     LIBLDFLAGS="$LIBLDFLAGS -s"
>   fi
>   if test "$host_os" = cygwin; then
>     INSTLIB="install.cygwin-lib"
>     UNINSTLIB="uninstall.cygwin-lib"
>   fi
> else
>   $strip_exeldflags && EXELDFLAGS="$EXELDFLAGS -s"
>   $strip_libldflags && LIBLDFLAGS="$LIBLDFLAGS -s"
>   RTLD_GLOBAL_OK=no
> fi
>
> so we can hopefully just do this:
> modules: $(@L@IBZSH)
>
> Maybe this spot makes sense:
>
> diff --git i/Src/Makefile.in w/Src/Makefile.in
> index 99bafc065f..819d3a6136 100644
> --- i/Src/Makefile.in
> +++ w/Src/Makefile.in
> @@ -131,11 +131,11 @@ FORCE:
>  # ========== LINKING IN MODULES ==========
>
>  mymods.conf:
> @echo Linking with the standard modules.
>
> -modules: $(@E@NTRYOBJ)
> +modules: $(@E@NTRYOBJ) $(@L@IBZSH)
>
>  $(ENTRYOBJ): FORCE
>         @$(MAKE) -f Makemod $(MAKEDEFS) $@
>
>  # ========== DEPENDENCIES FOR INSTALLING ==========
>
>
> > case-3:
> > In this case, build apparently succeeds, but resulting zsh.exe depends on
> > libzsh-5.9.999.3-test.dll.tmp.$$:
> > % ldd Src/zsh.exe
> >         (snip)
> >         libzsh-5.9.999.3-test.dll.tmp.51386 => not found
>
> I guess we can't use the tmp name directly with -o then, hm. Maybe
> instead of invoking another make to build the target, it would be
> better to just wait for the file to appears, since it presumably will.
> I'm not sure if there's a good portable way to do that though (loop
> with sleep and test?)... Or if such waits would take up 'slots' in the
> make server and end up possibly deadlocking the build. (just a theory,
> haven't seen that happen).
>
> You could try removing this (the DLLINK change) hunk for now, it
> should be pretty unlikely to actually hit the race, the idea was just
> to ensure that it doesn't read a partial file if it does happen to
> race.
>
> On Sun, Oct 4, 2026 at 10:06 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > Jun T wrote on Sun, 04 Oct 2026 18:12 +00:00:
> > > The following seems to work (patch over PATCHv2, without 55190).
> > > What is the simplest way to add this dependency only if building on
> > > Cygwin?
> >
> > Add to Src/Makefile.in the line «@EXTRA_DEPENDENCIES_OF_modules@»
> > next to one of the existing «modules: …» lines, and have configure.ac
> > set ${EXTRA_DEPENDENCIES_OF_modules} either to the empty string or to
> > «modules: $(LIBZSH)» and AC_SUBST() it?
> >
> > Alternatively, it looks like AC_CONFIG_FILES() has an optional second
> > argument for running additional code; proof of concept:
> >
> > [[[
> > --- configure.ac
> > +++ configure.ac
> > @@ -3068,7 +3068,9 @@ AC_SUBST_FILE(DEFS_MK)dnl
> >  AC_SUBST_FILE(VERSION_MK)dnl
> >
> >  AC_CONFIG_FILES(Config/defs.mk Makefile Doc/Makefile Etc/Makefile \
> > -Src/Makefile Test/Makefile)
> > +Test/Makefile)
> > +AC_CONFIG_FILES(Src/Makefile, [if uname -so | grep -qi linux; then echo '# yes'; else echo '# no'; fi >> Src/Makefile])
> > +
> >  AC_CONFIG_COMMANDS([config.modules], [. ./config.modules.sh])
> >  AC_CONFIG_COMMANDS([stamp-h], [echo >stamp-h])
> > ]]]
> >
> > I haven't checked whether this would require us to bump our autoconf
> > version requirement.
> >
> > In any case, should the condition be literally "if building on Cygwin",
> > or is there some behaviour or limitation of the Cygwin compiler/linker/etc
> > that can be tested for?  (e.g., by trying to compile/link a test program)
> >
> > Cheers,
> >
> > Daniel
> >
> > >
> > > diff --git a/Src/Makefile.in b/Src/Makefile.in
> > > index 7fc0b364d..755a911a0 100644
> > > --- a/Src/Makefile.in
> > > +++ b/Src/Makefile.in
> > > @@ -88,6 +88,8 @@ $(LIBZSH): $(LIBOBJS) $(NSTMP)
> > >       rm -f $@
> > >       $(DLLINK) $(LIBOBJS) $(NLIST) $(LIBS)
> > >
> > > +modules: $(LIBZSH)
> > > +
> > >  zsh.res.o: $(sdir)/zsh.rc $(sdir)/zsh.ico
> > >       windres -O coff --include-dir $(sdir) -i $(sdir)/zsh.rc -o zsh.res.o
> >
>
>
> --
> Mikael Magnusson



-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author