haskell / haskell/cabal

Windows/macOS max command line length being hit calling ghc

Open
#7,075 3 comments 0 reactions 0 assignees View on GitHub
platform: mac platform: windows type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**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 https://github.com/haskell/cabal/issues/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.