Re: [GHC] #5554: Strange interaction between "-osuf", profiling and TemplateHaskell
#5554: Strange interaction between "-osuf", profiling and TemplateHaskell -------------------------------------+--------------------------------- Reporter: iustin | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.4.1 Component: Template Haskell | Version: 7.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: -------------------------------------+--------------------------------- Comment (by Thomas Miedema <thomasmiedema@…>): In [changeset:"48db13d279d592ed3044cbaf3513854bcb0d3dce/ghc" 48db13d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="48db13d279d592ed3044cbaf3513854bcb0d3dce" Don't drop last char of file if -osuf contains dot Given: * `file = "foo.a.b"` * `osuf = ".a.b"` -- Note the initial dot. * `new_osuf = "c"` Before (bad, the last character of the filename is dropped): `dropTail (length osuf + 1) file <.> new_osuf == "fo.c"` After (good): `stripExtension osuf file <.> new_osuf` == "foo.c" This regression was introduced in commit c489af73 (#5554). That commit fixed a similar but different bug, and care has been taken to not reintroduce it (using the the newly introduced `System.Filepath.stripExtension`). Given: * `file = "foo.a.b"` * `osuf = "a.b"` * `new_osuf = "c"` Before c489af73 (bad, the full suffix should get replaced): `replaceExtension file new_osuf == "foo.a.c"` After c489af73 (good): `dropTail (length osuf + 1) file <.> new_osuf == "foo.c"` After this commit (still good): `stripExtension osuf file <.> new_osuf == "foo.c"` Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1692 GHC Trac Issues: #9760 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/5554#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC