[GHC] #10205: On Windows ghc-pkg always reports cache out of date

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 7.10.1 Keywords: | Operating System: Windows Architecture: x86 | Type of failure: Incorrect result Test Case: | at runtime Blocking: | Blocked By: Differential Revisions: | Related Tickets: -------------------------------------+------------------------------------- When I ran {{{ghc-pkg list}}} on Windows, it reported that the global and user caches were out of date. As instructed, I recached both caches. Despite this, I continued to get the same error message. It appears that the timestamp on the package.conf.d directory is always a few milliseconds later than the timestamp of the package cache, even after recaching, as shown by the log excerpt below. Original error: {{{ C:\Users\hgolden\AppData\Roaming>ghc-pkg check WARNING: cache is out of date: C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. WARNING: cache is out of date: C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. [snip...] }}} Checking timestamps: {{{ C:\Users\hgolden\AppData\Roaming>ghc-pkg -v2 list Timestamp 2015-03-27 21:18:29.5247984 UTC for C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\pa ckage.cache Timestamp 2015-03-27 21:18:29.5277984 UTC for C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d (N EWER than cache) WARNING: cache is out of date: C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. [snip...] Timestamp 2015-03-27 21:15:48.6285984 UTC for C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache Timestamp 2015-03-27 21:15:48.6835984 UTC for C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d (NEWER than c ache) WARNING: cache is out of date: C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. [snip...] }}} Recaching as instructed: {{{ C:\Users\hgolden\AppData\Roaming>ghc-pkg -v2 recache --user [snip...] modifying: Just "C:\\Users\\hgolden\\AppData\\Roaming\\ghc\\i386-mingw32-7.10.1\\package.conf.d" flag db stack: ["C:\\Users\\hgolden\\AppData\\Roaming\\ghc\\i386-mingw32-7.10.1\\package.conf.d"] writing cache C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\package.cache C:\Users\hgolden\AppData\Roaming>ghc-pkg -v2 recache --global [snip...] modifying: Just "C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\\lib\\package.conf.d" flag db stack: ["C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\\lib\\package.conf.d"] writing cache C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache }}} Looking at timestamps after recaching: {{{ C:\Users\hgolden\AppData\Roaming>ghc-pkg -v2 list Timestamp 2015-03-27 21:21:50.3341984 UTC for C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\pa ckage.cache Timestamp 2015-03-27 21:21:50.3371984 UTC for C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d (N EWER than cache) WARNING: cache is out of date: C:\Users\hgolden\AppData\Roaming\ghc\i386-mingw32-7.10.1\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. [snip...] Timestamp 2015-03-27 21:23:05.4329984 UTC for C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache Timestamp 2015-03-27 21:23:05.4359984 UTC for C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d (NEWER than c ache) WARNING: cache is out of date: C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. C:\Users\hgolden\AppData\Roaming> }}} Timestamps have changed, but each directory's timestamp is still a few milliseconds after each cache file's timestamp. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: x86 Type of failure: Incorrect result | Test Case: at runtime | Blocking: Blocked By: | Differential Revisions: Related Tickets: | -------------------------------------+------------------------------------- Comment (by dmcclean): This happens to me too, on Windows 7 Home Premium, SP1, x64. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * architecture: x86 => Unknown/Multiple * milestone: => 7.10.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Kludgy): NTFS modified dates on Windows are unreliable, often clocking the directory modified date a few seconds ahead or behind their file changes. The results also vary depending on how NTFS is configured. It is likely that Windows users seeing this issue persist after a recache have millisecond precision enabled on timestamps, making ghc-pkg much more sensitive to the errors. Having ghc-pkg work on per-minute precision could help to ameliorate the problem, but ideally the tools should not be relying on implicit assumptions about directory modified times at all. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rpaladugu1): You can remove the following message by opening the command prompt as administrator and doing the "ghc-pkg recache" in the C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib folder. It worked for me and the message was gone. WARNING: cache is out of date: C:/Program Files/MinGHC-7.10.1/ghc-7.10.1\lib\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thoughtpolice): Yes, to be clear, was this with the binary distribution, MinGW, Haskell Platform, etc? We shouldn't ever need administrative privileges in the regular binary distribution for anything, so this may not be our bug if that fixes it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: new => infoneeded -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

