alevy / postgresql-orm

An Haskell ORM (Object Relational Mapping) and migrations DSL for PostgreSQL.
http://simple.cx
GNU General Public License v3.0
78 stars 12 forks source link

ORM.Model fails to compile on OSX (ghc-clang-wrapper present) #5

Closed ret closed 10 years ago

ret commented 10 years ago

Hi Amit, looking for help with this OSX specific issue below. Works like a charm on Ubuntu, but bombs with a parse error on OSX. I've got the ghc-clang-wrapper in place (otherwise there's no way to get this far in the first place ;-)). Does this ring any bell?

Thanks, Reto

... [ 9 of 15] Compiling Database.PostgreSQL.ORM.Model ( Database/PostgreSQL/ORM/Model.hs, dist/dist-sandbox-8249a8e5/build/Database/PostgreSQL/ORM/Model.o )

Database/PostgreSQL/ORM/Model.hs:820:17: parse error on input `where'

mercury:mappend reto$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.6.3

mercury:mappend reto$ cabal --version cabal-install version 1.20.0.2 using version 1.20.0.0 of the Cabal library

mercury:mappend reto$ uname -a Darwin mercury.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64

mercury:mappend reto$ ls -al /usr/bin/ghc-clang-wrapper -rwxr-xr-x 1 root wheel 3254 May 27 22:17 /usr/bin/ghc-clang-wrapper

alevy commented 10 years ago

@ret this was a known bug. Are you compiling v0.3.0 from hackage or git tip? Should be fixed in both. Could you try compiling from git tip if you haven't?

ret commented 10 years ago

I just tried from the git tip and used the naive commands below (ghc is 7.6.3, cabal is 1.20.0.0). Still hitting the same 'where' clause error. How can I help debug this further (feeling bad imposing on your time for something this basic)?

$ git clone https://github.com/alevy/postgresql-orm.git $ cd postgresql-orm/ $ cabal sandbox init $ cabal install -j

Configuring postgresql-orm-0.3.0... Building postgresql-orm-0.3.0... Preprocessing library postgresql-orm-0.3.0... [ 1 of 15] Compiling Database.PostgreSQL.ORM.Validations ( Database/PostgreSQL/ORM/Validations.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/ORM/Validations.o ) [ 2 of 15] Compiling Paths_postgresql_orm ( dist/dist-sandbox-12c949fe/build/autogen/Paths_postgresql_orm.hs, dist/dist-sandbox-12c949fe/build/Paths_postgresql_orm.o ) [ 3 of 15] Compiling Database.PostgreSQL.Escape ( Database/PostgreSQL/Escape.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/Escape.o )

Database/PostgreSQL/Escape.hs:31:1: Warning: The import of Int#' from moduleGHC.Prim' is redundant

Database/PostgreSQL/Escape.hs:50:1: Warning: Defined but not used: `cmpres' [ 4 of 15] Compiling Database.PostgreSQL.Migrations ( Database/PostgreSQL/Migrations.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/Migrations.o ) [ 5 of 15] Compiling Database.PostgreSQL.Migrate ( Database/PostgreSQL/Migrate.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/Migrate.o ) [ 6 of 15] Compiling Database.PostgreSQL.Describe ( Database/PostgreSQL/Describe.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/Describe.o ) [ 7 of 15] Compiling Database.PostgreSQL.Devel ( Database/PostgreSQL/Devel.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/Devel.o ) [ 8 of 15] Compiling Data.RequireSelector ( Data/RequireSelector.hs, dist/dist-sandbox-12c949fe/build/Data/RequireSelector.o ) [ 9 of 15] Compiling Database.PostgreSQL.ORM.Model ( Database/PostgreSQL/ORM/Model.hs, dist/dist-sandbox-12c949fe/build/Database/PostgreSQL/ORM/Model.o )

Database/PostgreSQL/ORM/Model.hs:820:17: parse error on input `where'

alevy commented 10 years ago

:) Please don't be sorry. It's a bug in the code and we need to fix it, so appreciate the feedback. It's almost certainly a CPP bug (there is apparently some discrepancy between GCC's preprocessor and LLVM's clone, and it looks like GCC accepts slightly buggy CPP). I don't have access to an OS X machine just now, but will fix this when I do again tonight.

dterei commented 10 years ago

OK this is fixed.

dterei commented 10 years ago

@ret please try again and reopen if any issues but I confirmed the bug and then the fix on my machine.

ret commented 10 years ago

Thanks guys! Works like a charm now.