mbj / stratosphere

Haskell EDSL and type-checker for AWS CloudFormation templates
MIT License
162 stars 19 forks source link

Argument list too long on macosx / ideas? #184

Closed mbj closed 1 year ago

mbj commented 3 years ago

I know this is essentially more an issue with stack/cabal/ghc.

Still as this projects triggers it I'm asking here if anyone knows a workaround to get a rid of:

stratosphere                     > /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/stack-b1e84d94c2a2fde8/stratosphere-0.59.1/library/Stratosphere/Outputs.hs:34:1: warning: [-Wunused-imports]
stratosphere                     >     The import of ‘Data.Semigroup’ is redundant
stratosphere                     >       except perhaps to import instances from ‘Data.Semigroup’
stratosphere                     >     To import instances alone, use: import Data.Semigroup()
stratosphere                     >    |
stratosphere                     > 34 | import Data.Semigroup (Semigroup)
stratosphere                     >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stratosphere                     > [2064 of 2066] Compiling Stratosphere.Template
stratosphere                     > [2065 of 2066] Compiling Stratosphere.Check
stratosphere                     > [2066 of 2066] Compiling Stratosphere
stratosphere                     > /Users/runner/.ghcup/ghc/8.10.2/bin/ghc: createProcess: runInteractiveProcess: exec: resource exhausted (Argument list too long)
Completed 138 action(s).

This is using stack-2.5.1 on Github actions.

As I'm posting this I'm rebuilding with verbosity to find the exact GHC command.

I hope its okay I ask for input here, as I assume others may have hit it already and have a workaround. If such a workaround is found: I'm happy to PR it to this projects README. As it'll allow others that will hit this issue to work with this great project efficiently.

jdreaver commented 3 years ago

Oh wow that looks annoying. I'm assuming it is because there are so many modules?

mbj commented 3 years ago

@jdjacobrli I assume it happens at the moment the various smaller modules get assembled into a bigger package, and each module is likely referenced with an absolute path, overflowing the character limit.

I'm sure there is a workaround, but blocked by private issues for the next 60min. Will post my progress on debugging this.

mbj commented 3 years ago

This is a public build showing the issue, this is with stack --verbose. Not showing the full CLI.

I suspect its the github actions environment leading to longer paths. https://github.com/mbj/stack-deploy/runs/1445686795?check_suite_focus=true#step:6:11422

mbj commented 2 years ago

For anyone watching here the issue is the number of modules running into OSX specific limits on the command line size.

The trick will be to split up this project into many, one per AWS service. Not only removing this issue class altogether, but also making compilation much faster as users will (just like with amazonka) only have to build the subprojects for the AWS features they actually use.

mbj commented 1 year ago

This was addressed via #207 (unreleased yet).