Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Actions] Adding a MacOS build workflow, fixing several MacOS specifi…
…c compilation errors and warnings (#1788) * Create MacOS build template * Add a condition to trigger this workflow on pushes to the development branch * Removing the gcc multilib and building 32 bits in macOS for now * Replacing the Linux package instalation steps with its equivalents for MacOS * Updating the commands with pipx instead of pip3 * No need to install pipx as it is already present * Simplify the packages instalation * Install jsonref within a virtual environment instead * Making sure to activate the python virtual environemtn before building * Make sure #pragma clang system_header will be used in portability for apple builds * See if ignoring -Wgnu-zero-variadic-macro-arguments works * Looks like for AppleClang the system header doesn't suppress warnings like in regular clang or gcc * Adding VARIABLE_IS_NOT_USED macro for length in MACAddress * Commenting some more unused params * Make sure the condition order is correct * No need to redefine __APPLE_USE_RFC_3542 macro as it is already defined in the cmake And having it redefined here caused warnings treated as errors: /Users/runner/work/Thunder/Thunder/Thunder/Source/core/Portability.h:440:9: error: '__APPLE_USE_RFC_3542' macro redefined [-Werror,-Wmacro-redefined] #define __APPLE_USE_RFC_3542 ^ <command line>:7:9: note: previous definition is here #define __APPLE_USE_RFC_3542 1 ^ * Removing unnecessary extern keyword on methods which already have extern "C" * Commenting some unused parameters We could also use the macro, but since we are not even using these params in Debug, this seems a bit cleaner * Adding a VARIABLE_IS_NOT_USED macro to the AdapterObserver private member * Commenting some more unused params in Protability.cpp * Add VARIABLE_IS_NOT_USED macro to the Iterator in ProcessInfo Here we are using the macro as these params are in fact used on Linux * Some more unused params in ProcessInfo.cpp * Adding VARIABLE_IS_NOT_USED macro to SystemInfo SetTime method * m_lastUpdateCpuStats is not used on MacOS * Params of Thread::GetCallstack() can also be unused * Variable used only in an ASSERT in StreamText * Marking Id() method from IPCChannelType as an override as it is indeed an override of method from IPCChannel * Index in CreateFactory is only used in an ASSERT * Mark Deinitialize in RunCContainerAdministrator as an override * whole-archive flags are specific to GNU, changing to force_load for Apple instead * Linking Messaging for ProcessContainers for Apple * We need to link Messaging for Linux as well This was not causing any errors in Actions probably as we are also building warning reporting, which publicly links core and messaging * Removing the unnecessary local fillCount variable which is not used * Bringing base class's overloaded methods into the derived class In file included from /Users/runner/work/Thunder/Thunder/Thunder/Source/websocket/WebSerializer.cpp:20: /Users/runner/work/Thunder/Thunder/Thunder/Source/websocket/WebSerializer.h:336:18: error: 'Thunder::Web::JSONBodyType<Thunder::Core::JSONRPC::Message>::Serialize' hides overloaded virtual functions [-Werror,-Woverloaded-virtual] uint32_t Serialize() const override ^ /Users/runner/work/Thunder/Thunder/Thunder/Source/websocket/WebSerializer.h:436:29: note: in instantiation of template class 'Thunder::Web::JSONBodyType<Thunder::Core::JSONRPC::Message>' requested here class Body : public JSONBodyType<Core::JSONRPC::Message> { ^ /Users/runner/work/Thunder/Thunder/Thunder/Source/websocket/../core/JSON.h:3740:22: note: hidden overloaded virtual function 'Thunder::Core::JSON::Container::Serialize' declared here: different number of parameters (3 vs 0) uint16_t Serialize(char stream[], const uint16_t maxLength, uint32_t& offset) const override ^ /Users/runner/work/Thunder/Thunder/Thunder/Source/websocket/../core/JSON.h:3951:22: note: hidden overloaded virtual function 'Thunder::Core::JSON::Container::Serialize' declared here: different number of parameters (3 vs 0) uint16_t Serialize(uint8_t stream[], const uint16_t maxLength, uint32_t& offset) const override ^ And the same goes for Deserialize() * Commenting some unused params * Commenting some unused params * Removing the unused param fillCount * version variable is not used in both Offer and Revoke methods * VARIABLE_IS_NOT_USED macro has to be used before the default value is assigned * Comment unused params in WebTransfer.h * Type param in Initialize from InputHandler is only used in an ASSERT on Windows and MacOS * Making sure the Invoke does not hide overloaded virtual function In file included from /Users/runner/work/Thunder/Thunder/Thunder/Source/plugins/../com/Communicator.h:30: /Users/runner/work/Thunder/Thunder/Thunder/Source/plugins/../com/IUnknown.h:491:18: error: 'Thunder::ProxyStub::UnknownProxyType<Thunder::PluginHost::IDispatcher>::Invoke' hides overloaded virtual function [-Werror,-Woverloaded-virtual] uint32_t Invoke(Core::ProxyType<RPC::InvokeMessage>& message, const uint32_t waitTime = RPC::CommunicationTimeOut) const ^ /Users/runner/work/Thunder/Thunder/Debug/build/Thunder/Source/plugins/generated/ProxyStubs_Dispatcher.cpp:235:42: note: in instantiation of template class 'Thunder::ProxyStub::UnknownProxyType<Thunder::PluginHost::IDispatcher>' requested here class DispatcherProxy final : public ProxyStub::UnknownProxyType<IDispatcher> { ^ /Users/runner/work/Thunder/Thunder/Thunder/Source/plugins/IDispatcher.h:44:30: note: hidden overloaded virtual function 'Thunder::PluginHost::IDispatcher::Invoke' declared here: different number of parameters (6 vs 2) virtual uint32_t Invoke(const uint32_t channelid, const uint32_t id, const string& token, const string& method, const string& parameters, string& response /* @out */) = 0; ^ 1 error generated. * Try the enable_if with is_member_function_pointer to solve the Invoke warning * Removing the unnecessary using Invoke from earlier * Try a different approach with SFINEA * Use a template param when calling the TryBringInvoke method * Try one last change to handle Invoke situation * One more idea to try.. * inotify header cannot be used on MacOS * features.h is also not available on MacOS * features.h was included in one more space * Add different includes for Apple * No reason for these includes, remove them * Add a -pthread flag * Add #include <semaphore.h> for MacOS * Remove the TryBringInvoke method as it is no longer needed * Remove the pthread flag for now * Change reinterpret cast to static cast uintptr_t is usually defined as unsigned long on macOS (64 bits). Core::instance_id is defined as unsigned long long, which is also 64 bits but technically a different type. so we have to use static_cast for it to work * Try reinterpret cast instead of static * Disable a warning about overloaded virtuals * Disable the warning of overloaded virtuals on a different method * Invoke from IUnknown hides Invoke from IDispatcher But there is nothing wrong with that and we can safely ignore it * Taking care of some unused params * One more unsed param to comment * Removing unncessary std::move on a temp object In file included from /Users/runner/work/Thunder/Thunder/Thunder/Source/Thunder/PluginServer.h:24: /Users/runner/work/Thunder/Thunder/Thunder/Source/Thunder/SystemInfo.h:496:116: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] _provisioning = Core::ServiceType<Provisioning>::Create<PluginHost::ISubSystem::IProvisioning>(std::move(std::list<std::string>()), ""); ^ /Users/runner/work/Thunder/Thunder/Thunder/Source/Thunder/SystemInfo.h:496:116: note: remove std::move call here _provisioning = Core::ServiceType<Provisioning>::Create<PluginHost::ISubSystem::IProvisioning>(std::move(std::list<std::string>()), ""); * Adding VARIABLE_IS_NOT_USED macro to _state Seems state is not used on MacOS * Changing static to reinterpret cast to allow casting to a point /Users/runner/work/Thunder/Thunder/Thunder/Source/plugins/Metadata.h:281:20: error: cannot cast from type 'Core::instance_id' (aka 'unsigned long long') to pointer type '_opaque_pthread_t *' return static_cast<TYPE>(id); ^~~~~~~~~~~~~~~~~~~~~ * Take care of two unused variable on MacOS * Update the logic of __SIZEOF_POINTER__ is not defined * Add errors for debugging * More debugging * Remove the diagnostic errors * Cannot use reinterpret from uint to another uint * Change is_same to is_convertiable to work with other pointers than void* * Use is_pointer instead of is_convertible for even greater portability * More debugging * Formatting changes * Remove debugging code * Removing some unnecessary changes * Bringing back endif removed by accident * Make the template callable * Make sure to build with this branch in other repos on calls * Add a build workflow * Correct an else instead of an elif * Add debugging * Formatting changes, removing the debugging code * Change the runner version to be static * Prep for merging to master * No need for iterator local variable as it is only used in an assert * Change the venv path to match the Linux templates
- Loading branch information