       messageTypes: ['build']
       defaultSeverity: 'build'
       canCancel: true
-
-  cabalFileError: ->
-    @upi.addMessages [
-      message: 'No cabal file found'
-      severity: 'error'
-    ]
-    @upi.setStatus status: 'error'

  cabalBuild: (cmd, opts) =>
    # It shouldn't be possible to call this function until cabalProcess
    # exits. Otherwise, problems will ensue.
    return opts.onDone?() if @cabalProcess?.running

    Promise.all [@upi.getConfigParam('builder'), @upi.getConfigParam('target')]
    .then ([builder, target]) =>

            spawnOpts: @spawnOpts(cabalRoot)
            buildDir: @getConfigOpt('buildDir')
          }
          buildf args
        else
          throw new Error("Unkown builder '#{builder?.name ? builder}'")
      else
        @upi.addMessages [
          message: 'No cabal file found'
          severity: 'error'
        ]
        return {}
    .then (res) =>
      @running = false
      return res
    .catch (error) =>
      @running = false
      if error?
        console.error error
        atom.notifications.addFatalError error.toString(),
          detail: error
          dismissable: true
      return {}

  builders:
    none: ({opts}) -> return {exitCode: 0, hasError: false}
    cabal: ({cmd, opts, target, cabalRoot, spawnOpts, buildDir}) ->
      cabalArgs = [cmd]
      switch cmd