Yes, to be clear, was this with the binary distribution, MinGW, Haskell Platform, etc? We shouldn't ever need administrative privileges in the regular binary distribution for anything, so this may not be our bug if
#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by hgolden): Replying to [comment:5 thoughtpolice]: that fixes it? In my original report, there are two separate sets of messages: One is for the global directory and the other is for my personal directory. As a non- administrator user, I don't have write access to the global directory, since it is a subdirectory of C:\Program Files (under Windows 7 or later). However, I do have access to my own directory. I am getting the out-of- date messages for both files. As I recall, when I ran into this situation, I had administrative privileges on my PC. In my company's wisdom, I no longer have administrative privileges, so I can't test the proposed fix in comment #4, but I believe I already did that in the original report. Storing the global cache (or any other part of GHC) in a subdirectory of C:\Program Files will not work if the user doesn't have administrative privileges, at least under Windows 7 or later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rpaladugu1): Without admin privileges, you can not even install it in c:\Program Files folder or anywhere else. The installer did ask admin privileges before starting the installation process if you logged in as standard user. The default location "i.e.C:\Program Files" is optional for MingGW or Haskell Platform during the install time. You can choose to override and install it somewhere. I have tested both MingGW and Haskell Platform and indeed was the case. As such there is no issue with the platform. However, doucmentation could be updated to highlight this issue so that there is a workaround. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => new Comment: I am looking into this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: thomie Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * owner: => thomie -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: thomie Type: bug | Status: patch Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch * differential: => Phab:D990 * milestone: 7.10.3 => 7.10.2 Comment: I think we can fix this still for 7.10.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: thomie Type: bug | Status: patch Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Comment (by thomie): Replying to [comment:3 Kludgy]:
EDIT: Not sure if it helps, but certain operations (like renaming a file with a directory) cause the directory modified time to be updated, usually leading to the directory modified time exceeding the file modified time.
It was exactly this! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date
-------------------------------------+-------------------------------------
Reporter: hgolden | Owner: thomie
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.2
Component: ghc-pkg | Version: 7.10.1
Resolution: | Keywords:
Operating System: Windows | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D990
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: thomie Type: bug | Status: merge Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: thomie Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by svenpanne): * owner: thomie => * status: closed => new * resolution: fixed => Comment: This is still broken in the 7.10rc2 on Windows. {{{ $ which ghc-pkg /c/Program Files/Haskell Platform/7.10.2/bin/ghc-pkg }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Comment (by thomie): {{{ Timestamp 2015-07-06 19:15:52 UTC for c:/Program Files/Haskell Platform/7.10.2\lib\package.conf.d\package.cache Timestamp 2015-07-07 07:51:56.8491787 UTC for c:/Program Files/Haskell Platform/7.10.2\lib\package.conf.d (NEWER than cache) WARNING: cache is out of date: c:/Program Files/Haskell Platform/7.10.2\lib\package.conf.d\package.cache ghc will see an old view of this package db. Use 'ghc-pkg recache' to fix. }}} Try running 'ghc-pkg recache' as the message says. Does it fix the problem? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:18 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Comment (by svenpanne): OK, running 'ghc-pkg recache' fixes the problem, but: a) You have to do it as an Administrator, which might not be an option for all users. b) The Windows installer for 7.10rc2 shouldn't install the package DB like this, forcing users to recache as an Administrator directly after installation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:20 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10205: On Windows ghc-pkg always reports cache out of date -------------------------------------+------------------------------------- Reporter: hgolden | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.2 Component: ghc-pkg | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Windows | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D990 -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * resolution: => fixed Comment: Ok, then it is not a reappearance of this bug. Sorry for leading you this way. I have opened the following ticket in the Haskell platform issue tracker for you: https://github.com/haskell/haskell-platform/issues/189. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10205#comment:21 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC