[GHC] #9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.4 Component: Build System | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Moderate (less | Type of failure: than a day) | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- I discovered that if I compile with `ghc -c -osuf .something Myfile.hs` where `Myfile.hs` contains TH and thus has to dynamically link in, say, `Other.hs`, I get the error that {{{ Myfile.hs:1:1: cannot find normal object file 'Othe.dyn_o` while linking an interpreted expression }}} So `Other` was wrongly made into `Othe`, dropping the last character. If I don't pass `-osuf .something`, or have it not have a dot, everything's fine. The trouble is that `-osuf .something` worked fine in GHC <= 7.6. So I believe this is a regression, or at least a very bad error message. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: | than a day) None/Unknown | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * component: Build System => Driver * milestone: 7.8.4 => 7.10.1 Comment: Could you attach Myfile.hs and Other.hs? Thanks. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 7.12.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => infoneeded Comment: @nh2: could you please attach an example `Myfile.hs` and `Other.hs`? Thanks. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by nh2): * status: infoneeded => new Comment: Oh right, here it is: https://github.com/nh2/ghc-osuf-lost-character-regression -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: thomie Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: #5554 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * owner: => thomie * related: => #5554 Comment: I have a fix for this. Waiting on the outcome of https://github.com/haskell/filepath/issues/43 first. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: thomie Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | th/TH_spliceE5_prof Blocked By: | Blocking: Related Tickets: #5554 | Differential Rev(s): Phab:D1692 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch * testcase: => th/TH_spliceE5_prof * differential: => Phab:D1692 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: thomie Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Driver | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | th/TH_spliceE5_prof Blocked By: | Blocking: Related Tickets: #5554 | Differential Rev(s): Phab:D1692 Wiki Page: | -------------------------------------+------------------------------------- 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/9760#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9760: ghc -c 7.8 drops last char of file name if -osuf contains a dot -------------------------------------+------------------------------------- Reporter: nh2 | Owner: thomie Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Driver | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | th/TH_spliceE5_prof Blocked By: | Blocking: Related Tickets: #5554 | Differential Rev(s): Phab:D1692 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * resolution: => fixed Comment: The testcase from https://github.com/nh2/ghc-osuf-lost-character- regression now reports: {{{ Myfile.hs:5:5: fatal: cannot find object file ‘./Other.dyn_o’ while linking an interpreted expression make: *** [check] Error 1 }}} So I think this issue is fixed. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9760#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC