Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows/macOS max command line length being hit calling ghc #7075

Open
dten opened this issue Sep 16, 2020 · 2 comments
Open

Windows/macOS max command line length being hit calling ghc #7075

dten opened this issue Sep 16, 2020 · 2 comments

Comments

@dten
Copy link

dten commented Sep 16, 2020

Describe the bug
on Windows with a large project cabal build fails with:

E:\sb\x86_64-windows\ghc-8.8.4\bin\ghc.exe: createProcess: does not exist (No such file or directory)

To Reproduce
Steps to reproduce the behavior:
Have a large project. i made a repro here https://github.com/dten/cabal-max-path-repro

on windows in that repo

cabal build -v

Build will fail, but first it outputs the command it's trying to run which is approxy 38k characters long, longer than limit that can be given to createProcess. the command is that long because it includes all module names and there's a lot of them

Removing the last 20 or so modules from the Cabal package takes it under the limit and it then builds. (technically depends on ghc path)

Please use version-prefixed commands (e.g. v2-build or v1-build) to avoid ambiguity.
^^ dunno what this means :)

Expected behavior
A clear and concise description of what you expected to happen.

It should build

System information

  • Operating system: Windows 10 (2004)
  • cabal, ghc version: ghc 8.8.4, cabal 3.0.1.0 and also 2.0.1.1

Additional context
I think this is the same issue as #3122 where the solution was to use response files.

I think from this issue that GHC does not support them though https://gitlab.haskell.org/ghc/ghc/-/issues/16476

@ekmett
Copy link
Member

ekmett commented Mar 2, 2021

This is hitting me in https://github.com/ekmett/unboxed/tree/d8b073d162331d69eef7870f1a446d2e1c3d8159 if I build with -flevel2 on. There I spit out a very large number of backpack libraries and link them all together before reexporting many many modules.

Operating system: OSX
cabal 3.4.0.0, ghc version 9.0.1

though admittedly the issues triggers at a much longer line length on OSX

$ getconf ARG_MAX
262144

If I spin up the library I run into ghc line length limits. This seems to be a joint cabal/ghc issue. in that ghc can't take its arguments in request files, and cabal can't pass it those arguments in such a file yet.

If I start the repl and need -fobject-code I run into clang line length limits. This seems like a direct ghc issue.

@jneira jneira changed the title Windows max command line length being hit calling ghc Windows/macOS max command line length being hit calling ghc Mar 15, 2022
@jneira
Copy link
Member

jneira commented Mar 15, 2022

https://gitlab.haskell.org/ghc/ghc/-/issues/16476 has been milestoned to 9.6.1 recently 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants