Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix builds for 0.7.0 #54

Open
kalinon opened this issue May 27, 2020 · 6 comments
Open

Fix builds for 0.7.0 #54

kalinon opened this issue May 27, 2020 · 6 comments
Labels

Comments

@kalinon
Copy link
Contributor

kalinon commented May 27, 2020

Currently the builds are broken: https://travis-ci.org/github/Papierkorb/bindgen

@docelic docelic added the bug label May 27, 2020
@ZaWertun
Copy link
Contributor

"LLVM_VER" "GREATER_EQUAL" "10"
  Unknown arguments specified

I think it caused by old CMake.

@kalinon
Copy link
Contributor Author

kalinon commented May 27, 2020

ah. yeah i ran into this somewhere else. may need to compile it

@docelic
Copy link
Collaborator

docelic commented May 27, 2020

Given that @ZaWertun added the GenericVersion class which has since been used in a couple more places in bindgen/qt5, how about we simply don't make this check in cmake, but elsewhere?

One option would be to simply extend find_clang.cr so that it accepts two versions from command line and returns the result of comparison (done via GenericVersion) through its exit status.

Or another alternative could be that we ourselves detect and set the c++ standard as part of find_clang rather than expecting cmake to detect and pass it.

@docelic
Copy link
Collaborator

docelic commented Jun 17, 2020

GREATER_EQUAL 10 was just fixed by using GREATER 9.

The issue that pops up now is:

In src/bindgen/library.cr:5:1
 5 | require "json_mapping"
     ^
Error: can't find file 'json_mapping'

Is it possible that shards is not being run in these builds?

@kalinon
Copy link
Contributor Author

kalinon commented Jun 17, 2020

probably not. i probably just introduced that build bug.

kalinon added a commit to kalinon/bindgen that referenced this issue Jun 17, 2020
@HertzDevil
Copy link
Contributor

Looks like builds now fail with

clang: error: -Wl,-fuse-ld=gold: 'linker' input unused [-Werror,-Wunused-command-line-argument]

The culprit may be

OPTIONS[:llvm_cxx_flags] = output_of(OPTIONS[:llvm_config], "--cxxflags")
.gsub(/-fno-exceptions/, "")
.gsub(/-W[^alp].+\s/, "")
.gsub(/\s+/, " ")

It should be okay to drop linker flags here (-Wl,*) as the generated command line is compile-only (-c):

bindgen/clang/find_clang.cr

Lines 145 to 147 in 3f02883

build: "#{clang} #{llvm_cxx_flags} #{system_include_dirs.map{ |x| "-I#{File.expand_path(x)}" }.join(' ')}" \
" -c -o {SPEC_NAME}.o {SPEC_NAME}.cpp -I.. -Wall -Werror -Wno-unused-function" \
"#{dynamic ? "" : " -fPIC" }",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants