-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[gn] Simplify Support::CHIPMem build. #1592
Conversation
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
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.
At some point we should pull out the #ifdefs from the alloc cpp files (after autotools is changed).
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 actually read the patch in reverse: why do we want to compile the files and rely on #ifdef macros to include or not functions inside the alloc. This looks backwards to me - we should fix autotools instead.
I will leave it to @mspang about best practices, but this seems backwards to me - if I see 'foo.cpp' being compiled, I assume it has useful code. if foo.cpp contains a '#ifdef FOO_ENABLED...' and then I compile and get nothing, that is very confusing. |
It causes a warning on Mac if we build a static library containing a file with no symbols. |
Chrome has a wrapper for Mac's libtool to suppress these warnings, so another solution is to adopt such a wrapper to suppress the warning. |
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.
Marking request changes. We should have some way to avoid the warning.
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.
Created #1595 to figure out some way to to standardize things or get a decision if the #ifdef pattern is a pattern we want to stick with.
Generally the pattern is alien to me (I expect that I only compile what I need and if I compile something, that something is generating output), however if this is somehow standard across many libraries I can live with it. Marking approve on this one for now.
@andy31415 Thanks for opening #1595. @mspang I agree we need a workaround for empty file warnings on Mac -- any ideas on how to do that? I'm not super opinionated on small adjustments like this, but I can say that large systems such as CHIP tend to have many ways to pass configuration:
In order to better decouple the codebase from any particular build system, OpenThread as a project had agreed upon and moved to a model where most configuration was passed via (2). This PR is exploiting the fact that (2) is in place already for CHIPMem, and therefor decoupling that config from GN. For consistency, the PR should probably make the parallel updates to autotools as well. |
Size increase report for "nrf-example-build"
Full report output
|
Size increase report for "linux-example-build"
Full report output
|
Size increase report for "esp32-example-build"
Full report output
|
Size increase report for "gn_nrf-example-build"
Full report output
|
Size increase report for "gn_linux-example-build"
Full report output
|
Three ideas
|
@andy31415 @mspang next steps? |
I would like to hold the line on avoiding uninteresting build output as this can drown out useful information. Here is the script Chrome uses to squelch uninteresting libtool warnings on Mac: https://chromium.googlesource.com/chromium/src.git/+/master/build/toolchain/mac/filter_libtool.py |
Closing until more general mechanisms for handling empty file warnings are in place. |
…pick/device-argument to RC_2.3.0-1.3-alpha.3 Auto-Merge: Pull request project-chip#1628: [AUTO] Cherry-Pick Pull request project-chip#1592: Provision: Added 'device' argument. Merge in WMN_TOOLS/matter from cherry-pick/device-argument to RC_2.3.0-1.3-alpha.3 Squashed commit of the following: commit e65b44b0bdc456b7db4554580bdf7aebedab0b3d Author: Ricardo Casallas <[email protected]> Date: Wed Feb 28 19:17:42 2024 +0000 Pull request project-chip#1592: Provision: Added 'device' argument. Merge in WMN_TOOLS/matter from feature/provision_device_argument to RC_2.3.0-1.3 Squashed commit of the following: commit 9f713da2c653c0400954ec14a40b45631a64cf3b Author: Ricardo Casallas <[email protected]> Date: Tue Feb 27 11:56:04 2024 -0500 Provision: Added 'device' argument.
Merge in WMN_TOOLS/matter from feature/provision_device_argument to RC_2.3.0-1.3 Squashed commit of the following: commit 9f713da2c653c0400954ec14a40b45631a64cf3b Author: Ricardo Casallas <[email protected]> Date: Tue Feb 27 11:56:04 2024 -0500 Provision: Added 'device' argument.
…pick/device-argument to RC_2.3.0-1.3-alpha.3 Auto-Merge: Pull request project-chip#1628: [AUTO] Cherry-Pick Pull request project-chip#1592: Provision: Added 'device' argument. Merge in WMN_TOOLS/matter from cherry-pick/device-argument to RC_2.3.0-1.3-alpha.3 Squashed commit of the following: commit e65b44b0bdc456b7db4554580bdf7aebedab0b3d Author: Ricardo Casallas <[email protected]> Date: Wed Feb 28 19:17:42 2024 +0000 Pull request project-chip#1592: Provision: Added 'device' argument. Merge in WMN_TOOLS/matter from feature/provision_device_argument to RC_2.3.0-1.3 Squashed commit of the following: commit 9f713da2c653c0400954ec14a40b45631a64cf3b Author: Ricardo Casallas <[email protected]> Date: Tue Feb 27 11:56:04 2024 -0500 Provision: Added 'device' argument.
Merge in WMN_TOOLS/matter from feature/provision_device_argument to RC_2.3.0-1.3 Squashed commit of the following: commit 9f713da2c653c0400954ec14a40b45631a64cf3b Author: Ricardo Casallas <[email protected]> Date: Tue Feb 27 11:56:04 2024 -0500 Provision: Added 'device' argument.
Problem
When a source file is wrapped internally to only activate when the proper configuration macros are passed, then we can simplify the build to just include all files.
Summary of Changes
Perform such a simplification for
support/CHIPMem