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

Use ghc -j when building a single package #4486

Open
Blaisorblade opened this issue May 1, 2017 · 5 comments
Open

Use ghc -j when building a single package #4486

Blaisorblade opened this issue May 1, 2017 · 5 comments
Labels

Comments

@Blaisorblade
Copy link
Collaborator

cabal doesn't pass -j to GHC, to avoid launching too many processes. But that's the case even when it builds one package, in particular, the last one, after all dependencies are done. That's annoying when running cabal install on big packages, say Agda.

And while this is clearly a hack, it guarantees that not too many processes are created.

By #976 (comment), cabal build can pass -j but cabal install doesn't.

@nh2
Copy link
Member

nh2 commented May 1, 2017

See also #976 (comment)

@Blaisorblade
Copy link
Collaborator Author

Cc @ezyang @23Skidoo.

@ezyang
Copy link
Contributor

ezyang commented May 2, 2017

To generalize the hack, what if we pass -j to any package which is explicitly specified as a target?

@Blaisorblade
Copy link
Collaborator Author

It seems to me, if I specify two packages explicitly, that leads to too many jobs​. And if I use --only-dependencies, that leads to too few jobs.
The "hack idea" is "ensure trivially that at most one ghc -j is running", where "trivially" means "with limited code changes" and with a trivial proof.

A generalization consistent with this would be to use GHC -j also during the build, if there's a single package in the package queue. That can happen (seldom) before the end when all further packages depend on one. Is this easy/feasible to implement?

@phadej
Copy link
Collaborator

phadej commented May 3, 2017

I'd rather introduce --j-ghc or some other explicit flag.

There is a clash between user and script interfaces; in latter you don't want any magical hacks to change behavior

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

No branches or pull requests

5 participants