diff --git a/.clang-format-ignore b/.clang-format-ignore index ec5a00cb18e7..d6e5e9d0c769 100644 --- a/.clang-format-ignore +++ b/.clang-format-ignore @@ -7,6 +7,12 @@ config/msvc-stl-wrapper.template.h intl/components/src/LocaleGenerated.cpp js/src/builtin/intl/TimeZoneDataGenerated.h +# Don't want to reformat irregexp (third-party code) +js/src/irregexp/imported/.* + +# Don't want to reformat zydis (third-party library subject to occasional updates). +js/src/zydis/.* + # Generated by js/src/util/make_unicode.py js/src/util/Unicode.cpp js/src/util/UnicodeNonBMP.h @@ -15,6 +21,7 @@ js/src/util/UnicodeNonBMP.h layout/style/nsCSSAnonBoxList.h layout/style/nsCSSCounterDescList.h layout/style/nsCSSFontDescList.h +layout/style/nsCSSKeywordList.h layout/style/nsCSSPseudoElementList.h layout/style/nsCSSVisitedDependentPropList.h layout/style/nsDOMCSSValueList.h @@ -58,66 +65,45 @@ xpcom/reflect/xptcall/md/unix/.* # Generated from ./tools/rewriting/ThirdPartyPaths.txt # awk '{print ""$1".*"}' ./tools/rewriting/ThirdPartyPaths.txt -browser/components/newtab/vendor/.* -browser/components/pocket/content/panels/js/vendor/.* browser/components/translation/cld2/.* -browser/extensions/formautofill/content/third-party/.* -browser/extensions/formautofill/test/fixtures/third_party/.* -devtools/client/inspector/markup/test/lib_.* -devtools/client/jsonview/lib/require.js -devtools/client/shared/build/babel.js -devtools/client/shared/source-map/.* +browser/extensions/mortar/ppapi/.* devtools/client/shared/sourceeditor/codemirror/.* -devtools/client/shared/sourceeditor/test/cm_mode_ruby.js -devtools/client/shared/sourceeditor/test/codemirror/.* -devtools/client/shared/vendor/.* -devtools/shared/jsbeautify/.* -devtools/shared/node-properties/.* -devtools/shared/qrcode/decoder/.* -devtools/shared/qrcode/encoder/.* -devtools/shared/sprintfjs/.* -devtools/shared/storage/vendor/.* -dom/canvas/test/webgl-conf/checkout/.* -dom/imptests/.* +dom/canvas/test/webgl-conf/checkout/closure-library/.* dom/media/gmp/rlz/.* +dom/media/gmp/widevine-adapter/content_decryption_module.h dom/media/gmp/widevine-adapter/content_decryption_module_export.h dom/media/gmp/widevine-adapter/content_decryption_module_ext.h dom/media/gmp/widevine-adapter/content_decryption_module_proxy.h -dom/media/gmp/widevine-adapter/content_decryption_module.h dom/media/platforms/ffmpeg/ffmpeg57/.* dom/media/platforms/ffmpeg/ffmpeg58/.* -dom/media/platforms/ffmpeg/ffmpeg59/.* dom/media/platforms/ffmpeg/libav53/.* dom/media/platforms/ffmpeg/libav54/.* dom/media/platforms/ffmpeg/libav55/.* -dom/media/webaudio/test/blink/.* dom/media/webrtc/transport/third_party/.* dom/media/webspeech/recognition/endpointer.cc dom/media/webspeech/recognition/endpointer.h -dom/media/webspeech/recognition/energy_endpointer_params.cc -dom/media/webspeech/recognition/energy_endpointer_params.h dom/media/webspeech/recognition/energy_endpointer.cc dom/media/webspeech/recognition/energy_endpointer.h -dom/media/webvtt/vtt.jsm -dom/tests/mochitest/ajax/.* -dom/tests/mochitest/dom-level1-core/.* -dom/tests/mochitest/dom-level2-core/.* -dom/tests/mochitest/dom-level2-html/.* -dom/u2f/tests/pkijs/.* +dom/media/webspeech/recognition/energy_endpointer_params.cc +dom/media/webspeech/recognition/energy_endpointer_params.h dom/webauthn/cbor-cpp/.* -dom/webauthn/tests/pkijs/.* +dom/webauthn/winwebauthn/webauthn.h editor/libeditor/tests/browserscope/lib/richtext/.* editor/libeditor/tests/browserscope/lib/richtext2/.* extensions/spellcheck/hunspell/src/.* -gfx/angle/checkout/.* +gfx/angle/.* gfx/cairo/.* gfx/graphite2/.* gfx/harfbuzz/.* -gfx/ots/.* +gfx/ots/src/.* +gfx/ots/include/.* +gfx/ots/tests/.* gfx/qcms/.* +gfx/sfntly/.* gfx/skia/.* gfx/vr/service/openvr/.* gfx/vr/service/openvr/headers/openvr.h +gfx/vr/service/openvr/src/README gfx/vr/service/openvr/src/dirtools_public.cpp gfx/vr/service/openvr/src/dirtools_public.h gfx/vr/service/openvr/src/envvartools_public.cpp @@ -128,34 +114,29 @@ gfx/vr/service/openvr/src/ivrclientcore.h gfx/vr/service/openvr/src/openvr_api_public.cpp gfx/vr/service/openvr/src/pathtools_public.cpp gfx/vr/service/openvr/src/pathtools_public.h -gfx/vr/service/openvr/src/README gfx/vr/service/openvr/src/sharedlibtools_public.cpp gfx/vr/service/openvr/src/sharedlibtools_public.h gfx/vr/service/openvr/src/strtools_public.cpp gfx/vr/service/openvr/src/strtools_public.h gfx/vr/service/openvr/src/vrpathregistry_public.cpp gfx/vr/service/openvr/src/vrpathregistry_public.h -gfx/wr/.* gfx/ycbcr/.* +intl/hyphenation/hyphen/.* intl/icu/.* ipc/chromium/src/third_party/.* js/src/ctypes/libffi/.* -js/src/dtoa.c +js/src/dtoa.c.* js/src/editline/.* -js/src/irregexp/imported/.* js/src/jit/arm64/vixl/.* -js/src/octane/.* js/src/vtune/disable_warnings.h +js/src/vtune/ittnotify.h js/src/vtune/ittnotify_config.h js/src/vtune/ittnotify_static.c js/src/vtune/ittnotify_static.h js/src/vtune/ittnotify_types.h -js/src/vtune/ittnotify.h js/src/vtune/jitprofiling.c js/src/vtune/jitprofiling.h js/src/vtune/legacy/.* -js/src/zydis/.* -layout/docs/css-gap-decorations/.* media/ffvpx/.* media/kiss_fft/.* media/libaom/.* @@ -175,57 +156,52 @@ media/libvorbis/.* media/libvpx/.* media/libwebp/.* media/libyuv/.* -media/mozva/va.* -media/mp4parse-rust/.* +media/mozva/va/.* media/openmax_dl/.* media/openmax_il/.* -media/webrtc/signaling/gtest/MockCall.h +media/webrtc/signaling/src/sdp/sipcc/.* +media/webrtc/trunk/.* mfbt/double-conversion/double-conversion/.* mfbt/lz4/.* +mobile/android/geckoview/src/thirdparty/.* modules/brotli/.* modules/fdlibm/.* modules/freetype2/.* -modules/woff2/.* +modules/libbz2/.* +modules/pdfium/.* +modules/woff2/include/.* +modules/woff2/src/.* modules/xz-embedded/.* modules/zlib/.* mozglue/misc/decimal/.* mozglue/tests/glibc_printf_tests/.* netwerk/dns/nsIDNKitInterface.h netwerk/sctp/src/.* +netwerk/srtp/src/.* nsprpub/.* other-licenses/.* parser/expat/.* -remote/cdp/test/browser/chrome-remote-interface.js -remote/test/puppeteer/.* security/nss/.* -security/sandbox/chromium-shim/.* security/sandbox/chromium/.* -testing/mochitest/MochiKit/.* -testing/mochitest/pywebsocket3/.* -testing/mochitest/tests/MochiKit-1.4.2/.* -testing/modules/sinon-7.2.7.js -testing/mozbase/mozproxy/mozproxy/backends/mitm/scripts/catapult/.* +security/sandbox/chromium-shim/.* +testing/gtest/gmock/.* +testing/gtest/gtest/.* testing/talos/talos/tests/dromaeo/.* testing/talos/talos/tests/kraken/.* testing/talos/talos/tests/v8_7/.* testing/web-platform/tests/resources/webidl2/.* testing/web-platform/tests/tools/third_party/.* -testing/xpcshell/dns-packet/.* -testing/xpcshell/node-http2/.* -testing/xpcshell/node-ip/.* -testing/xpcshell/odoh-wasm/.* third_party/.* -toolkit/components/certviewer/content/vendor/.* toolkit/components/jsoncpp/.* -toolkit/components/normandy/vendor/.* -toolkit/components/passwordmgr/PasswordRulesParser.jsm toolkit/components/protobuf/.* toolkit/components/url-classifier/chromium/.* -toolkit/components/utils/mozjexl.js +toolkit/components/url-classifier/protobuf/.* toolkit/crashreporter/breakpad-client/.* toolkit/crashreporter/google-breakpad/.* tools/fuzzing/libfuzzer/.* tools/profiler/core/vtune/.* +# tools/profiler/public/GeckoTraceEvent.h is a modified vendored copy +tools/profiler/public/GeckoTraceEvent.h xpcom/build/mach_override.c xpcom/build/mach_override.h xpcom/io/crc32c.c diff --git a/build/clang-plugin/ThirdPartyPaths.py b/build/clang-plugin/ThirdPartyPaths.py index bd9d23697405..caaa919d43f2 100644 --- a/build/clang-plugin/ThirdPartyPaths.py +++ b/build/clang-plugin/ThirdPartyPaths.py @@ -1,17 +1,6 @@ #!/usr/bin/env python3 -import glob import json -import sys - -# Import buildconfig if available, otherwise set has_buildconfig to False so -# we skip the check which relies on it. -try: - import buildconfig -except ImportError: - has_buildconfig = False -else: - has_buildconfig = True def generate(output, *input_paths): @@ -22,7 +11,6 @@ def generate(output, *input_paths): """ tpp_list = [] lines = set() - path_found = True for path in input_paths: with open(path) as f: @@ -32,25 +20,7 @@ def generate(output, *input_paths): line = line.strip() if line.endswith("/"): line = line[:-1] - - if has_buildconfig: - # Ignore lines starting with $UNVALIDATED - # These should only be coming from Unvalidated.txt - if line.startswith("$UNVALIDATED"): - line = line[13:] - elif not glob.glob(buildconfig.topsrcdir + "/" + line): - path_found = False - - if path_found: - tpp_list.append(line) - else: - print( - "Third-party path " - + line - + " does not exist. Remove it from Generated.txt or " - + "ThirdPartyPaths.txt and try again." - ) - sys.exit(1) + tpp_list.append(line) tpp_strings = ",\n ".join([json.dumps(tpp) for tpp in sorted(tpp_list)]) output.write( diff --git a/build/clang-plugin/import_mozilla_checks.py b/build/clang-plugin/import_mozilla_checks.py index e6de6987b024..70585c88594b 100755 --- a/build/clang-plugin/import_mozilla_checks.py +++ b/build/clang-plugin/import_mozilla_checks.py @@ -95,14 +95,8 @@ def add_moz_module(cmake_path): def write_third_party_paths(mozilla_path, module_path): tpp_txt = os.path.join(mozilla_path, "../../tools/rewriting/ThirdPartyPaths.txt") generated_txt = os.path.join(mozilla_path, "../../tools/rewriting/Generated.txt") - # Unvalidated.txt is used for rare cases where we don't want to validate that a given - # path exists but still want it included in the ThirdPartyPaths check in the plugin. - # For example, headers exported to dist/include that live elsewhere. - unvalidated_txt = os.path.join( - mozilla_path, "../../tools/rewriting/Unvalidated.txt" - ) with open(os.path.join(module_path, "ThirdPartyPaths.cpp"), "w") as f: - ThirdPartyPaths.generate(f, tpp_txt, generated_txt, unvalidated_txt) + ThirdPartyPaths.generate(f, tpp_txt, generated_txt) def generate_thread_allows(mozilla_path, module_path): diff --git a/build/clang-plugin/moz.build b/build/clang-plugin/moz.build index a7495d0e9437..5fc8c1d0e391 100644 --- a/build/clang-plugin/moz.build +++ b/build/clang-plugin/moz.build @@ -70,9 +70,8 @@ GeneratedFile( script="ThirdPartyPaths.py", entry_point="generate", inputs=[ - "/tools/rewriting/Generated.txt", "/tools/rewriting/ThirdPartyPaths.txt", - "/tools/rewriting/Unvalidated.txt", + "/tools/rewriting/Generated.txt", ], ) diff --git a/tools/rewriting/Generated.txt b/tools/rewriting/Generated.txt index 99d1371fed16..1865e4ac32c9 100644 --- a/tools/rewriting/Generated.txt +++ b/tools/rewriting/Generated.txt @@ -1,3 +1,11 @@ +browser/components/newtab/logs/ +browser/components/newtab/node_modules/ +devtools/client/aboutdebugging/test/jest/node_modules/ +devtools/client/application/test/components/node_modules/ +devtools/client/debugger/node_modules/ +dom/tests/ajax/jquery/ +dom/tests/ajax/mochikit/ +node_modules/ intl/components/src/UnicodeScriptCodes.h intl/unicharutil/util/nsSpecialCasingData.cpp intl/unicharutil/util/nsUnicodePropertyData.cpp diff --git a/tools/rewriting/ThirdPartyPaths.txt b/tools/rewriting/ThirdPartyPaths.txt index 0d88ba30b02f..6e80d3de1ac5 100644 --- a/tools/rewriting/ThirdPartyPaths.txt +++ b/tools/rewriting/ThirdPartyPaths.txt @@ -1,8 +1,10 @@ browser/components/newtab/vendor/ browser/components/pocket/content/panels/js/vendor/ +browser/components/storybook/node_modules/ browser/components/translation/cld2/ browser/extensions/formautofill/content/third-party/ browser/extensions/formautofill/test/fixtures/third_party/ +browser/extensions/screenshots/build/raven.js devtools/client/inspector/markup/test/lib_* devtools/client/jsonview/lib/require.js devtools/client/shared/build/babel.js @@ -11,6 +13,7 @@ devtools/client/shared/sourceeditor/codemirror/ devtools/client/shared/sourceeditor/test/cm_mode_ruby.js devtools/client/shared/sourceeditor/test/codemirror/ devtools/client/shared/vendor/ +devtools/shared/acorn/ devtools/shared/heapsnapshot/CoreDump.pb.cc devtools/shared/heapsnapshot/CoreDump.pb.h devtools/shared/jsbeautify/ @@ -24,8 +27,8 @@ dom/imptests/ dom/media/gmp/rlz/ dom/media/gmp/widevine-adapter/content_decryption_module_export.h dom/media/gmp/widevine-adapter/content_decryption_module_ext.h -dom/media/gmp/widevine-adapter/content_decryption_module_proxy.h dom/media/gmp/widevine-adapter/content_decryption_module.h +dom/media/gmp/widevine-adapter/content_decryption_module_proxy.h dom/media/platforms/ffmpeg/ffmpeg57/ dom/media/platforms/ffmpeg/ffmpeg58/ dom/media/platforms/ffmpeg/ffmpeg59/ @@ -36,10 +39,10 @@ dom/media/webaudio/test/blink/ dom/media/webrtc/transport/third_party/ dom/media/webspeech/recognition/endpointer.cc dom/media/webspeech/recognition/endpointer.h -dom/media/webspeech/recognition/energy_endpointer_params.cc -dom/media/webspeech/recognition/energy_endpointer_params.h dom/media/webspeech/recognition/energy_endpointer.cc dom/media/webspeech/recognition/energy_endpointer.h +dom/media/webspeech/recognition/energy_endpointer_params.cc +dom/media/webspeech/recognition/energy_endpointer_params.h dom/media/webvtt/vtt.jsm dom/tests/mochitest/ajax/ dom/tests/mochitest/dom-level1-core/ @@ -51,15 +54,18 @@ dom/webauthn/tests/pkijs/ editor/libeditor/tests/browserscope/lib/richtext/ editor/libeditor/tests/browserscope/lib/richtext2/ extensions/spellcheck/hunspell/src/ +function2/ gfx/angle/checkout/ gfx/cairo/ gfx/graphite2/ gfx/harfbuzz/ gfx/ots/ gfx/qcms/ +gfx/sfntly/ gfx/skia/ gfx/vr/service/openvr/ gfx/vr/service/openvr/headers/openvr.h +gfx/vr/service/openvr/src/README gfx/vr/service/openvr/src/dirtools_public.cpp gfx/vr/service/openvr/src/dirtools_public.h gfx/vr/service/openvr/src/envvartools_public.cpp @@ -70,7 +76,6 @@ gfx/vr/service/openvr/src/ivrclientcore.h gfx/vr/service/openvr/src/openvr_api_public.cpp gfx/vr/service/openvr/src/pathtools_public.cpp gfx/vr/service/openvr/src/pathtools_public.h -gfx/vr/service/openvr/src/README gfx/vr/service/openvr/src/sharedlibtools_public.cpp gfx/vr/service/openvr/src/sharedlibtools_public.h gfx/vr/service/openvr/src/strtools_public.cpp @@ -84,15 +89,14 @@ ipc/chromium/src/third_party/ js/src/ctypes/libffi/ js/src/dtoa.c js/src/editline/ -js/src/irregexp/imported/ js/src/jit/arm64/vixl/ js/src/octane/ js/src/vtune/disable_warnings.h js/src/vtune/ittnotify_config.h +js/src/vtune/ittnotify.h js/src/vtune/ittnotify_static.c js/src/vtune/ittnotify_static.h js/src/vtune/ittnotify_types.h -js/src/vtune/ittnotify.h js/src/vtune/jitprofiling.c js/src/vtune/jitprofiling.h js/src/vtune/legacy/ @@ -123,7 +127,8 @@ media/openmax_dl/ media/openmax_il/ media/webrtc/signaling/gtest/MockCall.h mfbt/double-conversion/double-conversion/ -mfbt/lz4/ +mfbt/lz4/.* +mobile/android/geckoview/src/thirdparty/ modules/brotli/ modules/fdlibm/ modules/freetype2/ @@ -134,14 +139,17 @@ mozglue/misc/decimal/ mozglue/tests/glibc_printf_tests/ netwerk/dns/nsIDNKitInterface.h netwerk/sctp/src/ +netwerk/srtp/src/ nsprpub/ other-licenses/ parser/expat/ remote/cdp/test/browser/chrome-remote-interface.js remote/test/puppeteer/ security/nss/ -security/sandbox/chromium-shim/ security/sandbox/chromium/ +security/sandbox/chromium-shim/ +testing/gtest/gmock/ +testing/gtest/gtest/ testing/mochitest/MochiKit/ testing/mochitest/pywebsocket3/ testing/mochitest/tests/MochiKit-1.4.2/ @@ -153,8 +161,8 @@ testing/talos/talos/tests/v8_7/ testing/web-platform/tests/resources/webidl2/ testing/web-platform/tests/tools/third_party/ testing/xpcshell/dns-packet/ -testing/xpcshell/node-http2/ testing/xpcshell/node-ip/ +testing/xpcshell/node-http2/ testing/xpcshell/odoh-wasm/ third_party/ toolkit/components/certviewer/content/vendor/ diff --git a/tools/rewriting/Unvalidated.txt b/tools/rewriting/Unvalidated.txt deleted file mode 100644 index 96f540d1f19a..000000000000 --- a/tools/rewriting/Unvalidated.txt +++ /dev/null @@ -1 +0,0 @@ -$UNVALIDATED/function2