Skip to content

Default configJobs value is unsafe/wrong #4296

Closed
@hasufell

Description

@hasufell

The default configJobs value is:

     configJobs <-
        case getFirst configMonoidJobs of
            Nothing -> liftIO getNumProcessors
            Just i -> return i

This just counts your number of processors and assumes you have

  1. enough ram to run (nproc) jobs
  2. fast enough hard drive (IO) to run (nproc) jobs
  3. actually enough CPU power to not slow down everything else you are currently doing

As such, the default value is unsafe. It crashed my laptop today with 8 cores and 16GB of ram on installing pandoc, leaving unsaved files in nirvana. Luckily, there was no corruption.

Having a useful heuristics to determine a default value for jobs is hard. Many different things play together when you compile, not just number of processors, which is the most naive assumption. As such, the default value should be 1 and nothing else.

This also is in line with the stack slogan "Stack just works". If it crashes my laptop, it certainly isn't.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions