-
Notifications
You must be signed in to change notification settings - Fork 444
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
Try to fix some issues with slowness in the MacOS build. #4280
Conversation
0410e07
to
e5ce2ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any obvious problems here, but since I have no experience with macOS and brew I don't think I should approve this (i.e. I don't know why brew link
is needed for boost).
Can we safely build on macOS 12, or can there still be users on 11? (I'm not sure how OS versions and updates work for macOS :-D).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting an error about std::binary_function
in json.h
. It seems this is now deprecated.
/Users/nate/shared/p4c/lib/ordered_map.h:51:32: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
class value_compare : std::binary_function<value_type, value_type, bool> {
~~~~~^~~~~~~~~~~~~~~
__binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
^
In file included from /Users/nate/shared/p4c/lib/json.cpp:17:
In file included from /Users/nate/shared/p4c/lib/json.h:31:
/Users/nate/shared/p4c/lib/ordered_map.h:65:26: error: no template named 'binary_function' in namespace 'std'; did you mean '__binary_function'?
struct mapcmp : std::binary_function<const K *, const K *, bool> {
~~~~~^~~~~~~~~~~~~~~
__binary_function
/Library/Developer/CommandLineTools/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here
using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;
^
2 errors generated.
I'm on an M1 Macbook running OS X 14 (Sonoma), with this C++ compiler.
The CXX compiler identification is AppleClang 15.0.0.15000040
This is apparently a deprecated function which has been removed in C++17. The common advice is to just remove it. A little strange that the other compilers do not complain. |
Could be libstdc++ ABI would break if they remove it, it is still widely used in the standard library itself (as of GCC 11). Apple might care a bit less about ABI then the open-source world. |
@fruffy I have never used the macOS build of any open source P4 dev tools before, despite using a Mac for personal use -- I've only ever compiled it in a Linux VM. |
Me neither, but Homebrew was warning about the usage of MacOS 11. considering it deprecated. Adding @rst0git because I believe he used the MacOS build in the past. |
e5ce2ae
to
db0fe21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I still can't build on my Mac. Seems likely there are a bunch of other For example: https://github.com/p4lang/p4c/blob/fruffy/macos_ci/lib/ordered_set.h#L56 |
Should have been more thorough... will try to fix this in this PR directly. |
Seems to be working now... will let you know when it completes. |
f8873bb
to
6acaba9
Compare
Worked for most backends. Graphs had this error:
|
This might be solved by #4147. The corresponding PR has not been reviewed yet. |
The MacOS CI build was fairly out-of-date, which caused slowness.
Previously dependencies took 42 minutes:
https://github.com/p4lang/p4c/actions/runs/7143318180/job/19454526195?pr=4278
Now they are taking ~1-2 minutes:
https://github.com/p4lang/p4c/actions/runs/7144321547/job/19457683307?pr=4280