[commit: ghc] master: The -package flag should select match from right-most package db. (1b00016)

git at git.haskell.org git at git.haskell.org
Sun Dec 27 23:14:11 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1b0001680ef66a2853103974d3f3f956bb0560a3/ghc

>---------------------------------------------------------------

commit 1b0001680ef66a2853103974d3f3f956bb0560a3
Author: Edward Z. Yang <ezyang at cs.stanford.edu>
Date:   Sun Dec 27 23:57:18 2015 +0100

    The -package flag should select match from right-most package db.
    
    The shadowing and default behavior (in the absence of
    -hide-all-packages) prefers packages that come from "later" package
    databases.  So for example if tmp1.d and tmp2.d both expose p-1.0, then
    
        ghc -package-db tmp1.d -package-db tmp2.d
    
    brings the p-1.0 from tmp2.d into scope (and if they have the same IPID,
    tmp2.d shadows tmp1.d).  HOWEVER, -package flags do NOT respect this
    behavior.
    
        ghc -package-db tmp1.d -package-db tmp2.d -package p-1.0
    
    this will force the p-1.0 from tmp1.d to be exposed!  This is
    confusing, so this patch makes the behavior of -package flags
    consistent.
    
    Signed-off-by: Edward Z. Yang <ezyang at cs.stanford.edu>
    
    Test Plan: validate
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1709


>---------------------------------------------------------------

1b0001680ef66a2853103974d3f3f956bb0560a3
 compiler/main/Packages.hs                          |  4 ++-
 testsuite/.gitignore                               |  3 ++
 testsuite/tests/cabal/cabal08/Main.hs              |  2 ++
 testsuite/tests/cabal/cabal08/Makefile             | 32 ++++++++++++++++++++++
 .../tests/cabal/{cabal05 => cabal08}/Setup.hs      |  0
 testsuite/tests/cabal/{cabal06 => cabal08}/all.T   |  4 +--
 testsuite/tests/cabal/cabal08/cabal08.stdout       |  6 ++++
 testsuite/tests/cabal/cabal08/p1/ChangeLog.md      |  5 ++++
 .../tests/cabal/cabal08/p1}/LICENSE                |  4 +--
 .../tests/cabal/{cabal06/p-1.0 => cabal08/p1}/P.hs |  3 +-
 .../tests/cabal/{cabal05 => cabal08/p1}/Setup.hs   |  0
 .../cabal/{cabal06/p-1.0 => cabal08/p1}/p.cabal    |  8 ++++--
 testsuite/tests/cabal/cabal08/p2/ChangeLog.md      |  5 ++++
 .../tests/cabal/cabal08/p2}/LICENSE                |  4 +--
 .../tests/cabal/{cabal06/p-1.0 => cabal08/p2}/P.hs |  3 +-
 .../tests/cabal/{cabal05 => cabal08/p2}/Setup.hs   |  0
 .../cabal/{cabal06/p-1.0 => cabal08/p2}/p.cabal    |  6 ++--
 17 files changed, 73 insertions(+), 16 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1b0001680ef66a2853103974d3f3f956bb0560a3


More information about the ghc-commits mailing list