[GHC] #9775: "Failed to remove" errors during Windows build from hsc2hs
#9775: "Failed to remove" errors during Windows build from hsc2hs -------------------------------------+------------------------------------- Reporter: gintas | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.8.3 Keywords: | Operating System: Windows Architecture: Unknown/Multiple | Type of failure: Difficulty: Unknown | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- The Windows build over here spews a bunch of errors during the build like the ones below. All of them seem to be related to hsc2hs. The errors do not the build for some reason, so the problem is not critical, but we should look into what's going on here. Note that the errors are indeterministic and the set of files affected varies between builds. Examples: {{{ ghctrace.2/3.log:Failed to remove file libraries/base/dist- install/build/System/CPUTime_hsc_make.exe; error= DeleteFile "libraries/base/dist-install/build/System/CPUTime_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file compiler/stage2/build/Fingerprint_hsc_make.exe; error= DeleteFile "compiler/stage2/build/Fingerprint_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/1.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/4.log:Failed to remove file libraries/old-time/dist- install/build/System/Time_hsc_make.exe; error= DeleteFile "libraries/old- time/dist-install/build/System/Time_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/5.log:Failed to remove file libraries/Win32/dist- install/build/Graphics/Win32/GDI/Pen_hsc_make.exe; error= DeleteFile "libraries/Win32/dist-install/build/Graphics/Win32/GDI/Pen_hsc_make.exe": permission denied (Access is denied.) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs -------------------------------------+------------------------------------- Reporter: gintas | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Description changed by gintas: Old description:
The Windows build over here spews a bunch of errors during the build like the ones below. All of them seem to be related to hsc2hs. The errors do not the build for some reason, so the problem is not critical, but we should look into what's going on here.
Note that the errors are indeterministic and the set of files affected varies between builds.
Examples:
{{{ ghctrace.2/3.log:Failed to remove file libraries/base/dist- install/build/System/CPUTime_hsc_make.exe; error= DeleteFile "libraries/base/dist-install/build/System/CPUTime_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file compiler/stage2/build/Fingerprint_hsc_make.exe; error= DeleteFile "compiler/stage2/build/Fingerprint_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/1.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/4.log:Failed to remove file libraries/old-time/dist- install/build/System/Time_hsc_make.exe; error= DeleteFile "libraries/old- time/dist-install/build/System/Time_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/5.log:Failed to remove file libraries/Win32/dist- install/build/Graphics/Win32/GDI/Pen_hsc_make.exe; error= DeleteFile "libraries/Win32/dist-install/build/Graphics/Win32/GDI/Pen_hsc_make.exe": permission denied (Access is denied.) }}}
New description: The Windows build over here spews a bunch of errors during the build like the ones below. All of them seem to be related to hsc2hs. The errors do not break the build for some reason, so the problem is not critical, but we should look into what's going on here. Note that the errors are indeterministic and the set of files affected varies between builds. Examples: {{{ ghctrace.2/3.log:Failed to remove file libraries/base/dist- install/build/System/CPUTime_hsc_make.exe; error= DeleteFile "libraries/base/dist-install/build/System/CPUTime_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.2/4.log:Failed to remove file compiler/stage2/build/Fingerprint_hsc_make.exe; error= DeleteFile "compiler/stage2/build/Fingerprint_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/1.log:Failed to remove file libraries/hpc/dist- boot/build/Trace/Hpc/Reflect_hsc_make.exe; error= DeleteFile "libraries/hpc/dist-boot/build/Trace/Hpc/Reflect_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/4.log:Failed to remove file libraries/old-time/dist- install/build/System/Time_hsc_make.exe; error= DeleteFile "libraries/old- time/dist-install/build/System/Time_hsc_make.exe": permission denied (Access is denied.) ghctrace.3/5.log:Failed to remove file libraries/Win32/dist- install/build/Graphics/Win32/GDI/Pen_hsc_make.exe; error= DeleteFile "libraries/Win32/dist-install/build/Graphics/Win32/GDI/Pen_hsc_make.exe": permission denied (Access is denied.) }}} -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs -------------------------------------+------------------------------------- Reporter: gintas | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by gintas): Looks like this is an old issue, all the way back from 2006, see here: http://web.archiveorange.com/archive/v/j7U5ds4Ozu7dvDiQLdtl The code that spews the error is already trying to work around the issue, but fails, it just does not break the build process. On the bright side, this particular error is not harmful, the outcome is just that a temporary file does not get deleted. Relevant code: {{{ -- delay the cleanup of generated files until the end; attempts to -- get around intermittent failure to delete files which has -- just been exec'ed by a sub-process (Win32 only.) finallyRemove :: FilePath -> IO a -> IO a finallyRemove fp act = bracket_ (return fp) (const $ noisyRemove fp) act where noisyRemove fpath = catch (removeFile fpath) (\ e -> hPutStrLn stderr ("Failed to remove file " ++ fpath ++ "; error= " ++ show e)) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs -------------------------------------+------------------------------------- Reporter: gintas | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build | Version: 7.8.3 System | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: Windows | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by gintas): * priority: normal => low -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs -------------------------------------+------------------------------------- Reporter: gintas | Owner: Type: bug | Status: new Priority: low | Milestone: Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * component: Build System => hsc2hs -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by Phyx-): * priority: low => normal * owner: => Phyx- * milestone: => 8.2.1 Comment: This is blocking reliable clean validates. Think I have a fix for it. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by bgamari): Phyx, did this ever get fixed? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Phyx-): I implemented the required changed in `process` but ran into some issues that I'm still working on. https://github.com/haskell/process/issues/77 I should have it done this week. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Phyx-): Pull request submitted to `Process`[1] Now to update hsc2hs. [1] https://github.com/haskell/process/pull/80 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Tamar Christina <tamar@…>): In [changeset:"a3704409acc3bd237d3e872f640686918fb51f5f/ghc" a3704409/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="a3704409acc3bd237d3e872f640686918fb51f5f" Fix various issues with testsuite code on Windows Summary: Previously we would make direct calls to `diff` using `os.system`. On Windows `os.system` is implemented using the standard idiom `CreateProcess .. WaitForSingleObject ..`. This again runs afoul with the `_exec` behaviour on Windows. So we ran into some trouble where sometimes `diff` would return before it's done. On tests which run multiple ways, such as `8086` what happens is that we think the diff is done and continue. The next way tries to set things up again by removing any previous directory. This would then fail with and error saying the directory can't be removed. Which is true, because the previous diff code/child is still running. We shouldn't make any external calls to anything using `os.system`. Instead just use `runCmd` which uses `timeout`. This also ensures that if we hit the cygwin bug where diff or any other utility hangs, we kill it and continue and not hang the entire test and leave hanging processes. Further more we also: Ignore error lines from `removeFile` from tools in the testsuite. This is a rather large hammer to work around the fact that `hsc2hs` often tries to remove it's own file too early. When this is patched the workaround can be removed. See Trac #9775 We mark `prog003` as skip. Since this test randomly fails and passes. For stability it's disabled but it is a genuine bug which we should find. It's something with interface files being overwritten. See Trac #11317 when `rmtree` hits a readonly file, the `onerror` handler is raised afterwards but not during the tree walk. It doesn't allow you to recover and continue as we thought. Instead you have to explicitly start again. This is why sometimes even though we call `cleanup` before `os.mkdirs`, it would sometimes fail with an error that the folder already exists. So we now do a second walk. A new verbosity level (4) will strip the silent flags from `MAKE` invocations so you can actually see what's going on. Test Plan: ./validate on build bots. Reviewers: bgamari, austin Reviewed By: bgamari Subscribers: mpickering, thomie, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D2894 GHC Trac Issues: #12661, #11317, #9775 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: upstream Priority: high | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * priority: normal => high * status: new => upstream Comment: This is waiting on a the `process` PR mentioned in comment:7. Bumping in priority since I would really like to have Windows finally stable. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:10> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: upstream Priority: high | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Phyx-): I currently have a new version of the pull request, just need to finish testing. I also committed a workaround for this in the testsuite. The error seems to not change the exit code as it seems to be mostly informational. Also the work seems to be done it's just cleaning up that fails. So I had the testsuite just strip this message out if it's found. The test runs shouldn't be reporting this anymore. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:11> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: upstream Priority: normal | Milestone: 8.2.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by Phyx-): * priority: high => normal Comment: The testsuite deals with this error internally now by removing it from the output. It is no longer a blocker. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:12> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: upstream Priority: normal | Milestone: 8.2.2 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * milestone: 8.2.1 => 8.2.2 Comment: Then perhaps we can just bump further work off to 8.2.2 at the earliest. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:13> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: Phyx- Type: bug | Status: upstream Priority: normal | Milestone: 8.4.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * milestone: 8.2.2 => 8.4.1 Comment: Bumping off to 8.4. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:14> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9775: "Failed to remove" errors during Windows build from hsc2hs ---------------------------------+---------------------------------------- Reporter: gintas | Owner: (none) Type: bug | Status: upstream Priority: normal | Milestone: 8.4.1 Component: hsc2hs | Version: 7.8.3 Resolution: | Keywords: Operating System: Windows | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by Phyx-): * owner: Phyx- => (none) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9775#comment:15> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC