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

Add macOS builds to CI #291

Open
esabol opened this issue Jul 27, 2020 · 9 comments
Open

Add macOS builds to CI #291

esabol opened this issue Jul 27, 2020 · 9 comments

Comments

@esabol
Copy link
Member

esabol commented Jul 27, 2020

We probably should be building gearmand on macOS in CI to ensure we don't break anything there.

@p-alik
Copy link
Collaborator

p-alik commented Aug 10, 2020

As mentioned here macOS build fails for variety of reasons yet.

@esabol
Copy link
Member Author

esabol commented Aug 11, 2020

I'm seeing this in my OS X High Sierra build (which compiled and tested OK, just a lot of warnings):

libgearman-server/connection.cc:722:29: warning: implicit conversion loses integer precision: 'long' to
      '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32]
        timeout_tv.tv_usec= (long)((milliseconds % 1000) * 1000);

At least some versions of macOS, Apple apparently used int instead of long for tv_usec in struct timeval. The solution is to use suseconds_t for the type instead. I think that works on Linux as well?

@p-alik
Copy link
Collaborator

p-alik commented Aug 11, 2020

It looks like #300 solves tv_usec issue. This MacOS CI build runs in the next one libtest/server_container.cc:52:61: error: 'ptr_fun<int, int>' is deprecated.

@esabol
Copy link
Member Author

esabol commented Aug 11, 2020

It looks like #300 solves tv_usec issue. This MacOS CI build runs in the next one libtest/server_container.cc:52:61: error: 'ptr_fun<int, int>' is deprecated.

I think we want to use the following instead:

    s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
        return !std::isspace(ch);
    }).base(), s.end());

What do you think?

References:
https://stackoverflow.com/questions/44973435/stdptr-fun-replacement-for-c17
https://stackoverflow.com/questions/40575929/how-to-replace-stdptr-fun-with-stdfunction-and-stdref
https://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring/216883

@esabol
Copy link
Member Author

esabol commented Aug 11, 2020

I think we need to keep both versions? Use #if __cplusplus > 201402L for C++17 or >= 201103L for C++11?

Reference:
https://stackoverflow.com/questions/38456127/what-is-the-value-of-cplusplus-for-c17

@p-alik
Copy link
Collaborator

p-alik commented Aug 12, 2020

    s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
        return !std::isspace(ch);
    }).base(), s.end());

What do you think?

Your proposal is fine for g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 and the style matches std::isspace reference implementation.

Unfortunately my presumption to solve BOOST_WORKAROUND is only partly true. This CI build hits the issue on other parts of code.

@esabol
Copy link
Member Author

esabol commented Aug 13, 2020

Unfortunately my presumption to solve BOOST_WORKAROUND is only partly true. This CI build hits the issue on other parts of code.

Did you add the following?

#ifndef __clang_major__
#define __clang_major___WORKAROUND_GUARD 1
#else
#define __clang_major___WORKAROUND_GUARD 0
#endif

If so, where did you add it? You probably need to add it to every file that exhibits this boost problem. Or some common header file included by it.

None of this happens if you boostrap on Linux and then compile it on macOS. I'm not clear why that is.

@p-alik
Copy link
Collaborator

p-alik commented Aug 13, 2020

If so, where did you add it?

see 4c03a24

At the end we've a succeeded build

@esabol
Copy link
Member Author

esabol commented Aug 13, 2020

At the end we've a succeeded build

Great!

p-alik added a commit to p-alik/gearmand that referenced this issue Sep 3, 2020
p-alik added a commit to p-alik/gearmand that referenced this issue Sep 3, 2020
p-alik added a commit to p-alik/gearmand that referenced this issue Sep 3, 2020
@esabol esabol added the testing label Aug 22, 2021
@esabol esabol changed the title Add macOS build(s) to Travis CI Add macOS build(s) to CI Jun 10, 2022
@esabol esabol changed the title Add macOS build(s) to CI Add macOS builds to CI Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants