[GHC] #9056: --make paths are not deduplicated

#9056: --make paths are not deduplicated -------------------------+------------------------------------------------- Reporter: | Owner: evincarofautumn | Status: new Type: bug | Milestone: Priority: | Version: 7.8.2 normal | Operating System: Unknown/Multiple Component: | Type of failure: Incorrect warning at Compiler | compile-time Keywords: | Test Case: Architecture: | Blocking: Unknown/Multiple | Difficulty: | Unknown | Blocked By: | Related Tickets: | -------------------------+------------------------------------------------- I had a build script with an accidental duplicate dependency, which caused GHC to be run like so: {{{ ghc --make Main.hs Main.hs }}} This results in a spurious error from `GhcMake.checkDuplicates`: {{{ <no location info>: module ‘main:Main’ is defined in multiple files: Main.hs Main.hs }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9056 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9056: --make paths are not deduplicated -------------------------------------+------------------------------------- Reporter: | Owner: evincarofautumn | Status: new Type: bug | Milestone: Priority: normal | Version: 7.8.2 Component: Driver | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 Unknown/Multiple | hour) Type of failure: Incorrect | Blocked By: warning at compile-time | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * difficulty: Unknown => Easy (less than 1 hour) * component: Compiler => Driver -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9056#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9056: --make paths are not deduplicated -------------------------------------+------------------------------------- Reporter: evincarofautumn | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): I was working on a patch for this (attached, unfinished), but now don't think there's actually a bug here. I find the current error message quite clear, and think that it can be expected from a build system or the user not to supply the same filename twice. Please do reopen if you disagree, perhaps as a feature request. Fwiw: gcc doesn't seem to deduplicate input filenames either, giving a similar error message. {{{ $ cat test.c int main(void) { return 0; } $ gcc test.c test.c /tmp/ccL0QwIZ.o: In function `main': test.c:(.text+0x0): multiple definition of `main' /tmp/ccxMTZBK.o:test.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status }}} If we do want this: It is not as simple as just deduplicating filenames. For starters, comparing paths with (==) returns False for `./foo` and `foo`, so `System.FilePath.equalFilePaths` should be used. But what about relative vs absolute paths? What about `Main` and `Main.hs`, are they the same? What about `Main.lhs` and `Main.hs`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9056#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9056: --make paths are not deduplicated -------------------------------------+------------------------------------- Reporter: evincarofautumn | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Driver | Version: 7.8.2 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => closed * type: bug => feature request * resolution: => wontfix -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9056#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9056: --make paths are not deduplicated -------------------------------------+------------------------------------- Reporter: evincarofautumn | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Driver | Version: 7.8.2 Resolution: wontfix | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): I generally agree with thomie here, but I think there is some room for interpretation since ghc's make mode already is a bit "do what I mean". For example, if module A imports module B, then `ghc A.hs B.hs` does the same as `ghc A.hs`, so there seems to be some kind of deduplication happening already. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9056#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC