Coder Social home page Coder Social logo

Comments (11)

rbsheth avatar rbsheth commented on August 27, 2024

Hmm, I've also been building CURL on macOS 10.15 successfully. I'll try reproducing this when I update my Mac.

from hunter.

jothepro avatar jothepro commented on August 27, 2024

Update: I tried to build CURL from submodule to investigate the issue:

hunter_config(CURL GIT_SUBMODULE "thirdparty/curl")

In the given folder I cloned the hunterized curl repository, which should be exactly the same code that is checked out by hunter.
This now builds successfully. The CURL version is the same (7.60.0-DEV)

As I remove the reference to the submodule and let hunter pull the sources, the build fails again.
Maybe this is some kind of a weird caching issue? I deleted .hunter in the user-dir multiple times, doesn't help. Am I missing some cache that might be screwed up?

from hunter.

rbsheth avatar rbsheth commented on August 27, 2024

Interesting. Do you have remote cache download enabled? If so, try disabling that.

from hunter.

jothepro avatar jothepro commented on August 27, 2024

Actually I'm not sure. I think it is not enabled by default, is it?
Right now I have a strong feeling that something else is fundamentally wrong with my project setup. Even with the described workaround I need to configure curl in the project that I posted for reproduction, because it still fails to build in my original project. Once a successful build is in the local cache, I can use it from my original project. Im confused and will definitely have to dig deeper into the issues linked in here once I find time for that.

from hunter.

Bjoe avatar Bjoe commented on August 27, 2024

@jothepro I'm not 100% sure but I think you run in the same issue like #147

I saw that you are using
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang as compiler. Try to use /usr/bin/clang as compiler.
There are the "same" compiler and they are using the same toolchain path ... see my output:

iMac:~ joergboehme$ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
iMac:~ joergboehme$ /usr/bin/clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

but there is "something" different!

I absolutely don't know what are different but I tried with other "opensource" projects and it works with /usr/bin/clang and not with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ....
Maybe somebody can tell me what are the different between /usr/bin/clang and /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ... would be nice to know :-)

from hunter.

Bjoe avatar Bjoe commented on August 27, 2024

@jothepro I found your problem ....

As workaround:
Remove in your CMakeList.txt line11 LANGUAGES CXX and remove your hunter build id (.hunter/_Base/<Hunter-ID>/), then it works ....

Why?
Here in detail:

If you set in project cmake command the LANGUAGES then only the specified language compiler is verified via cmake. In your example it was only the C++ compiler.
At the end, hunter is verified if the ABI was correct detected via cmake. CMAKE_CXX_ABI_COMPILED is an undocumented property from cmake and is set when you get following output:

...
-- Detecting CXX compiler ABI info - done
...

This means, in your example, the C compiler is not verified and CMAKE_C_ABI_COMPILED is set as empty value.

To build third-party libs in hunter faster, hunter is save this result in the "cache" file (see in your .hunter/_Base/<Hunter-ID>/<Toolchain-ID>/<Config-id>/cache.cmake).
This means in the curl project, where the C compiler is enabled and CMAKE_C_ABI_COMPILED is set via the cache file and cmake is not execute the ABI detection then in hunter the verification is failing

In my opinion, we should not save any "cmake environment" when it is not successful!
My idea is to add an if statement in hunter_create_cache_file line 110 like:

if(CMAKE_${lang}_ABI_COMPILED)
  hunter_status_debug("ABI forwarding: CMAKE_${lang}_ABI_COMPILED = ${CMAKE_${lang}_ABI_COMPILED}")
    file(
        APPEND
        "${temp_path}"
        "set(CMAKE_${lang}_ABI_COMPILED \"${CMAKE_${lang}_ABI_COMPILED}\" CACHE INTERNAL \"\")\n"
    )
endif()

@rbsheth and @bkotzz what do you think ?

from hunter.

Bjoe avatar Bjoe commented on August 27, 2024

or maybe we remove this DEFINED from hunter_create_cache_file line 70

from hunter.

jothepro avatar jothepro commented on August 27, 2024

@Bjoe wow thanks for your in-depth explanations! I also figured out after a while that my LANGUAGES definition was the real problem. Not caching the "corrupted" state would have helped me to find the real issue faster I think, so I'd appreciate these changes. ☺️

from hunter.

jothepro avatar jothepro commented on August 27, 2024

@rbsheth @bkotzz What do you think of the changes that @Bjoe proposes? Otherwise I guess I will close this issue, the original problem is solved for me.

from hunter.

rbsheth avatar rbsheth commented on August 27, 2024

I'd be okay with @Bjoe's suggestion provided that it doesn't slow down builds considerably.

from hunter.

Bjoe avatar Bjoe commented on August 27, 2024

Ok let me do this... hopefully I will find a "time slot" ....

from hunter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.