crystal-lang / crystal_lib

Automatic binding generator for native libraries in Crystal
138 stars 30 forks source link

default_target-related compilation issue with Crystal 0.28 #58

Closed olbat closed 5 years ago

olbat commented 5 years ago

The lib does not compile anymore with Crystal 0.28 (more details, see https://github.com/olbat/libgen/issues/33):

...

in lib/crystal_lib/src/clang.cr:1: while requiring "./clang/*"

require "./clang/*"
^

in lib/crystal_lib/src/clang/index.cr:2: while requiring "compiler/crystal/config"

require "compiler/crystal/config"
^

in /usr/lib/crystal/compiler/crystal/config.cr:37: undefined constant Crystal::Codegen::Target

    @@default_target : Crystal::Codegen::Target?

The issue seems to be present with every LLVM versions and platforms I've tested (see https://travis-ci.org/olbat/libgen/builds/523117414) [the macOS builds did not fail because they were still using Crystal 0.27].

I suspect https://github.com/crystal-lang/crystal/pull/7282 to be related to this issue, I'm still trying to find out how.

RX14 commented 5 years ago

It's just a require order issue.

bcardiff commented 5 years ago

FYI I run crystal spec on this repo when doing the test-ecosystem in Linux and OSX platform and I notice no issues so far.

olbat commented 5 years ago

Oh right, sorry for the false alert @bcardiff 😳

I think you're right @RX14 :)

Still, I'm not sure how to fix this... I tried to add an import to compiler/crystal/** a few days ago but it did not work. If you have an idea about how to fix this, can you comment on https://github.com/olbat/libgen/issues/33? Thanks a lot!

However, since the bug is not _crystallib related so I'm closing the issue.