merger of MacOS fixes - #147
Merged
Merged
Conversation
This test is undefined behaviour, and not only on macOS.
`std::tm t;` is uninitialised, and "2018-February-22 15:24:00" is parsed with
to_time_t's default format "%Y-%m-%d %H:%M:%S". `%m` expects a number and cannot
read "February", so get_time sets failbit and leaves the struct as whatever was
on the stack. mktime is then called on that garbage:
parse failed? YES
tm_year=118 tm_mon=0 tm_mday=1 tm_hour=-117784575
mktime = -1
The sun's position is computed for time_t -1 -- 1969 -- so the altitude assert
fails, and the whole suite aborts before SettingsTest and SimpleFlightTest run.
Whether it passes is a property of the stack, not of the code, which is why it
survives on some toolchains and aborts on others. Passing "%Y-%B-%d %H:%M:%S"
parses correctly (mktime = 1519341840) and the test passes.
Not a macOS fix: it is a real bug everywhere that merely happens to be latent.
`brew install llvm@8` fails on any current Homebrew -- the oldest formula available is llvm@14, so setup.sh cannot complete on macOS at all. The line's own comment already says "Update below line for newer versions", and build.sh does not want a pinned version either: its macOS branch resolves the compiler as $(brew --prefix)/opt/llvm/bin/clang with the comment "now pick up whatever setup.sh installs", having commented out the old llvm@8 path years ago. Plain `llvm` is what the rest of the build already expects. Verified on macOS 15.7.7 / Apple M1 Pro: setup.sh completes, and build.sh then produces native arm64 libAirLib.a, librpc.a and libMavLinkCom.a in 1m43s.
CelestialTests: parse the month name the test itself passes (uninitialised std::tm)
setup.sh: install llvm, not the llvm@8 Homebrew removed
…fixes the macOS plugin build) manually done #145 by v3g42
Documented multiple build fixes for MacOS in the changelog.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed multiple build issues for MacOS. #143, #144, and #145 by v3g42.