#2172 WSL: make dist is hideously broken

WSL
unread
nobody
None
Bug
none
Unknown
False
2015-02-15
2014-01-16
Keith Marshall
No

I'm beginning to wonder why I bother wasting my time with this project! (Since retiring from my day job, it's not even as if I have any need to use a deficient OS like MS-Windows, any longer).

This one is particularly frustrating, because I had already invested a fair bit of effort into cleaning up the w32api/mingwrt build system, towards the end of the 3.x release series, only to have my ten steps forward completely cancelled by your 500 steps backward! It would be kind to say that you're not very good at writing makefiles and configure scripts; not only is it now several orders of magnitude more hideous than I ever remember it, it just plain DOESN'T WORK!

Here's an example: this makefile fragment...

docdir=${datarootdir}/doc/${PACKAGE_TARNAME}
mingwrtdocdir=$(docdir)/../mingwrt
w32apidocdir=$(docdir)/../w32api

which arises from this Makefile.in fragment...

docdir=@docdir@
mingwrtdocdir=$(docdir)/../mingwrt
w32apidocdir=$(docdir)/../w32api

leads to invalid usage when subsequently referring to ${mingwrtdocdir}, or to ${w32apidocdir}, after creating them like this...

$(mkinstalldirs) $(DESTDIR)$(mingwrtdocdir)
$(mkinstalldirs) $(DESTDIR)$(mingwrtdocdir)/historical
rmdir $(DESTDIR)$(mingwrtdocdir)/../mingw-org-wsl

and...

$(mkinstalldirs) $(DESTDIR)$(w32apidocdir)
$(mkinstalldirs) $(DESTDIR)$(w32apidocdir)/historical
rmdir $(DESTDIR)$(w32apidocdir)/../mingw-org-wsl

which immediately renders all subsequent references to either ${mingwrtdocdir} or to ${w32apidocdir} as invalid, because, (since ${PACKAGE_TARNAME} is equivalent to mingw-org-wsl), they resolve to...

$(DESTDIR)${datarootdir}/doc/mingw-org-wsl/../mingwrt

and...

$(DESTDIR)${datarootdir}/doc/mingw-org-wsl/../w32api

respectively, and path name resolution stops, with an ENOTDIR exception, at...

$(DESTDIR)${datarootdir}/doc/mingw-org-wsl

which, thanks to the rmdir commands, is guaranteed not to exist!

Okay, I can kludge around this, only to then have "make dist" blow up again, thanks to this pearl of dreadful scripting:

cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw_org_wsl

which, if cp wasn't smart enough to recognize that this is rubbish, in the most likely case of copying into a staging subdirectory of ${top_srcdir} itself -- this is staging a source distribution within the build directory, which cold quite realistically reside within the primary source tree -- would imply recursively copying $(DESTDIR)$(prefix)/mingw_org_wsl -- and why has it now become mingw_org_wsl, where we formerly saw mingw-org-wsl? -- into further subdirectories of itself, ad infinitum (or at least, until disk space is exhausted).

Sorry that this has been something of a rant, but, after all my previous hard work to clean it up, this build system has once again degenerated into the stuff of nightmares. At the very least, the sections dealing with configuration, installation, and distribution need to be thrown away, and rewritten from scratch, preferably by someone who actually knows what they are doing.

Related

Issues: #2175

Discussion

  • Keith Marshall
    Keith Marshall
    2014-01-16

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -60,6 +60,6 @@
     cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw_org_wsl
    

    -which, if cp wasn't smart enough to recognize that this is rubbish, would mean that, in the most likely case of copying into a staging subdirectory of ${top_srcdir} itself -- this is staging a source distribution -- would imply recursively copying $(DESTDIR)$(prefix)/mingw_org_wsl -- and why has it now become mingw_org_wsl, where we formerly saw mingw-org-wsl? -- into further subdirectories of itself, ad infinitum (or at least, until disk space is exhausted).
    +which, if cp wasn't smart enough to recognize that this is rubbish, would imply, in the most likely case of copying into a staging subdirectory of ${top_srcdir} itself -- this is staging a source distribution within the build directory, which cold quite realistically reside within the primary source tree -- recursively copying $(DESTDIR)$(prefix)/mingw_org_wsl -- and why has it now become mingw_org_wsl, where we formerly saw mingw-org-wsl? -- into further subdirectories of itself, ad infinitum (or at least, until disk space is exhausted).

    Sorry that this has been something of a rant, but, after all my previous hard work to clean it up, this build system has once again degenerated into the stuff of nightmares. At the very least, the sections dealing with configuration, installation, and distribution need to be thrown away, and rewritten from scratch, preferably by someone who actually knows what they are doing.

     
  • Keith Marshall
    Keith Marshall
    2014-01-16

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -60,6 +60,6 @@
     cp -af $(top_srcdir) $(DESTDIR)$(prefix)/mingw_org_wsl
    

    -which, if cp wasn't smart enough to recognize that this is rubbish, would imply, in the most likely case of copying into a staging subdirectory of ${top_srcdir} itself -- this is staging a source distribution within the build directory, which cold quite realistically reside within the primary source tree -- recursively copying $(DESTDIR)$(prefix)/mingw_org_wsl -- and why has it now become mingw_org_wsl, where we formerly saw mingw-org-wsl? -- into further subdirectories of itself, ad infinitum (or at least, until disk space is exhausted).
    +which, if cp wasn't smart enough to recognize that this is rubbish, in the most likely case of copying into a staging subdirectory of ${top_srcdir} itself -- this is staging a source distribution within the build directory, which cold quite realistically reside within the primary source tree -- would imply recursively copying $(DESTDIR)$(prefix)/mingw_org_wsl -- and why has it now become mingw_org_wsl, where we formerly saw mingw-org-wsl? -- into further subdirectories of itself, ad infinitum (or at least, until disk space is exhausted).

    Sorry that this has been something of a rant, but, after all my previous hard work to clean it up, this build system has once again degenerated into the stuff of nightmares. At the very least, the sections dealing with configuration, installation, and distribution need to be thrown away, and rewritten from scratch, preferably by someone who actually knows what they are doing.