[GHC] #10550: Drop truncated package name prefix from package keys

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package | Version: 7.11 system | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Early on when we moved to package keys, we decided it would be useful for documentation purposes to have a package key be something like `ghcpr_8TmvWUcS1U1IKHT0levwg3` rather than just `8TmvWUcS1U1IKHT0levwg3`, which would leave a user with no idea what the key is. I now think that this is more trouble than its worth: 1. We have fixed library *paths* so that the full package name, version, key is in the path, e.g. libraries are installed to `/home/ezyang/Dev/ghc-7.10.2/usr/lib/ghc-7.10.2/ghc- prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3` instead of `/home/ezyang/Dev/ghc-7.10.1/usr/lib/ghc-7.10.1/ghcpr_8TmvWUcS1U1IKHT0levwg3`. This means that the biggest case where users might care about package keys is no longer relevant; a user will always be able to get the real package key. 2. The other case where package keys show up is in symbol names. However, symbol names already contain *modules names*, so today we have `procezu0hwN3CTKynhHQqQkChnSdH_SystemziProcess_rawSystem1_info` but `0hwN3CTKynhHQqQkChnSdH_SystemziProcess_rawSystem1_info` seems just about as clear (in particular, five letters just doesn't seem like enough to adequately describe long package names.) 3. Now, the reason why we don't want to truncate the prefix name is because it makes it more difficult to reliably, deterministically generate a package key based on a few parameters about a package: namely, any algorithm needs to know that `take 5 (filter (/= '-') packageName)` and prefix that onto the key. Really, we only care about the hash, but for most equality tests the prefix matters too! So it would be much nicer if we didn't have to care about the hash as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Works for me, is there a convenient `ghc-pkg something 0hwN3CTKynhHQqQkChnSdH` that will hand me `process-1.2.3.0` back? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ezyang): Yeah, `ghc-pkg describe --package-key blah`, which is already in 7.10.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by ezyang): Backwards compatibility considerations: GHC 7.10.1/7.10.2 will ship with libraries that are installed as `ghcpr_8TmvWUcS1U1IKHT0levwg3`, so Cabal will need to continue to understand this format. However, GHC is indifferent to how you pick future `-this-package-key`, so Cabal can simply generate `8TmvWUcS1U1IKHT0levwg3` for any subsequent installations and GHC wouldn't mind. (Old Cabal would not be able to read the package database however, because the parser is not setup to understand `8TmvWUcS1U1IKHT0levwg3`, but `ghc-pkg` doesn't validate the format so this would simply translate into not being able to use Cabal to manage a more recent package database, which I think already applies.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Generally ok with me, but please document in the user manual, in as many plausible places as possible, the use of `ghc-pkg` to decode the package key. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D1011 -------------------------------------+------------------------------------- Changes (by ezyang): * differential: => Phab:D1011 Comment: GHC plus Cabal PR: https://github.com/haskell/cabal/pull/2671 Simon, I added a note to the user manual; however, I think it might be better to arrange for GHC proper to never display raw package keys to users; always given them an IPID instead (falling back on the key only if something really bad has happened re the package database.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10550: Drop truncated package name prefix from package keys
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: bug | Status: new
Priority: normal | Milestone: 7.12.1
Component: Package system | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D1011
-------------------------------------+-------------------------------------
Comment (by Edward Z. Yang

#10550: Drop truncated package name prefix from package keys -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Package system | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D1011 -------------------------------------+------------------------------------- Changes (by ezyang): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10550#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC