unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Timothy Sample <samplet@ngyro.com>
To: John Soo <jsoo1@asu.edu>
Cc: 39309@debbugs.gnu.org
Subject: [bug#39309] [PATCH WIP] gnu: add stack.
Date: Sat, 15 Feb 2020 20:56:25 -0500	[thread overview]
Message-ID: <875zg78fcm.fsf@ngyro.com> (raw)
In-Reply-To: <87y2t6ayax.fsf@ngyro.com> (Timothy Sample's message of "Thu, 13 Feb 2020 17:59:34 -0500")

Hello again,

Timothy Sample <samplet@ngyro.com> writes:

> [...]
>
> I’ll take another look with a fresh mind sometime, and see if I can make
> any progress.

I don’t have a solution, but I have a bit more info.  Cabal generates
extremely long argument lists for GCC.  For whatever reason, it repeats
the same flags many times (maybe once for each Haskell dependency).
When building Stack, it passes Gawk as an include path 164 times.  In
fact, there are only a handful of distinct include paths, each passed
164 times.  The linker flags are similar but much worse.

This should be fine since everything is using a response file, right?
Nope.  Like the bug you linked discusses, GCC writes all of its
arguments into an environment variable, the length of which is limited
by “MAX_ARG_STRLEN” (which is 128K).  It would be nice to fix GCC here,
and it’s almost a very small fix, but there is minor complication.  The
normal response file handling in GCC expects “argc” and “argv”
parameters, but the environment variable doesn’t come with an “argc”.
Rather, it has to be parsed (in the same way the shell would do it).
It’s still doable, but a it would be a larger change.  Not to mention
that patching GCC is even less fun than patching GHC.

There was some work to deduplicate the flags that Cabal generates:
<https://github.com/haskell/cabal/pull/5356/>.  This would actually fix
the build, but the call to “hsc2hs” doesn’t do the same deduplication
(see “ppHsc2hs” in “Cabal/Distribution/Simple/PreProcess.hs”).

At this point, it might be worth joining the Nix folks on that issue,
and suggesting a patch to Cabal to call “hsc2hs” with deduplicated
flags.  It will help that the other deduplication code was written by
the same person who filed the bug you linked to earlier.  Once the patch
lands, we can apply it to our Cabal and then Stack will build.  Yay!


-- Tim

  reply	other threads:[~2020-02-16  1:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 14:56 [bug#39309] .[PATCH] WIP gnu: add stack John Soo
2020-01-29 15:17 ` [bug#39309] [PATCH WIP] " John Soo
2020-02-07 17:32   ` John Soo
2020-02-10  6:06     ` Timothy Sample
2020-02-13 13:52       ` John Soo
2020-02-13 13:59         ` John Soo
2020-02-13 17:36           ` John Soo
2020-02-13 22:59             ` Timothy Sample
2020-02-16  1:56               ` Timothy Sample [this message]
2020-02-19 14:56                 ` John Soo
2020-02-20  4:55                   ` Timothy Sample
2020-02-22 15:34                     ` Timothy Sample
2020-03-11  9:17                       ` John Soo
2020-03-11 14:18                         ` Timothy Sample
2020-03-13 15:05                           ` John Soo
2021-01-01 18:04                             ` [bug#39309] .[PATCH] WIP " John Soo
2021-01-01 18:18                               ` John Soo

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://guix.gnu.org/

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

  git send-email \
    --in-reply-to=875zg78fcm.fsf@ngyro.com \
    --to=samplet@ngyro.com \
    --cc=39309@debbugs.gnu.org \
    --cc=jsoo1@asu.edu \
    /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/guix.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).