TarCV / botc

Fork of Dusk's botc compiler *OPEN FOR ADOPTION*
Other
1 stars 0 forks source link

CI for Mac is broken #21

Open TarCV opened 4 years ago

TarCV commented 4 years ago

The current build script for Mac doesn't work in CI:

set -ex

#touch Brewfile
#echo 'brew "cmake"' >> Brewfile
#echo 'brew "llvm"' >> Brewfile
#brew bundle
brew install cmake || true
brew install llvm || true

export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
export LD_LIBRARY_PATH=$(brew --prefix llvm)/lib

cmake -DCMAKE_POLICY_DEFAULT_CMP0056=NEW -DCMAKE_CXX_FLAGS="-v -stdlib=libc++ -I$(brew --prefix llvm)/include -Wl,-rpath,$LD_LIBRARY_PATH -L$LD_LIBRARY_PATH" .
make

https://dev.azure.com/tarcv/botc/_build/results?buildId=81&view=logs&j=a4f1cc8a-0ccb-5e90-36f4-f06f41d0ce59&t=ca6b548a-c0fd-5f27-176c-c59ec27fafde

ghost commented 4 years ago

Apparently that -lc++fs flag I removed a few commits back fixes this issue, according to this question on Stack Overflow

TarCV commented 4 years ago

Mac OS is a weird platform in terms of building C/C++ programs. CLang/LLVM that comes with Mac OS/XCode is old, so I install a newer one with homebrew. Probably it's just CLang picking wrong standard library implementation or may be CLang package in homebrew is just old.

ghost commented 4 years ago

It uses version 9 (Ubuntu has version 10 and compiles normally), it just isn't shipped with the standard libraries apparently.

Edit: just compiled with clang 9 on Ubuntu. Mac OS' clang definitely doesn't come with the entire standards library.

TarCV commented 4 years ago

From https://formulae.brew.sh/formula/llvm it looks like LDFLAGS were changed. So may be updating them will fix CI, I'll try it later.

TarCV commented 4 years ago

That didn't help. And apparently XCode 11 is not enough too. https://dev.azure.com/tarcv/botc/_build/results?buildId=115&view=logs&j=a4f1cc8a-0ccb-5e90-36f4-f06f41d0ce59&t=ca6b548a-c0fd-5f27-176c-c59ec27fafde