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

Specify C++17 standard on macOS #2520

Merged
merged 4 commits into from
Apr 5, 2020
Merged

Specify C++17 standard on macOS #2520

merged 4 commits into from
Apr 5, 2020

Conversation

saihv
Copy link
Contributor

@saihv saihv commented Apr 3, 2020

master fails to build on my machine (I'm on 10.15.4 with XCode 11.4) with complaints about std::filesystem, although Travis seems fine?

This PR contains the fix I had to use.

@saihv saihv changed the title Specify C++17 standard on OS X Specify C++17 standard on macOS Apr 3, 2020
@rajat2004
Copy link
Contributor

Travis uses macOS 10.13 and Xcode 9.4.1 by default. The versions can be changed using xcode_image - https://docs.travis-ci.com/user/reference/osx/

@rajat2004
Copy link
Contributor

Also, the OSX build is failing - https://travis-ci.org/github/microsoft/AirSim/jobs/670441638#L6866

ld: library not found for -lc++fs
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [output/bin/MavLinkTest] Error 1

As to why the build isn't showing up as failed, my thinking is the root build.sh exits on failure (set -e), but Travis only checks the return code of the last command being run, which would be the Unity build.
So the build.sh exits with code 1, Travis continues with the echo and Unity build, which is where things get confusing, there's no output after that, which might indicate some problem in the beginning of the script itself, since everything goes into the stderr rather than stdout and hence is captured in the file, but the word error: was not found, and so no output. But then why isn't exit 1 giving a return code of 1??
In the Unity build command, || is used to check the exit code of the command on the left side and running the right only if the left one exits with a non-zero code. I've tested this on my local system with some simple bash scripts, so am not sure why it's behaving in this way

One addition to make Travis exit if the root build.sh exits with failure is to add || travis_terminate 1 to it, so that it doesn't continue to the Unity build

@saihv
Copy link
Contributor Author

saihv commented Apr 3, 2020

Thanks! - I totally missed that. It definitely makes sense to differentiate between AirLib and Unity builds on Travis

@saihv
Copy link
Contributor Author

saihv commented Apr 4, 2020

@rajat2004
Copy link
Contributor

That's too bad, according to the Travis forums, 10.15 was supposed to come in December
In this case, then it should build locally on your system properly while failing to work on Travis
Should we keep the OSX build on Travis enabled then? Will need to update the docs to say it'll work on Catalina only

@saihv
Copy link
Contributor Author

saihv commented Apr 4, 2020

Yep, it does build locally on 10.15. Thanks for the doc update, will merge both soon, hoping the community can test more.

@saihv saihv merged commit 19ea831 into microsoft:master Apr 5, 2020
pjreed pushed a commit to swri-robotics/AirSim that referenced this pull request May 21, 2020
* Specify C++17 standard on OS X

* Upgrade macOS image in travis

* AppleClang -> Apple + Clang

* Stop travis pipeline if build.sh fails

Former-commit-id: ce2749c2a76098e4546598de098da1152b2d5ff8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants