[Hackage] #188: file extensions

#188: file extensions --------------------------+------------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.1 Platform: Linux | --------------------------+------------------------------------------------- GHC ignores Objective C sources unless -x c is passed to it on the command line before the source files. As far as I could tell there is no way to pass that option to GHC through Cabal so no .m files ever get built (well.. not completely true - setting ghc-options works but that breaks compilation of Haskell code). One way to get this to work would be to just add some extra code in Cabal to automatically pass -x c for .m files. This is probably a bad idea as someone might want or need to compile files using some other extension at some point. Another option is add some way of specifying compile options on a per-file (or group of files) basis: setting ghc-options to -x c just for one set of files. Still very limited but it's an improvement over the first option. Third option I can think of is to add a way of specifying compiler/extension pairs in Cabal so given compilers are automatically used to compile files with corresponding extensions. Depending on how much time I have I might look into adding this functionality myself but would like some feedback on which approach to take. Otherwise I might have to stick with autotools and ignore Cabal until it gets a bit more mature and flexible. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: file extensions --------------------------+------------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.1 | Platform: Linux --------------------------+------------------------------------------------- Comment (by duncan): Cabal currently does not have a well abstracted way of supporting different kinds of files that can be compiled to .o files. .c .m .c++ files are all different language files that can be compiled to .o files with their respective compilers. I don't think we should be trying to hack it by just pretending they're all .c files and passing different flags to ghc. They should use their own compiler directly and Cabal should be extended to cope with this more easily. This would be much easier in a rule based, make style system. That work is at the pre-prototype stage at the moment (see #15). That should make it a lot easier to give a rule for building files with given extensions. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: Support building Objective-C modules --------------------------+------------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.1 | Platform: Linux --------------------------+------------------------------------------------- Changes (by duncan): * summary: file extensions => Support building Objective-C modules -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: Support building Objective-C modules ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.1 | Platform: Linux ----------------------------+----------------------------------------------- Changes (by kazuya): * cc: kazuya@gmail.com (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: Support building Objective-C modules ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.1 | Platform: Linux ----------------------------+----------------------------------------------- Comment (by kazuya): This is the obstacle to use GHC 6.10 with [HOC] (Haskell to Objective-C binding), as mentioned [http://code.google.com/p/hoc/issues/detail?id=12 here]. And the developer is yet to find a reasonable solution: http://code.google.com/p/hoc/source/detail?r=379 As solving this by full fledge ''make'' style system seems long shot, general FFI users as well as HOC users would be happier if this issue is somehow worked around by viz. specifying a special, ad-hoc rule. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: Support building Objective-C modules ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: unknown Ghcversion: 6.8.1 | Platform: Linux ----------------------------+----------------------------------------------- Changes (by duncan): * difficulty: normal => unknown Comment: If we want to support this in Cabal then we need to know how to build objective C modules. Personally I have no idea, I've never used objective C. So supposing you listed the source objective C modules, what would Cabal need to do to build them? Is it any different from building C code? For reference, see `constructCcCmdLine` in `Distribution/Simple/GHC.hs`. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#188: Support building Objective-C modules ----------------------------+----------------------------------------------- Reporter: guest | Owner: Type: enhancement | Status: new Priority: normal | Milestone: Component: Cabal library | Version: 1.2.2.0 Severity: normal | Resolution: Keywords: | Difficulty: unknown Ghcversion: 6.8.1 | Platform: Linux ----------------------------+----------------------------------------------- Comment (by mokus): A more sophisticated system would probably be a good long-term solution to this type of situation, but in the interim I think a nice neat solution is to provide a means of telling Cabal "look, I made this .o! Put it in, coach!" For GHC <6.10, this is already what HOC does, in a very kludgy way. It compiles the Objective C sources, then tells cabal that the resulting object file is a "c-source". That dirty little trick relies on GHC just ignoring the .o file when told to compile it as a C source. If we could say something like "intermediate-objects: HOC_cbits.o"in the cabal file it would take a little bit of the kludge out of it, and more importantly (to HOC users at least) it would allow HOC to build. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/188#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage