Commit e1098a5f authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Update documentation on deprecation of set_sources_assignment_filter

Bug: 1018739
Change-Id: Idbdb1544c64e673a1138d3d9af825e135a680fff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437812
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811635}
parent d91c88b2
...@@ -10,8 +10,9 @@ When set_sources_assignment_filter is called, it configures a list of patterns ...@@ -10,8 +10,9 @@ When set_sources_assignment_filter is called, it configures a list of patterns
that will be used to filter names every time a variable named "sources" is that will be used to filter names every time a variable named "sources" is
assigned a value. assigned a value.
As Chromium calls this function in build/BUILDCONFIG.gn, the patterns are Historically, Chromium used to call this function in build/BUILDCONFIG.gn thus
applied to every BUILD.gn file in the project. This has multiple drawbacks: causing the patterns to be applied to every BUILD.gn file in the project. This
had multiple drawbacks:
1. the configuration of the list of patterns is located far from the point 1. the configuration of the list of patterns is located far from the point
where they are applied and developer are usually confused when a file where they are applied and developer are usually confused when a file
...@@ -26,6 +27,9 @@ applied to every BUILD.gn file in the project. This has multiple drawbacks: ...@@ -26,6 +27,9 @@ applied to every BUILD.gn file in the project. This has multiple drawbacks:
in the whole project, thus it has significant negative impact on the in the whole project, thus it has significant negative impact on the
performance of gn performance of gn
Since September 2020, the filter is enabled only for the files that have not
yet been converted. Eventually, this will be removed.
## Conversion pattern ## Conversion pattern
To convert a BUILD.gn file it is necessary to change the following: To convert a BUILD.gn file it is necessary to change the following:
...@@ -70,19 +74,14 @@ Since the second pattern never assign a name that will be filtered out, then ...@@ -70,19 +74,14 @@ Since the second pattern never assign a name that will be filtered out, then
it is compatible whether the set_sources_assignment_filter feature is used or it is compatible whether the set_sources_assignment_filter feature is used or
not. not.
## Preventing regression Once conversion is done, remove the following lines from the top of the file
to avoid regressions:
As said above, while the converted file are compatible with the feature, there
is a risk of regression. To prevent such regression, the following is added at
the top of every BUILD.gn file after it has been converted:
``` ```
# Reset sources_assignment_filter for the BUILD.gn file to prevent import("//build/config/deprecated_default_sources_assignment_filter.gni")
# regression during the migration of Chromium away from the feature. sources_assignment_filter = deprecated_default_sources_assignment_filter
# See docs/no_sources_assignment_filter.md for more information.
# TODO(crbug.com/1018739): remove this when migration is done.
set_sources_assignment_filter([])
``` ```
[0]: https://groups.google.com/a/chromium.org/d/topic/chromium-dev/hyLuCU6g2V4/discussion [0]: https://groups.google.com/a/chromium.org/d/topic/chromium-dev/hyLuCU6g2V4/discussion
[1]: https://groups.google.com/a/chromium.org/d/topic/gn-dev/oQcYStl_WkI/discussion [1]: https://groups.google.com/a/chromium.org/d/topic/gn-dev/oQcYStl_WkI/discussion
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment