A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/commercialhaskell/stack/commit/d1e6c480cd46def34bfacd3aeaee953ba32c7758 below:

Clean up --only-dependencies logic in ConstructPlan · commercialhaskell/stack@d1e6c48 · GitHub

@@ -295,7 +295,7 @@ mkUnregisterLocal tasks dirtyReason localDumpPkgs sourceMap =

295 295 296 296

addFinal :: LocalPackage -> Package -> Bool -> M ()

297 297

addFinal lp package isAllInOne = do

298 -

depsRes <- addPackageDeps False package

298 +

depsRes <- addPackageDeps package

299 299

res <- case depsRes of

300 300

Left e -> return $ Left e

301 301

Right (missing, present, _minLoc) -> do

@@ -349,10 +349,10 @@ addDep treatAsDep' name = do

349 349

return $ Right $ ADRFound loc installed

350 350

Just (PIOnlySource ps) -> do

351 351

tellExecutables name ps

352 -

installPackage treatAsDep name ps Nothing

352 +

installPackage name ps Nothing

353 353

Just (PIBoth ps installed) -> do

354 354

tellExecutables name ps

355 -

installPackage treatAsDep name ps (Just installed)

355 +

installPackage name ps (Just installed)

356 356

updateLibMap name res

357 357

return res

358 358

@@ -394,30 +394,29 @@ tellExecutablesPackage loc p = do

394 394

| Set.null myComps = x

395 395

| otherwise = Set.intersection x myComps

396 396 397 -

installPackage :: Bool -- ^ is this being used by a dependency?

398 -

-> PackageName

397 +

installPackage :: PackageName

399 398

-> PackageSource

400 399

-> Maybe Installed

401 400

-> M (Either ConstructPlanException AddDepRes)

402 -

installPackage treatAsDep name ps minstalled = do

401 +

installPackage name ps minstalled = do

403 402

ctx <- ask

404 403

case ps of

405 404

PSUpstream version _ flags ghcOptions _ -> do

406 405

planDebug $ "installPackage: Doing all-in-one build for upstream package " ++ show name

407 406

package <- liftIO $ loadPackage ctx name version flags ghcOptions

408 -

resolveDepsAndInstall True treatAsDep ps package minstalled

407 +

resolveDepsAndInstall True ps package minstalled

409 408

PSLocal lp ->

410 409

case lpTestBench lp of

411 410

Nothing -> do

412 411

planDebug $ "installPackage: No test / bench component for " ++ show name ++ " so doing an all-in-one build."

413 -

resolveDepsAndInstall True treatAsDep ps (lpPackage lp) minstalled

412 +

resolveDepsAndInstall True ps (lpPackage lp) minstalled

414 413

Just tb -> do

415 414

-- Attempt to find a plan which performs an all-in-one

416 415

-- build. Ignore the writer action + reset the state if

417 416

-- it fails.

418 417

s <- get

419 418

res <- pass $ do

420 -

res <- addPackageDeps treatAsDep tb

419 +

res <- addPackageDeps tb

421 420

let writerFunc w = case res of

422 421

Left _ -> mempty

423 422

_ -> w

@@ -438,7 +437,7 @@ installPackage treatAsDep name ps minstalled = do

438 437

put s

439 438

-- Otherwise, fall back on building the

440 439

-- tests / benchmarks in a separate step.

441 -

res' <- resolveDepsAndInstall False treatAsDep ps (lpPackage lp) minstalled

440 +

res' <- resolveDepsAndInstall False ps (lpPackage lp) minstalled

442 441

when (isRight res') $ do

443 442

-- Insert it into the map so that it's

444 443

-- available for addFinal.

@@ -447,13 +446,12 @@ installPackage treatAsDep name ps minstalled = do

447 446

return res'

448 447 449 448

resolveDepsAndInstall :: Bool

450 -

-> Bool

451 449

-> PackageSource

452 450

-> Package

453 451

-> Maybe Installed

454 452

-> M (Either ConstructPlanException AddDepRes)

455 -

resolveDepsAndInstall isAllInOne treatAsDep ps package minstalled = do

456 -

res <- addPackageDeps treatAsDep package

453 +

resolveDepsAndInstall isAllInOne ps package minstalled = do

454 +

res <- addPackageDeps package

457 455

case res of

458 456

Left err -> return $ Left err

459 457

Right deps -> liftM Right $ installPackageGivenDeps isAllInOne ps package minstalled deps

@@ -517,13 +515,12 @@ addEllipsis t

517 515

| T.length t < 100 = t

518 516

| otherwise = T.take 97 t <> "..."

519 517 520 -

addPackageDeps :: Bool -- ^ is this being used by a dependency?

521 -

-> Package -> M (Either ConstructPlanException (Set PackageIdentifier, Map PackageIdentifier GhcPkgId, InstallLocation))

522 -

addPackageDeps treatAsDep package = do

518 +

addPackageDeps :: Package -> M (Either ConstructPlanException (Set PackageIdentifier, Map PackageIdentifier GhcPkgId, InstallLocation))

519 +

addPackageDeps package = do

523 520

ctx <- ask

524 521

deps' <- packageDepsWithTools package

525 522

deps <- forM (Map.toList deps') $ \(depname, range) -> do

526 -

eres <- addDep treatAsDep depname

523 +

eres <- addDep True depname

527 524

let getLatestApplicable = do

528 525

vs <- liftIO $ getVersions ctx depname

529 526

return (latestApplicableVersion range vs)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4