ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
403 stars 40 forks source link

Failure to build 'master' on macosx 10.9 mavericks #942

Closed jonathn closed 8 years ago

jonathn commented 8 years ago

Trying to build from git source on macosx 10.9.5, I get the following error when I run 'make rescue':

[CC] rock/middle/TypeDecl
[CC] rock/middle/ClassDecl
[CC] rock/middle/Cast
[CC] rock/middle/FunctionCall
/Users/foo/OOC-ROCK/rock/source/rock/middle/TypeDecl.ooc:345:97: error: use of undeclared identifier 'INT_MIN'
    return rock_middle_TypeDecl__TypeDecl_getFunction_real(this, name, suffix, call, recursive, INT_MIN, NULL, finalScore);
                                                                                                ^
1 error generated.
/Users/foo/OOC-ROCK/rock/source/rock/middle/FunctionCall.ooc:554:68: error: use of undeclared identifier 'INT_MIN'
        if (res->fatal || (this->refScore < -1 && this->refScore > INT_MIN)) {
                                                                   ^
/Users/foo/OOC-ROCK/rock/source/rock/middle/FunctionCall.ooc:64:22: error: use of undeclared identifier 'INT_MIN'
    this->refScore = INT_MIN;
                     ^
2 errors generated.
[CC] rock/middle/FunctionDecl
C compiler failed on module rock/middle/TypeDecl from rock, bailing out

[FAIL]
make[2]: *** [self] Error 1
make[1]: *** [bootstrap] Error 2
make: *** [rescue] Error 2

I have XCode 6.2 installed which comes with the following gcc: $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix

I narrowed down the commit that introduced this error to this one: https://github.com/fasterthanlime/rock/commit/287ac783d080715f9336868974d77f1acbbca708

fasterthanlime commented 8 years ago

@davidhesselbom @zhaihj hey look guys, that's why INT_MIN was a literal.. cf. #926

fasterthanlime commented 8 years ago

I suppose a good fix would be to include limits.h but only on OSX

davidhesselbom commented 8 years ago

:-(

horasal commented 8 years ago

I didn't even think about OSX :(

davidhesselbom commented 8 years ago

For some reason (4K screenshots and evident OSX compatibility concerns in the SDK, probably) I thought that's what Amos was using anyway. If that's not the case, it might be worth looking into letting Travis run tests for OSX (see http://docs.travis-ci.com/user/osx-ci-environment/), so this type of thing doesn't happen again.

fasterthanlime commented 8 years ago

@davidhesselbom I am using OSX, I just didn't try running the changes on it, they seemed pretty simple.

That said, I agree, having an OSX travis setup would be nice. Beware though, OSX support is notably unstable on Travis (builds randomly failing)

alexnask commented 8 years ago

Someone with a mac please test adding version(osx) { include limits } (probably version(apple), I'm not sure what the case is for ios) and open a pull request please.

fasterthanlime commented 8 years ago

@shamanas accidentally push-requested instead but it seems to work as well! ;)