[GHC] #8886: sync-all: END actions result in confusing error message

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Building GHC Difficulty: Easy (less than 1 | failed hour) | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- The instructions at [wiki:Newcomers] were slightly outdated, and result in a rather confusing error message: {{{ $ ./sync-all --testsuite get Unrecognised flag: --testsuite at ./sync-all line 872. == Checking for old haddock repo == Checking for old binary repo == Checking for old mtl repo == Checking for old Cabal repo == Checking for old time from tarball ============================ ATTENTION! You have an old time package in your GHC tree! Please remove it (e.g. "rm -r libraries/time"), and then run "./sync-all get" to get the new repository. ============================ == Checking for obsolete Git repo URL $ }}} The patch suppresses the misleading error message. I've already removed the `--testsuite` flag from the wiki page. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Building GHC | Difficulty: Easy (less than 1 failed | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by fw): * version: 7.6.3 => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Build System | Version: Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Building GHC | Difficulty: Easy (less than 1 failed | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by fw): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Build System | Version: Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: Building GHC | Difficulty: Easy (less than 1 failed | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged, thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------+------------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: new Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by thomie): * status: closed => new * component: Build System => Trac & Git * owner: => hvr * failure: Building GHC failed => None/Unknown * keywords: => sync-all * resolution: fixed => Comment: This commit should be reverted IMHO. The idea of using the `END` block, if I understand correctly, is that it should run at the end, no matter what else happens. For example the change back to the `initial_working_directory` should not be skipped in case of errors. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------+------------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by thomie): * status: new => patch Comment: The false warning is also triggered when running a different `sync-all` command before the first succesful `sync-all get`, for example if one runs (for whatever reason): git clone git://github.com/ghc/ghc cd ghc ./sync-all -r http://git.haskell.org remote set-url origin The attached patch proposes a solution. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------+------------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by fw): Replying to [comment:4 thomie]:
The idea of using the `END` block, if I understand correctly, is that it should run at the end, no matter what else happens. For example the change back to the `initial_working_directory` should not be skipped in case of errors.
If the script dies with an error, the process is probably in a slightly broke state, and printing all those warnings only obscures the error. Changing the directory does not in itself have any effect because the process is about to terminate anyway, and its not the point of the `END` action. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------+------------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by thomie): Ok, you're right that changing the directory is not needed. But one thing I don't understand: why are those checks in the `END` block, if not for running even on an error. Wouldn't they be better placed straight in the main function then? Would make things simpler. I guess the author of those old repository checks in the `END` block thought about potential errors that could occur, and deemed it necessary to show those warnings. Yes it obscures the initial error, but maybe that error is caused by having an old repository in the first place. The bug that still stands is getting false warnings about old time library being present when running another command before `sync-all get`. My patch fixes that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------+------------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: patch Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by fw): Replying to [comment:7 thomie]:
Ok, you're right that changing the directory is not needed.
But one thing I don't understand: why are those checks in the `END` block, if not for running even on an error. Wouldn't they be better placed straight in the main function then?
Probably, I don't understand they way the script is written. I have seen some Perl in my day, and this usage of `BEGIN` (for argument parsing, of all) and `END` blocks seemed highly suspect to me. I didn't want to audit the code for any forms of non-local control flow, so I put in just the exception check as a minimal, less risky change. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message
-------------------------------+-------------------------------------------
Reporter: fw | Owner: hvr
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Trac & Git | Version:
Resolution: | Keywords: sync-all
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Easy (less than 1 hour)
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
-------------------------------+-------------------------------------------
Comment (by Austin Seipp

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: closed Priority: normal | Milestone: Component: Trac & Git | Version: Resolution: fixed | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Merged. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message -------------------------------------+------------------------------------- Reporter: fw | Owner: hvr Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Trac & Git | Version: Resolution: fixed | Keywords: sync-all Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 Type of failure: | hour) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * milestone: => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8886#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8886: sync-all: END actions result in confusing error message
-------------------------------------+-------------------------------------
Reporter: fw | Owner: hvr
Type: bug | Status: closed
Priority: normal | Milestone: 7.10.1
Component: Trac & Git | Version:
Resolution: fixed | Keywords: sync-all
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Easy (less than 1
Type of failure: | hour)
None/Unknown | Blocked By:
Test Case: | Related Tickets:
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp
participants (1)
-
GHC